Merge lp:~3v1n0/unity/overlay-border-scale into lp:unity

Proposed by Marco Trevisan (Treviño) on 2014-07-10
Status: Merged
Approved by: Eleni Maria Stea on 2014-07-11
Approved revision: 3899
Merged at revision: 3842
Proposed branch: lp:~3v1n0/unity/overlay-border-scale
Merge into: lp:unity
Prerequisite: lp:~3v1n0/unity/dash-filters-scaling
Diff against target: 1590 lines (+496/-368)
23 files modified
dash/PlacesGroup.cpp (+4/-4)
dash/previews/PaymentPreview.cpp (+14/-6)
dash/previews/PreviewContainer.cpp (+3/-4)
plugins/unityshell/src/unityshell.cpp (+14/-10)
plugins/unityshell/src/unityshell.h (+1/-0)
resources/flow-view.svg (+0/-16)
resources/grid-view.svg (+0/-21)
resources/search_magnify.svg (+155/-0)
tests/test_places_group.cpp (+15/-15)
tests/test_previews_payment.cpp (+1/-2)
unity-shared/CoverArt.cpp (+6/-5)
unity-shared/CoverArt.h (+3/-3)
unity-shared/DashStyle.cpp (+102/-143)
unity-shared/DashStyle.h (+35/-34)
unity-shared/DashStyleInterface.h (+5/-4)
unity-shared/OverlayRenderer.cpp (+109/-67)
unity-shared/PreviewStyle.cpp (+0/-7)
unity-shared/PreviewStyle.h (+0/-1)
unity-shared/RatingsButton.cpp (+1/-1)
unity-shared/RawPixel.h (+1/-1)
unity-shared/SearchBarSpinner.cpp (+13/-17)
unity-shared/SearchBarSpinner.h (+4/-4)
unity-shared/TextureCache.cpp (+10/-3)
To merge this branch: bzr merge lp:~3v1n0/unity/overlay-border-scale
Reviewer Review Type Date Requested Status
Eleni Maria Stea (community) 2014-07-11 Approve on 2014-07-11
PS Jenkins bot (community) continuous-integration Approve on 2014-07-11
Unity Team 2014-07-10 Pending
Review via email: mp+226378@code.launchpad.net

Commit message

OverlayRendering: correctly scale the overlays borders and edges to match settings

DashStyle has been modified to return smart pointers of textures that are loaded
depending on the scale level. The cache will make sure that we don't duplicate
the textures and that they get removed when not needed anymore.

Also thanks to this the SearchBarSpinner textures (and the other spinners as well)
uses the SVGs scaled at the proper size (I desgined a new SVG for the magnifier,
as we only had a PNG).

To post a comment you must log in.
lp:~3v1n0/unity/overlay-border-scale updated on 2014-07-10
3892. By Marco Trevisan (Treviño) on 2014-07-10

UnityScreen: properly scale the launcher width to match monitor scaling

3893. By Marco Trevisan (Treviño) on 2014-07-10

UnityScreen: make sure we update the launcher size also on launchers added later

3894. By Marco Trevisan (Treviño) on 2014-07-10

resources: remove obsolete files

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~3v1n0/unity/overlay-border-scale updated on 2014-07-11
3895. By Marco Trevisan (Treviño) on 2014-07-11

TestPlacesGroup: correctly implement the mock style to match new API

3896. By Marco Trevisan (Treviño) on 2014-07-11

RawPixel: add default parameter set to 0

3897. By Marco Trevisan (Treviño) on 2014-07-11

TextureCache: it looks like our Hash function was flawed, and in some cases gave false positive

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~3v1n0/unity/overlay-border-scale updated on 2014-07-11
3898. By Marco Trevisan (Treviño) on 2014-07-11

TestPaymentPreview: make sure that the header gets deleted or we'd get a CoverArt leak

And that will break the TextureCache tests

3899. By Marco Trevisan (Treviño) on 2014-07-11

CoverArt: make possible the image to be stretched again

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Eleni Maria Stea (hikiko) wrote :

+1, lgtm :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/PlacesGroup.cpp'
2--- dash/PlacesGroup.cpp 2014-07-11 03:37:01 +0000
3+++ dash/PlacesGroup.cpp 2014-07-11 03:37:01 +0000
4@@ -132,8 +132,8 @@
5 SetAcceptKeyNavFocusOnMouseEnter(false);
6 scale.changed.connect(sigc::mem_fun(this, &PlacesGroup::UpdateScale));
7
8- _background = _style.GetCategoryBackground();
9- _background_nofilters = _style.GetCategoryBackgroundNoFilters();
10+ _background = _style.GetCategoryBackground().GetPointer();
11+ _background_nofilters = _style.GetCategoryBackgroundNoFilters().GetPointer();
12
13 nux::ROPConfig rop;
14 rop.Blend = true;
15@@ -141,8 +141,8 @@
16 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
17
18 nux::TexCoordXForm texxform;
19- _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(),
20- texxform,
21+ _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(),
22+ texxform,
23 nux::color::White,
24 false,
25 rop));
26
27=== modified file 'dash/previews/PaymentPreview.cpp'
28--- dash/previews/PaymentPreview.cpp 2014-07-11 03:37:01 +0000
29+++ dash/previews/PaymentPreview.cpp 2014-07-11 03:37:01 +0000
30@@ -23,6 +23,7 @@
31 #include <NuxCore/Logger.h>
32 #include "PaymentPreview.h"
33 #include "unity-shared/CoverArt.h"
34+#include "unity-shared/DashStyle.h"
35 #include "unity-shared/PreviewStyle.h"
36
37 namespace unity
38@@ -56,6 +57,8 @@
39 public:
40 OverlaySpinner();
41
42+ nux::Property<double> scale;
43+
44 void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
45 void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
46
47@@ -70,7 +73,7 @@
48 private:
49 bool OnFrameTimeout();
50
51- nux::BaseTexture* spin_;
52+ nux::ObjectPtr<nux::BaseTexture> spin_;
53
54 glib::Source::UniquePtr frame_timeout_;
55
56@@ -81,15 +84,19 @@
57 NUX_IMPLEMENT_OBJECT_TYPE(OverlaySpinner);
58
59 OverlaySpinner::OverlaySpinner()
60- : nux::View(NUX_TRACKER_LOCATION),
61- rotation_(0.0f)
62+ : nux::View(NUX_TRACKER_LOCATION)
63+ , scale(1.0)
64+ , rotation_(0.0f)
65 {
66- previews::Style& style = dash::previews::Style::Instance();
67-
68- spin_ = style.GetSearchSpinIcon();
69+ spin_ = dash::Style::Instance().GetSearchSpinIcon(scale);
70
71 rotate_.Identity();
72 rotate_.Rotate_z(0.0);
73+
74+ scale.changed.connect([this] (double scale) {
75+ spin_ = dash::Style::Instance().GetSearchSpinIcon(scale);
76+ QueueDraw();
77+ });
78 }
79
80 void OverlaySpinner::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
81@@ -366,6 +373,7 @@
82 overlay_layout_->AddView(calculating_, 0, nux::MINOR_POSITION_CENTER);
83 overlay_layout_->AddView(spinner_, 1, nux::MINOR_POSITION_CENTER);
84 overlay_layout_->AddSpace(OVERLAY_LAYOUT_SPACE.CP(scale), 1);
85+ scale.changed.connect([this, spinner_] (double scale) { spinner_->scale = scale; });
86
87 full_data_layout_->AddLayout(overlay_layout_.GetPointer());
88
89
90=== modified file 'dash/previews/PreviewContainer.cpp'
91--- dash/previews/PreviewContainer.cpp 2014-07-11 03:37:01 +0000
92+++ dash/previews/PreviewContainer.cpp 2014-07-11 03:37:01 +0000
93@@ -27,6 +27,7 @@
94 #include "unity-shared/IntrospectableWrappers.h"
95 #include "unity-shared/TimeUtil.h"
96 #include "unity-shared/PreviewStyle.h"
97+#include "unity-shared/DashStyle.h"
98 #include "unity-shared/GraphicsUtils.h"
99 #include "PreviewNavigator.h"
100 #include <boost/math/constants/constants.hpp>
101@@ -51,8 +52,6 @@
102 const int PREVIEW_SPINNER_WAIT = 2000;
103
104 const std::string ANIMATION_IDLE = "animation-idle";
105-
106-const RawPixel SPIN_ICON_SIZE = 32_em;
107 const RawPixel CHILDREN_SPACE = 6_em;
108 }
109
110@@ -77,13 +76,13 @@
111 UpdateAnimationProgress(progress_, curve_progress_);
112 });
113
114- spin_ = Style::Instance().GetSearchSpinIcon(SPIN_ICON_SIZE.CP(scale));
115+ spin_ = dash::Style::Instance().GetSearchSpinIcon(scale);
116 scale.changed.connect(sigc::mem_fun(this, &PreviewContent::UpdateScale));
117 }
118
119 void UpdateScale(double scale)
120 {
121- spin_ = Style::Instance().GetSearchSpinIcon(SPIN_ICON_SIZE.CP(scale));
122+ spin_ = dash::Style::Instance().GetSearchSpinIcon(scale);
123
124 for (auto* area : GetChildren())
125 static_cast<previews::Preview*>(area)->scale = scale;
126
127=== modified file 'plugins/unityshell/src/unityshell.cpp'
128--- plugins/unityshell/src/unityshell.cpp 2014-06-19 18:41:07 +0000
129+++ plugins/unityshell/src/unityshell.cpp 2014-07-11 03:37:01 +0000
130@@ -3952,8 +3952,8 @@
131 /* The launcher geometry includes 1px used to draw the right margin
132 * that must not be considered when drawing an overlay */
133
134- int launcher_width = w - 1;
135- Launcher const* const launcher = static_cast<Launcher*>(area);
136+ auto* launcher = static_cast<Launcher*>(area);
137+ int launcher_width = w - (1_em).CP(unity_settings_.em(launcher->monitor)->DPIScale());
138
139 unity::Settings::Instance().SetLauncherWidth(launcher_width, launcher->monitor);
140 shortcut_controller_->SetAdjustment(launcher_width, panel_style_.PanelHeight(launcher->monitor));
141@@ -3967,18 +3967,22 @@
142 screen->setOptionForPlugin("scale", "x_offset", v);
143 };
144
145- for (auto const& launcher : launcher_controller_->launchers())
146- {
147- launcher->size_changed.connect(on_launcher_size_changed);
148-
149- on_launcher_size_changed(launcher.GetPointer(), launcher->GetWidth(), launcher->GetHeight());
150- }
151-
152- UScreen::GetDefault()->changed.connect([this, on_launcher_size_changed] (int, std::vector<nux::Geometry> const&) {
153+ auto check_launchers_size = [this, on_launcher_size_changed] {
154+ launcher_size_connections_.Clear();
155+
156 for (auto const& launcher : launcher_controller_->launchers())
157+ {
158+ launcher_size_connections_.Add(launcher->size_changed.connect(on_launcher_size_changed));
159 on_launcher_size_changed(launcher.GetPointer(), launcher->GetWidth(), launcher->GetHeight());
160+ }
161+ };
162+
163+ UScreen::GetDefault()->changed.connect([this, check_launchers_size] (int, std::vector<nux::Geometry> const&) {
164+ check_launchers_size();
165 });
166
167+ check_launchers_size();
168+
169 launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons();
170 launcher_controller_->options()->minimize_window_on_click = optionGetLauncherMinimizeWindow();
171
172
173=== modified file 'plugins/unityshell/src/unityshell.h'
174--- plugins/unityshell/src/unityshell.h 2014-05-12 22:01:39 +0000
175+++ plugins/unityshell/src/unityshell.h 2014-07-11 03:37:01 +0000
176@@ -423,6 +423,7 @@
177 UBusManager ubus_manager_;
178 glib::SourceManager sources_;
179 connection::Wrapper hud_ungrab_slot_;
180+ connection::Manager launcher_size_connections_;
181
182 CompRegion buffered_compiz_damage_this_frame_;
183 CompRegion buffered_compiz_damage_last_frame_;
184
185=== removed file 'resources/dash_fullscreen_icon.png'
186Binary files resources/dash_fullscreen_icon.png 2011-04-11 21:54:34 +0000 and resources/dash_fullscreen_icon.png 1970-01-01 00:00:00 +0000 differ
187=== removed file 'resources/dash_left_edge.png'
188Binary files resources/dash_left_edge.png 2011-08-25 06:43:17 +0000 and resources/dash_left_edge.png 1970-01-01 00:00:00 +0000 differ
189=== removed file 'resources/find_files.png'
190Binary files resources/find_files.png 2011-04-11 21:54:34 +0000 and resources/find_files.png 1970-01-01 00:00:00 +0000 differ
191=== removed file 'resources/find_internet_apps.png'
192Binary files resources/find_internet_apps.png 2011-04-11 21:54:34 +0000 and resources/find_internet_apps.png 1970-01-01 00:00:00 +0000 differ
193=== removed file 'resources/find_media_apps.png'
194Binary files resources/find_media_apps.png 2011-04-11 21:54:34 +0000 and resources/find_media_apps.png 1970-01-01 00:00:00 +0000 differ
195=== removed file 'resources/find_more_apps.png'
196Binary files resources/find_more_apps.png 2011-04-11 21:54:34 +0000 and resources/find_more_apps.png 1970-01-01 00:00:00 +0000 differ
197=== removed file 'resources/flow-view.svg'
198--- resources/flow-view.svg 2011-06-30 17:24:25 +0000
199+++ resources/flow-view.svg 1970-01-01 00:00:00 +0000
200@@ -1,16 +0,0 @@
201-<?xml version="1.0" encoding="utf-8"?>
202-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
203-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
204-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
205- width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
206-<path fill="#FFFFFF" d="M19,7H3C2.45,7,2,7.45,2,8v16c0,0.55,0.45,1,1,1h16c0.55,0,1-0.45,1-1V8C20,7.45,19.55,7,19,7z M18,23H4V9
207- h14V23z"/>
208-<g opacity="0.3">
209- <g>
210- <path fill="#FFFFFF" d="M23,8.019h-2v1h2v13.963h-2v1h2c0.55,0,1-0.45,1-1V9.019C24,8.469,23.55,8.019,23,8.019z M26,9.025h-1v1h1
211- v11.957h-1v1h1c0.55,0,1-0.45,1-1V10.024C27,9.475,26.55,9.025,26,9.025z M29,10.024h-1v1h1v9.957h-1v1h1c0.55,0,1-0.45,1-1
212- v-9.957C30,10.475,29.55,10.024,29,10.024z"/>
213- </g>
214-</g>
215-</svg>
216-
217\ No newline at end of file
218
219=== removed file 'resources/grid-view.svg'
220--- resources/grid-view.svg 2011-06-30 17:24:25 +0000
221+++ resources/grid-view.svg 1970-01-01 00:00:00 +0000
222@@ -1,21 +0,0 @@
223-<?xml version="1.0" encoding="utf-8"?>
224-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
225-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
226-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
227- width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
228-<g>
229- <g>
230- <path fill="#FFFFFF" d="M6,8.5H2c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C7,8.95,6.55,8.5,6,8.5z M6,13.5
231- H2v-4h4V13.5z M14,8.5h-4c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C15,8.95,14.55,8.5,14,8.5z M14,13.5h-4
232- v-4h4V13.5z M22,8.5h-4c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C23,8.95,22.55,8.5,22,8.5z M22,13.5h-4v-4
233- h4V13.5z M30,8.5h-4c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C31,8.95,30.55,8.5,30,8.5z M30,13.5h-4v-4h4
234- V13.5z M6,17.5H2c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C7,17.95,6.55,17.5,6,17.5z M6,22.5H2v-4h4V22.5z
235- M14,17.5h-4c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C15,17.95,14.55,17.5,14,17.5z M14,22.5h-4v-4h4V22.5
236- z M22,17.5h-4c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C23,17.95,22.55,17.5,22,17.5z M22,22.5h-4v-4h4
237- V22.5z M30,17.5h-4c-0.55,0-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-4C31,17.95,30.55,17.5,30,17.5z M30,22.5h-4v-4
238- h4V22.5z"/>
239- </g>
240-</g>
241-<path opacity="0.3" fill="#FFFFFF" d="M31,16.5H1v-1h30V16.5z"/>
242-</svg>
243-
244\ No newline at end of file
245
246=== removed file 'resources/search_magnify.png'
247Binary files resources/search_magnify.png 2012-03-14 06:24:18 +0000 and resources/search_magnify.png 1970-01-01 00:00:00 +0000 differ
248=== added file 'resources/search_magnify.svg'
249--- resources/search_magnify.svg 1970-01-01 00:00:00 +0000
250+++ resources/search_magnify.svg 2014-07-11 03:37:01 +0000
251@@ -0,0 +1,155 @@
252+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
253+<!-- Created with Inkscape (http://www.inkscape.org/) -->
254+
255+<svg
256+ xmlns:dc="http://purl.org/dc/elements/1.1/"
257+ xmlns:cc="http://creativecommons.org/ns#"
258+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
259+ xmlns:svg="http://www.w3.org/2000/svg"
260+ xmlns="http://www.w3.org/2000/svg"
261+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
262+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
263+ width="32"
264+ height="32"
265+ id="svg2"
266+ version="1.1"
267+ inkscape:version="0.48.4 r9939"
268+ sodipodi:docname="search_magnify.svg"
269+ inkscape:export-filename="/home/marco/Dev/unity/trunk/resources/search_magnify.png"
270+ inkscape:export-xdpi="90"
271+ inkscape:export-ydpi="90">
272+ <defs
273+ id="defs4">
274+ <inkscape:perspective
275+ sodipodi:type="inkscape:persp3d"
276+ inkscape:vp_x="0 : 526.18109 : 1"
277+ inkscape:vp_y="0 : 1000 : 0"
278+ inkscape:vp_z="744.09448 : 526.18109 : 1"
279+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
280+ id="perspective10" />
281+ <inkscape:perspective
282+ id="perspective2841"
283+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
284+ inkscape:vp_z="1 : 0.5 : 1"
285+ inkscape:vp_y="0 : 1000 : 0"
286+ inkscape:vp_x="0 : 0.5 : 1"
287+ sodipodi:type="inkscape:persp3d" />
288+ <inkscape:perspective
289+ id="perspective2858"
290+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
291+ inkscape:vp_z="1 : 0.5 : 1"
292+ inkscape:vp_y="0 : 1000 : 0"
293+ inkscape:vp_x="0 : 0.5 : 1"
294+ sodipodi:type="inkscape:persp3d" />
295+ <inkscape:perspective
296+ id="perspective2872"
297+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
298+ inkscape:vp_z="1 : 0.5 : 1"
299+ inkscape:vp_y="0 : 1000 : 0"
300+ inkscape:vp_x="0 : 0.5 : 1"
301+ sodipodi:type="inkscape:persp3d" />
302+ <inkscape:perspective
303+ id="perspective2968"
304+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
305+ inkscape:vp_z="1 : 0.5 : 1"
306+ inkscape:vp_y="0 : 1000 : 0"
307+ inkscape:vp_x="0 : 0.5 : 1"
308+ sodipodi:type="inkscape:persp3d" />
309+ <inkscape:perspective
310+ id="perspective2996"
311+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
312+ inkscape:vp_z="1 : 0.5 : 1"
313+ inkscape:vp_y="0 : 1000 : 0"
314+ inkscape:vp_x="0 : 0.5 : 1"
315+ sodipodi:type="inkscape:persp3d" />
316+ <inkscape:perspective
317+ id="perspective3840"
318+ inkscape:persp3d-origin="512 : 256 : 1"
319+ inkscape:vp_z="1024 : 384 : 1"
320+ inkscape:vp_y="0 : 1000 : 0"
321+ inkscape:vp_x="0 : 384 : 1"
322+ sodipodi:type="inkscape:persp3d" />
323+ <inkscape:perspective
324+ id="perspective3947"
325+ inkscape:persp3d-origin="512 : 256 : 1"
326+ inkscape:vp_z="1024 : 384 : 1"
327+ inkscape:vp_y="0 : 1000 : 0"
328+ inkscape:vp_x="0 : 384 : 1"
329+ sodipodi:type="inkscape:persp3d" />
330+ </defs>
331+ <sodipodi:namedview
332+ id="base"
333+ pagecolor="#000000"
334+ bordercolor="#666666"
335+ borderopacity="1.0"
336+ inkscape:pageopacity="0"
337+ inkscape:pageshadow="2"
338+ inkscape:zoom="22.627417"
339+ inkscape:cx="19.934341"
340+ inkscape:cy="17.717928"
341+ inkscape:document-units="px"
342+ inkscape:current-layer="g3928"
343+ showgrid="false"
344+ inkscape:window-width="1496"
345+ inkscape:window-height="778"
346+ inkscape:window-x="418"
347+ inkscape:window-y="57"
348+ inkscape:window-maximized="0"
349+ inkscape:snap-grids="false" />
350+ <metadata
351+ id="metadata7">
352+ <rdf:RDF>
353+ <cc:Work
354+ rdf:about="">
355+ <dc:format>image/svg+xml</dc:format>
356+ <dc:type
357+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
358+ <dc:title></dc:title>
359+ </cc:Work>
360+ </rdf:RDF>
361+ </metadata>
362+ <g
363+ inkscape:label="Layer 1"
364+ inkscape:groupmode="layer"
365+ id="layer1"
366+ transform="translate(0,-1020.3622)">
367+ <g
368+ id="g3950"
369+ transform="translate(-735.82017,643.9392)"
370+ style="fill:#2b0000">
371+ <g
372+ id="g3928"
373+ style="fill:#ffffff">
374+ <path
375+ id="path3932"
376+ d="m 744.82017,392.423 c 0,-3.866 3.134,-7 7,-7 3.866,0 7,3.134 7,7 h 2 c 0,-4.971 -4.029,-9 -9,-9 -4.971,0 -9,4.029 -9,9 0,4.971 4.029,9 9,9 v -2 c -3.866,0 -7,-3.134 -7,-7 z"
377+ style="fill:#ffffff;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none" />
378+ <linearGradient
379+ y2="391.6506"
380+ x2="753.69513"
381+ y1="402.29791"
382+ x1="747.54791"
383+ gradientUnits="userSpaceOnUse"
384+ id="SVGID_1_">
385+ <stop
386+ id="stop3935"
387+ style="stop-color:#FFFFFF"
388+ offset="0.1411" />
389+ <stop
390+ id="stop3937"
391+ style="stop-color:#FFFFFF;stop-opacity:0"
392+ offset="0.7423" />
393+ </linearGradient>
394+ <path
395+ id="path3939"
396+ d="m 760.82017,392.423 h -2 c 0,3.866 -3.134,7 -7,7 v 2 c 4.971,0 9,-4.029 9,-9 z"
397+ style="fill:#ffffff;fill-opacity:1" />
398+ <path
399+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
400+ d="m 761.82017,401.423 -2,-2"
401+ id="path3806"
402+ inkscape:connector-curvature="0" />
403+ </g>
404+ </g>
405+ </g>
406+</svg>
407
408=== removed file 'resources/shortcuts_group_icon.png'
409Binary files resources/shortcuts_group_icon.png 2011-04-11 21:54:34 +0000 and resources/shortcuts_group_icon.png 1970-01-01 00:00:00 +0000 differ
410=== modified file 'tests/test_places_group.cpp'
411--- tests/test_places_group.cpp 2014-07-11 03:37:01 +0000
412+++ tests/test_places_group.cpp 2014-07-11 03:37:01 +0000
413@@ -40,11 +40,11 @@
414 }
415
416 MOCK_METHOD2(FocusOverlay, nux::AbstractPaintLayer*(int width, int height));
417- MOCK_METHOD0(GetCategoryBackground, nux::BaseTexture*());
418- MOCK_METHOD0(GetCategoryBackgroundNoFilters, nux::BaseTexture*());
419+ MOCK_CONST_METHOD0(GetCategoryBackground, nux::ObjectPtr<nux::BaseTexture> const&());
420+ MOCK_CONST_METHOD0(GetCategoryBackgroundNoFilters, nux::ObjectPtr<nux::BaseTexture> const&());
421
422- MOCK_METHOD0(GetGroupExpandIcon, nux::BaseTexture*());
423- MOCK_METHOD0(GetGroupUnexpandIcon, nux::BaseTexture*());
424+ MOCK_CONST_METHOD0(GetGroupExpandIcon, nux::ObjectPtr<nux::BaseTexture> const&());
425+ MOCK_CONST_METHOD0(GetGroupUnexpandIcon, nux::ObjectPtr<nux::BaseTexture> const&());
426
427 MOCK_CONST_METHOD0(GetCategoryIconSize, RawPixel());
428 MOCK_CONST_METHOD0(GetCategoryHeaderLeftPadding, RawPixel());
429@@ -72,17 +72,17 @@
430 ON_CALL(dash_style_, FocusOverlay(_, _))
431 .WillByDefault(Return(new nux::ColorLayer(nux::color::White)));
432
433- ON_CALL(dash_style_, GetCategoryBackground())
434- .WillByDefault(Return(dash_style_.base_texture_.GetPointer()));
435-
436- ON_CALL(dash_style_, GetCategoryBackgroundNoFilters())
437- .WillByDefault(Return(dash_style_.base_texture_.GetPointer()));
438-
439- ON_CALL(dash_style_, GetGroupExpandIcon())
440- .WillByDefault(Return(dash_style_.base_texture_.GetPointer()));
441-
442- ON_CALL(dash_style_, GetGroupUnexpandIcon())
443- .WillByDefault(Return(dash_style_.base_texture_.GetPointer()));
444+ ON_CALL(Const(dash_style_), GetCategoryBackground())
445+ .WillByDefault(ReturnRef(dash_style_.base_texture_));
446+
447+ ON_CALL(Const(dash_style_), GetCategoryBackgroundNoFilters())
448+ .WillByDefault(ReturnRef(dash_style_.base_texture_));
449+
450+ ON_CALL(Const(dash_style_), GetGroupExpandIcon())
451+ .WillByDefault(ReturnRef(dash_style_.base_texture_));
452+
453+ ON_CALL(Const(dash_style_), GetGroupUnexpandIcon())
454+ .WillByDefault(ReturnRef(dash_style_.base_texture_));
455
456 ON_CALL(dash_style_, GetCategoryHeaderLeftPadding())
457 .WillByDefault(Return(19_em));
458
459=== modified file 'tests/test_previews_payment.cpp'
460--- tests/test_previews_payment.cpp 2014-03-21 04:40:12 +0000
461+++ tests/test_previews_payment.cpp 2014-07-11 03:37:01 +0000
462@@ -146,7 +146,6 @@
463
464 // needed for styles
465 dash::Style dash_style;
466-
467 };
468
469 TEST_F(TestPaymentPreview, GetHeaderCallsCorrectMethods)
470@@ -157,7 +156,7 @@
471 ON_CALL(*preview.GetPointer(), GetPrice()).WillByDefault(Return(new nux::VLayout()));
472 EXPECT_CALL(*preview.GetPointer(), GetPrice()).Times(1);
473
474- preview->GetHeader();
475+ preview->GetHeader()->UnReference();
476 }
477
478 TEST_F(TestPaymentPreview, SetupViewsCallCorrectMethods)
479
480=== modified file 'unity-shared/CoverArt.cpp'
481--- unity-shared/CoverArt.cpp 2014-07-11 03:37:01 +0000
482+++ unity-shared/CoverArt.cpp 2014-07-11 03:37:01 +0000
483@@ -51,7 +51,7 @@
484
485 CoverArt::CoverArt()
486 : View(NUX_TRACKER_LOCATION)
487- , scale (1.0)
488+ , scale(1.0)
489 , overlay_text_(nullptr)
490 , thumb_handle_(0)
491 , slot_handle_(0)
492@@ -382,11 +382,11 @@
493 if (waiting_)
494 {
495 nux::TexCoordXForm texxform;
496- texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_SCALE_COORD);
497+ texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
498 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
499 texxform.SetFilter(nux::TEXFILTER_LINEAR, nux::TEXFILTER_LINEAR);
500
501- nux::Size spin_size(RawPixel(spin_->GetWidth()).CP(scale), RawPixel(spin_->GetHeight()).CP(scale));
502+ nux::Size spin_size(spin_->GetWidth(), spin_->GetHeight());
503 nux::Geometry spin_geo(base.x + ((base.width - spin_size.width) / 2),
504 base.y + ((base.height - spin_size.height) / 2),
505 spin_size.width,
506@@ -451,8 +451,7 @@
507 overlay_text_->SetScale(scale);
508 overlay_text_->SetText(_("No Image Available"));
509
510- dash::Style& style = dash::Style::Instance();
511- spin_ = style.GetSearchSpinIcon();
512+ spin_ = dash::Style::Instance().GetSearchSpinIcon(scale);
513
514 rotate_matrix_.Identity();
515 rotate_matrix_.Rotate_z(0.0);
516@@ -501,6 +500,8 @@
517 if (overlay_text_)
518 overlay_text_->SetScale(scale);
519
520+ spin_ = dash::Style::Instance().GetSearchSpinIcon(scale);
521+
522 QueueDraw();
523 }
524
525
526=== modified file 'unity-shared/CoverArt.h'
527--- unity-shared/CoverArt.h 2014-06-13 08:03:39 +0000
528+++ unity-shared/CoverArt.h 2014-07-11 03:37:01 +0000
529@@ -63,7 +63,7 @@
530 protected:
531 virtual void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw);
532 virtual void DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw);
533-
534+
535 virtual bool AcceptKeyNavFocus() { return false; }
536
537 void SetupViews();
538@@ -92,10 +92,10 @@
539 int slot_handle_;
540 bool stretch_image_;
541 ThumbnailNotifier::Ptr notifier_;
542-
543+
544 // Spinner
545 bool waiting_;
546- nux::BaseTexture* spin_;
547+ nux::ObjectPtr<nux::BaseTexture> spin_;
548 glib::Source::UniquePtr spinner_timeout_;
549 glib::Source::UniquePtr frame_timeout_;
550 nux::Matrix4 rotate_matrix_;
551
552=== modified file 'unity-shared/DashStyle.cpp'
553--- unity-shared/DashStyle.cpp 2014-07-11 03:37:01 +0000
554+++ unity-shared/DashStyle.cpp 2014-07-11 03:37:01 +0000
555@@ -48,8 +48,6 @@
556
557 #define DASH_WIDGETS_FILE DATADIR"/unity/themes/dash-widgets.json"
558
559-typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;
560-
561 namespace unity
562 {
563 namespace dash
564@@ -106,7 +104,7 @@
565 {
566 public:
567 LazyLoadTexture(std::string const& filename, int size = -1);
568- nux::BaseTexture* texture();
569+ BaseTexturePtr const& texture();
570 private:
571 void LoadTexture();
572 private:
573@@ -177,6 +175,13 @@
574 void UpdateFormFactor(FormFactor);
575 void OnFontChanged(GtkSettings* object, GParamSpec* pspec);
576
577+ BaseTexturePtr LoadScaledTexture(std::string const& name, double scale)
578+ {
579+ int w, h;
580+ gdk_pixbuf_get_file_info((PKGDATADIR"/" + name).c_str(), &w, &h);
581+ return TextureCache::GetDefault().FindTexture(name, RawPixel(w).CP(scale), RawPixel(h).CP(scale));
582+ }
583+
584 // Members
585 Style* owner_;
586
587@@ -220,28 +225,9 @@
588
589 LazyLoadTexture category_texture_;
590 LazyLoadTexture category_texture_no_filters_;
591- LazyLoadTexture dash_bottom_texture_;
592- LazyLoadTexture dash_bottom_texture_mask_;
593- LazyLoadTexture dash_right_texture_;
594- LazyLoadTexture dash_right_texture_mask_;
595- LazyLoadTexture dash_corner_texture_;
596- LazyLoadTexture dash_corner_texture_mask_;
597- LazyLoadTexture dash_fullscreen_icon_;
598- LazyLoadTexture dash_left_edge_;
599- LazyLoadTexture dash_left_corner_;
600- LazyLoadTexture dash_left_corner_mask_;
601- LazyLoadTexture dash_left_tile_;
602- LazyLoadTexture dash_top_corner_;
603- LazyLoadTexture dash_top_corner_mask_;
604- LazyLoadTexture dash_top_tile_;
605
606 LazyLoadTexture dash_shine_;
607
608- LazyLoadTexture search_magnify_texture_;
609- LazyLoadTexture search_circle_texture_;
610- LazyLoadTexture search_close_texture_;
611- LazyLoadTexture search_spin_texture_;
612-
613 LazyLoadTexture information_texture_;
614
615 LazyLoadTexture refine_gradient_corner_;
616@@ -269,25 +255,7 @@
617 , text_height_(0)
618 , category_texture_("/category_gradient.png")
619 , category_texture_no_filters_("/category_gradient_no_refine.png")
620- , dash_bottom_texture_("/dash_bottom_border_tile.png")
621- , dash_bottom_texture_mask_("/dash_bottom_border_tile_mask.png")
622- , dash_right_texture_("/dash_right_border_tile.png")
623- , dash_right_texture_mask_("/dash_right_border_tile_mask.png")
624- , dash_corner_texture_("/dash_bottom_right_corner.png")
625- , dash_corner_texture_mask_("/dash_bottom_right_corner_mask.png")
626- , dash_fullscreen_icon_("/dash_fullscreen_icon.png")
627- , dash_left_edge_("/dash_left_edge.png")
628- , dash_left_corner_("/dash_bottom_left_corner.png")
629- , dash_left_corner_mask_("/dash_bottom_left_corner_mask.png")
630- , dash_left_tile_("/dash_left_tile.png")
631- , dash_top_corner_("/dash_top_right_corner.png")
632- , dash_top_corner_mask_("/dash_top_right_corner_mask.png")
633- , dash_top_tile_("/dash_top_tile.png")
634 , dash_shine_("/dash_sheen.png")
635- , search_magnify_texture_("/search_magnify.png")
636- , search_circle_texture_("/search_circle.svg", 32)
637- , search_close_texture_("/search_close.svg", 32)
638- , search_spin_texture_("/search_spin.svg", 32)
639 , information_texture_("/information_icon.svg")
640 , refine_gradient_corner_("/refine_gradient_corner.png")
641 , refine_gradient_dash_("/refine_gradient_dash.png")
642@@ -2125,6 +2093,87 @@
643 return true;
644 }
645
646+BaseTexturePtr Style::GetDashBottomTile(double scale) const
647+{
648+ return pimpl->LoadScaledTexture("dash_bottom_border_tile.png", scale);
649+}
650+
651+BaseTexturePtr Style::GetDashBottomTileMask(double scale) const
652+{
653+ return pimpl->LoadScaledTexture("dash_bottom_border_tile_mask.png", scale);
654+}
655+
656+BaseTexturePtr Style::GetDashRightTile(double scale) const
657+{
658+ return pimpl->LoadScaledTexture("dash_right_border_tile.png", scale);
659+}
660+
661+BaseTexturePtr Style::GetDashRightTileMask(double scale) const
662+{
663+ return pimpl->LoadScaledTexture("dash_right_border_tile_mask.png", scale);
664+}
665+
666+BaseTexturePtr Style::GetDashLeftTile(double scale) const
667+{
668+ return pimpl->LoadScaledTexture("dash_left_tile.png", scale);
669+}
670+
671+BaseTexturePtr Style::GetDashTopTile(double scale) const
672+{
673+ return pimpl->LoadScaledTexture("dash_top_tile.png", scale);
674+}
675+
676+BaseTexturePtr Style::GetDashCorner(double scale) const
677+{
678+ return pimpl->LoadScaledTexture("dash_bottom_right_corner.png", scale);
679+}
680+
681+BaseTexturePtr Style::GetDashCornerMask(double scale) const
682+{
683+ return pimpl->LoadScaledTexture("dash_bottom_right_corner_mask.png", scale);
684+}
685+
686+BaseTexturePtr Style::GetDashLeftCorner(double scale) const
687+{
688+ return pimpl->LoadScaledTexture("dash_bottom_left_corner.png", scale);
689+}
690+
691+BaseTexturePtr Style::GetDashLeftCornerMask(double scale) const
692+{
693+ return pimpl->LoadScaledTexture("dash_bottom_left_corner_mask.png", scale);
694+}
695+
696+BaseTexturePtr Style::GetDashTopCorner(double scale) const
697+{
698+ return pimpl->LoadScaledTexture("dash_top_right_corner.png", scale);
699+}
700+
701+BaseTexturePtr Style::GetDashTopCornerMask(double scale) const
702+{
703+ return pimpl->LoadScaledTexture("dash_top_right_corner_mask.png", scale);
704+}
705+
706+BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const
707+{
708+ return pimpl->LoadScaledTexture("search_magnify.svg", scale);
709+}
710+
711+BaseTexturePtr Style::GetSearchCircleIcon(double scale) const
712+{
713+ return pimpl->LoadScaledTexture("search_circle.svg", scale);
714+}
715+
716+BaseTexturePtr Style::GetSearchCloseIcon(double scale) const
717+{
718+ return pimpl->LoadScaledTexture("search_close.svg", scale);
719+}
720+
721+BaseTexturePtr Style::GetSearchSpinIcon(double scale) const
722+{
723+ return pimpl->LoadScaledTexture("search_spin.svg", scale);
724+}
725+
726+
727 RawPixel Style::GetButtonGarnishSize() const
728 {
729 int maxBlurSize = 0;
730@@ -2205,147 +2254,57 @@
731 }
732
733
734-nux::BaseTexture* Style::GetCategoryBackground()
735+BaseTexturePtr const& Style::GetCategoryBackground() const
736 {
737 return pimpl->category_texture_.texture();
738 }
739
740-nux::BaseTexture* Style::GetCategoryBackgroundNoFilters()
741+BaseTexturePtr const& Style::GetCategoryBackgroundNoFilters() const
742 {
743 return pimpl->category_texture_no_filters_.texture();
744 }
745
746-nux::BaseTexture* Style::GetDashBottomTile()
747-{
748- return pimpl->dash_bottom_texture_.texture();
749-}
750-
751-nux::BaseTexture* Style::GetDashBottomTileMask()
752-{
753- return pimpl->dash_bottom_texture_mask_.texture();
754-}
755-
756-nux::BaseTexture* Style::GetDashRightTile()
757-{
758- return pimpl->dash_right_texture_.texture();
759-}
760-
761-nux::BaseTexture* Style::GetDashRightTileMask()
762-{
763- return pimpl->dash_right_texture_mask_.texture();
764-}
765-
766-nux::BaseTexture* Style::GetDashCorner()
767-{
768- return pimpl->dash_corner_texture_.texture();
769-}
770-
771-nux::BaseTexture* Style::GetDashCornerMask()
772-{
773- return pimpl->dash_corner_texture_mask_.texture();
774-}
775-
776-nux::BaseTexture* Style::GetDashLeftEdge()
777-{
778- return pimpl->dash_left_edge_.texture();
779-}
780-
781-nux::BaseTexture* Style::GetDashLeftCorner()
782-{
783- return pimpl->dash_left_corner_.texture();
784-}
785-
786-nux::BaseTexture* Style::GetDashLeftCornerMask()
787-{
788- return pimpl->dash_left_corner_mask_.texture();
789-}
790-
791-nux::BaseTexture* Style::GetDashLeftTile()
792-{
793- return pimpl->dash_left_tile_.texture();
794-}
795-
796-nux::BaseTexture* Style::GetDashTopCorner()
797-{
798- return pimpl->dash_top_corner_.texture();
799-}
800-
801-nux::BaseTexture* Style::GetDashTopCornerMask()
802-{
803- return pimpl->dash_top_corner_mask_.texture();
804-}
805-
806-nux::BaseTexture* Style::GetDashTopTile()
807-{
808- return pimpl->dash_top_tile_.texture();
809-}
810-
811-nux::BaseTexture* Style::GetDashFullscreenIcon()
812-{
813- return pimpl->dash_fullscreen_icon_.texture();
814-}
815-
816-nux::BaseTexture* Style::GetSearchMagnifyIcon()
817-{
818- return pimpl->search_magnify_texture_.texture();
819-}
820-
821-nux::BaseTexture* Style::GetSearchCircleIcon()
822-{
823- return pimpl->search_circle_texture_.texture();
824-}
825-
826-nux::BaseTexture* Style::GetSearchCloseIcon()
827-{
828- return pimpl->search_close_texture_.texture();
829-}
830-
831-nux::BaseTexture* Style::GetSearchSpinIcon()
832-{
833- return pimpl->search_spin_texture_.texture();
834-}
835-
836-nux::BaseTexture* Style::GetInformationTexture()
837+BaseTexturePtr const& Style::GetInformationTexture() const
838 {
839 return pimpl->information_texture_.texture();
840 }
841
842-nux::BaseTexture* Style::GetRefineTextureCorner()
843+BaseTexturePtr const& Style::GetRefineTextureCorner() const
844 {
845 return pimpl->refine_gradient_corner_.texture();
846 }
847
848-nux::BaseTexture* Style::GetRefineTextureDash()
849+BaseTexturePtr const& Style::GetRefineTextureDash() const
850 {
851 return pimpl->refine_gradient_dash_.texture();
852 }
853
854-nux::BaseTexture* Style::GetGroupUnexpandIcon()
855+BaseTexturePtr const& Style::GetGroupUnexpandIcon() const
856 {
857 return pimpl->group_unexpand_texture_.texture();
858 }
859
860-nux::BaseTexture* Style::GetGroupExpandIcon()
861+BaseTexturePtr const& Style::GetGroupExpandIcon() const
862 {
863 return pimpl->group_expand_texture_.texture();
864 }
865
866-nux::BaseTexture* Style::GetStarDeselectedIcon()
867+BaseTexturePtr const& Style::GetStarDeselectedIcon() const
868 {
869 return pimpl->star_deselected_texture_.texture();
870 }
871
872-nux::BaseTexture* Style::GetStarSelectedIcon()
873+BaseTexturePtr const& Style::GetStarSelectedIcon() const
874 {
875 return pimpl->star_selected_texture_.texture();
876 }
877
878-nux::BaseTexture* Style::GetStarHighlightIcon()
879+BaseTexturePtr const& Style::GetStarHighlightIcon() const
880 {
881 return pimpl->star_highlight_texture_.texture();
882 }
883
884-nux::BaseTexture* Style::GetDashShine()
885+BaseTexturePtr const& Style::GetDashShine() const
886 {
887 return pimpl->dash_shine_.texture();
888 }
889@@ -2504,11 +2463,11 @@
890 {
891 }
892
893-nux::BaseTexture* LazyLoadTexture::texture()
894+BaseTexturePtr const& LazyLoadTexture::texture()
895 {
896 if (!texture_)
897 LoadTexture();
898- return texture_.GetPointer();
899+ return texture_;
900 }
901
902 void LazyLoadTexture::LoadTexture()
903
904=== modified file 'unity-shared/DashStyle.h'
905--- unity-shared/DashStyle.h 2014-07-11 03:37:01 +0000
906+++ unity-shared/DashStyle.h 2014-07-11 03:37:01 +0000
907@@ -37,6 +37,7 @@
908 {
909 namespace dash
910 {
911+typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;
912
913 enum class StockIcon {
914 CHECKMARK,
915@@ -166,44 +167,44 @@
916
917 RawPixel GetTextLineHeight() const;
918
919- nux::BaseTexture* GetCategoryBackground();
920- nux::BaseTexture* GetCategoryBackgroundNoFilters();
921- nux::BaseTexture* GetDashBottomTile();
922- nux::BaseTexture* GetDashBottomTileMask();
923- nux::BaseTexture* GetDashRightTile();
924- nux::BaseTexture* GetDashRightTileMask();
925- nux::BaseTexture* GetDashCorner();
926- nux::BaseTexture* GetDashCornerMask();
927- nux::BaseTexture* GetDashFullscreenIcon();
928- nux::BaseTexture* GetDashLeftEdge();
929- nux::BaseTexture* GetDashLeftCorner();
930- nux::BaseTexture* GetDashLeftCornerMask();
931- nux::BaseTexture* GetDashLeftTile();
932- nux::BaseTexture* GetDashTopCorner();
933- nux::BaseTexture* GetDashTopCornerMask();
934- nux::BaseTexture* GetDashTopTile();
935+ BaseTexturePtr const& GetCategoryBackground() const;
936+ BaseTexturePtr const& GetCategoryBackgroundNoFilters() const;
937+
938+ BaseTexturePtr GetDashBottomTile(double scale) const;
939+ BaseTexturePtr GetDashBottomTileMask(double scale) const;
940+ BaseTexturePtr GetDashRightTile(double scale) const;
941+ BaseTexturePtr GetDashRightTileMask(double scale) const;
942+ BaseTexturePtr GetDashLeftTile(double scale) const;
943+ BaseTexturePtr GetDashTopTile(double scale) const;
944+
945+ BaseTexturePtr GetDashCorner(double scale) const;
946+ BaseTexturePtr GetDashCornerMask(double scale) const;
947+ BaseTexturePtr GetDashLeftCorner(double scale) const;
948+ BaseTexturePtr GetDashLeftCornerMask(double scale) const;
949+ BaseTexturePtr GetDashTopCorner(double scale) const;
950+ BaseTexturePtr GetDashTopCornerMask(double scale) const;
951
952 RawPixel GetDashBottomTileHeight() const;
953 RawPixel GetDashRightTileWidth() const;
954
955- nux::BaseTexture* GetDashShine();
956-
957- nux::BaseTexture* GetSearchMagnifyIcon();
958- nux::BaseTexture* GetSearchCircleIcon();
959- nux::BaseTexture* GetSearchCloseIcon();
960- nux::BaseTexture* GetSearchSpinIcon();
961-
962- nux::BaseTexture* GetGroupUnexpandIcon();
963- nux::BaseTexture* GetGroupExpandIcon();
964-
965- nux::BaseTexture* GetStarDeselectedIcon();
966- nux::BaseTexture* GetStarSelectedIcon();
967- nux::BaseTexture* GetStarHighlightIcon();
968-
969- nux::BaseTexture* GetInformationTexture();
970-
971- nux::BaseTexture* GetRefineTextureCorner();
972- nux::BaseTexture* GetRefineTextureDash();
973+ BaseTexturePtr const& GetDashShine() const;
974+
975+ BaseTexturePtr GetSearchMagnifyIcon(double scale) const;
976+ BaseTexturePtr GetSearchCircleIcon(double scale) const;
977+ BaseTexturePtr GetSearchCloseIcon(double scale) const;
978+ BaseTexturePtr GetSearchSpinIcon(double scale) const;
979+
980+ BaseTexturePtr const& GetGroupUnexpandIcon() const;
981+ BaseTexturePtr const& GetGroupExpandIcon() const;
982+
983+ BaseTexturePtr const& GetStarDeselectedIcon() const;
984+ BaseTexturePtr const& GetStarSelectedIcon() const;
985+ BaseTexturePtr const& GetStarHighlightIcon() const;
986+
987+ BaseTexturePtr const& GetInformationTexture() const;
988+
989+ BaseTexturePtr const& GetRefineTextureCorner() const;
990+ BaseTexturePtr const& GetRefineTextureDash() const;
991
992 // Returns the width of the separator between the dash and the launcher.
993 RawPixel GetVSeparatorSize() const;
994
995=== modified file 'unity-shared/DashStyleInterface.h'
996--- unity-shared/DashStyleInterface.h 2014-07-11 03:37:01 +0000
997+++ unity-shared/DashStyleInterface.h 2014-07-11 03:37:01 +0000
998@@ -26,6 +26,7 @@
999 namespace nux {
1000 class AbstractPaintLayer;
1001 class BaseTexture;
1002+ template <class T> class ObjectPtr;
1003 }
1004
1005 namespace unity {
1006@@ -38,11 +39,11 @@
1007
1008 virtual nux::AbstractPaintLayer* FocusOverlay(int width, int height) = 0;
1009
1010- virtual nux::BaseTexture* GetCategoryBackground() = 0;
1011- virtual nux::BaseTexture* GetCategoryBackgroundNoFilters() = 0;
1012+ virtual nux::ObjectPtr<nux::BaseTexture> const& GetCategoryBackground() const = 0;
1013+ virtual nux::ObjectPtr<nux::BaseTexture> const& GetCategoryBackgroundNoFilters() const = 0;
1014
1015- virtual nux::BaseTexture* GetGroupUnexpandIcon() = 0;
1016- virtual nux::BaseTexture* GetGroupExpandIcon() = 0;
1017+ virtual nux::ObjectPtr<nux::BaseTexture> const& GetGroupUnexpandIcon() const = 0;
1018+ virtual nux::ObjectPtr<nux::BaseTexture> const& GetGroupExpandIcon() const = 0;
1019
1020 virtual RawPixel GetCategoryIconSize() const = 0;
1021 virtual RawPixel GetCategoryHeaderLeftPadding() const = 0;
1022
1023=== modified file 'unity-shared/OverlayRenderer.cpp'
1024--- unity-shared/OverlayRenderer.cpp 2014-07-11 03:37:01 +0000
1025+++ unity-shared/OverlayRenderer.cpp 2014-07-11 03:37:01 +0000
1026@@ -36,7 +36,10 @@
1027 namespace
1028 {
1029 const RawPixel INNER_CORNER_RADIUS = 5_em;
1030-const int EXCESS_BORDER = 10;
1031+const RawPixel EXCESS_BORDER = 10_em;
1032+
1033+const RawPixel LEFT_CORNER_OFFSET = 10_em;
1034+const RawPixel TOP_CORNER_OFFSET = 10_em;
1035
1036 const nux::Color LINE_COLOR = nux::color::White * 0.07f;
1037 const RawPixel GRADIENT_HEIGHT = 50_em;
1038@@ -53,8 +56,9 @@
1039 public:
1040 OverlayRendererImpl(OverlayRenderer *parent_);
1041
1042+ void UpdateTextures();
1043+ void LoadScaledTextures();
1044 void ComputeLargerGeometries(nux::Geometry& larger_absolute_geo, nux::Geometry& larger_content_geo, bool force_edges);
1045- void UpdateTextures();
1046 void OnBgColorChanged(nux::Color const& new_color);
1047
1048 void Draw(nux::GraphicsEngine& gfx_context, nux::Geometry const& content_geo, nux::Geometry const& absolute_geo, nux::Geometry const& geometry, bool force_draw);
1049@@ -71,6 +75,20 @@
1050
1051 std::unique_ptr<nux::TextureLayer> bg_refine_gradient_;
1052
1053+ nux::ObjectPtr<nux::BaseTexture> bottom_texture_;
1054+ nux::ObjectPtr<nux::BaseTexture> bottom_texture_mask_;
1055+ nux::ObjectPtr<nux::BaseTexture> right_texture_;
1056+ nux::ObjectPtr<nux::BaseTexture> right_texture_mask_;
1057+ nux::ObjectPtr<nux::BaseTexture> left_texture_;
1058+ nux::ObjectPtr<nux::BaseTexture> top_texture_;
1059+
1060+ nux::ObjectPtr<nux::BaseTexture> corner_;
1061+ nux::ObjectPtr<nux::BaseTexture> corner_mask_;
1062+ nux::ObjectPtr<nux::BaseTexture> left_corner_;
1063+ nux::ObjectPtr<nux::BaseTexture> left_corner_mask_;
1064+ nux::ObjectPtr<nux::BaseTexture> top_corner_;
1065+ nux::ObjectPtr<nux::BaseTexture> top_corner_mask_;
1066+
1067 // temporary variable that stores the number of backgrounds we have rendered
1068 int bgs;
1069 bool visible;
1070@@ -96,8 +114,29 @@
1071 : visible(false)
1072 , parent(parent_)
1073 {
1074- parent_->scale = 1.0;
1075+ parent->scale = Settings::Instance().em()->DPIScale();
1076+ parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
1077 UpdateTextures();
1078+ LoadScaledTextures();
1079+}
1080+
1081+void OverlayRendererImpl::LoadScaledTextures()
1082+{
1083+ double scale = parent->scale;
1084+ auto& style = dash::Style::Instance();
1085+ bottom_texture_ = style.GetDashBottomTile(scale);
1086+ bottom_texture_mask_ = style.GetDashBottomTileMask(scale);
1087+ right_texture_ = style.GetDashRightTile(scale);
1088+ right_texture_mask_ = style.GetDashRightTileMask(scale);
1089+ left_texture_ = style.GetDashLeftTile(scale);
1090+ top_texture_ = style.GetDashTopTile(scale);
1091+
1092+ corner_ = style.GetDashCorner(scale);
1093+ corner_mask_ = style.GetDashCornerMask(scale);
1094+ left_corner_ = style.GetDashLeftCorner(scale);
1095+ left_corner_mask_ = style.GetDashLeftCornerMask(scale);
1096+ top_corner_ = style.GetDashTopCorner(scale);
1097+ top_corner_mask_ = style.GetDashTopCornerMask(scale);
1098 }
1099
1100 void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color)
1101@@ -142,9 +181,10 @@
1102 }
1103
1104 bg_darken_layer_ = std::make_shared<nux::ColorLayer>(darken_colour, false, rop);
1105- bg_shine_texture_ = unity::dash::Style::Instance().GetDashShine()->GetDeviceTexture();
1106-
1107- nux::BaseTexture* bg_refine_tex = unity::dash::Style::Instance().GetRefineTextureDash();
1108+ bg_shine_texture_ = dash::Style::Instance().GetDashShine()->GetDeviceTexture();
1109+
1110+ auto const& bg_refine_tex = dash::Style::Instance().GetRefineTextureDash();
1111+
1112 if (bg_refine_tex)
1113 {
1114 rop.Blend = true;
1115@@ -406,7 +446,7 @@
1116
1117 void OverlayRendererImpl::ComputeLargerGeometries(nux::Geometry& larger_absolute_geo, nux::Geometry& larger_content_geo, bool force_edges)
1118 {
1119- int excess_border = (Settings::Instance().form_factor() != FormFactor::NETBOOK || force_edges) ? EXCESS_BORDER : 0;
1120+ int excess_border = (Settings::Instance().form_factor() != FormFactor::NETBOOK || force_edges) ? EXCESS_BORDER.CP(parent->scale) : 0;
1121 larger_absolute_geo.OffsetSize(excess_border, excess_border);
1122 larger_content_geo.OffsetSize(excess_border, excess_border);
1123 }
1124@@ -544,9 +584,9 @@
1125 int gradien_width = std::min(bg_refine_gradient_->GetDeviceTexture()->GetWidth(), larger_content_geo.width);
1126 int gradien_height = std::min(bg_refine_gradient_->GetDeviceTexture()->GetHeight(), larger_content_geo.height);
1127
1128- nux::Geometry geo_refine(larger_content_geo.x + larger_content_geo.width - gradien_width,
1129+ nux::Geometry geo_refine(larger_content_geo.x + larger_content_geo.width - gradien_width,
1130 larger_content_geo.y,
1131- gradien_width,
1132+ gradien_width,
1133 gradien_height);
1134
1135 bg_refine_gradient_->SetGeometry(geo_refine);
1136@@ -565,36 +605,38 @@
1137 gfx_context.GetRenderStates().SetBlend(true);
1138 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
1139
1140- dash::Style& style = dash::Style::Instance();
1141- nux::BaseTexture* bottom = style.GetDashBottomTile();
1142- nux::BaseTexture* bottom_mask = style.GetDashBottomTileMask();
1143- nux::BaseTexture* right = style.GetDashRightTile();
1144- nux::BaseTexture* right_mask = style.GetDashRightTileMask();
1145- nux::BaseTexture* corner = style.GetDashCorner();
1146- nux::BaseTexture* corner_mask = style.GetDashCornerMask();
1147- nux::BaseTexture* left_corner = style.GetDashLeftCorner();
1148- nux::BaseTexture* left_corner_mask = style.GetDashLeftCornerMask();
1149- nux::BaseTexture* left_tile = style.GetDashLeftTile();
1150- nux::BaseTexture* top_corner = style.GetDashTopCorner();
1151- nux::BaseTexture* top_corner_mask = style.GetDashTopCornerMask();
1152- nux::BaseTexture* top_tile = style.GetDashTopTile();
1153 nux::TexCoordXForm texxform;
1154-
1155- int left_corner_offset = 10;
1156- int top_corner_offset = 10;
1157-
1158- geo.width += corner->GetWidth() - 10;
1159- geo.height += corner->GetHeight() - 10;
1160+ auto const& bottom = bottom_texture_;
1161+ auto const& bottom_mask = bottom_texture_mask_;
1162+ auto const& right = right_texture_;
1163+ auto const& right_mask = right_texture_mask_;
1164+ auto const& corner = corner_;
1165+ auto const& corner_mask = corner_mask_;
1166+ auto const& left_corner = left_corner_;
1167+ auto const& left_corner_mask = left_corner_mask_;
1168+ auto const& left_tile = left_texture_;
1169+ auto const& top_corner = top_corner_;
1170+ auto const& top_corner_mask = top_corner_mask_;
1171+ auto const& top_tile = top_texture_;
1172+
1173+ int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale);
1174+ int top_corner_offset = TOP_CORNER_OFFSET.CP(scale);
1175+ nux::Size corner_size(corner->GetWidth(), corner->GetHeight());
1176+ nux::Size top_corner_size(top_corner->GetWidth(), top_corner->GetHeight());
1177+ nux::Size left_corner_size(left_corner->GetWidth(), left_corner->GetHeight());
1178+
1179+ geo.width += corner_size.width - left_corner_offset;
1180+ geo.height += corner_size.height - top_corner_offset;
1181 {
1182 // Corner
1183 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
1184 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
1185
1186 // Selectively erase blur region in the curbe
1187- gfx_context.QRP_ColorModTexAlpha(geo.x + (geo.width - corner->GetWidth()),
1188- geo.y + (geo.height - corner->GetHeight()),
1189- corner->GetWidth(),
1190- corner->GetHeight(),
1191+ gfx_context.QRP_ColorModTexAlpha(geo.x + (geo.width - corner_size.width),
1192+ geo.y + (geo.height - corner_size.height),
1193+ corner_size.width,
1194+ corner_size.height,
1195 corner_mask->GetDeviceTexture(),
1196 texxform,
1197 nux::color::Black);
1198@@ -602,10 +644,10 @@
1199 // Write correct alpha
1200 gfx_context.GetRenderStates().SetBlend(false);
1201 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
1202- RenderInverseMask(gfx_context, geo.x + (geo.width - corner->GetWidth()),
1203- geo.y + (geo.height - corner->GetHeight()),
1204- corner->GetWidth(),
1205- corner->GetHeight(),
1206+ RenderInverseMask(gfx_context, geo.x + (geo.width - corner_size.width),
1207+ geo.y + (geo.height - corner_size.height),
1208+ corner_size.width,
1209+ corner_size.height,
1210 corner_mask->GetDeviceTexture(),
1211 texxform,
1212 nux::color::White);
1213@@ -614,24 +656,24 @@
1214 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
1215 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
1216
1217- gfx_context.QRP_1Tex(geo.x + (geo.width - corner->GetWidth()),
1218- geo.y + (geo.height - corner->GetHeight()),
1219- corner->GetWidth(),
1220- corner->GetHeight(),
1221+ gfx_context.QRP_1Tex(geo.x + (geo.width - corner_size.width),
1222+ geo.y + (geo.height - corner_size.height),
1223+ corner_size.width,
1224+ corner_size.height,
1225 corner->GetDeviceTexture(),
1226 texxform,
1227 nux::color::White);
1228 }
1229 {
1230 // Bottom repeated texture
1231- int real_width = geo.width - (left_corner->GetWidth() - left_corner_offset) - corner->GetWidth();
1232+ int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width;
1233 int offset = real_width % bottom->GetWidth();
1234
1235 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
1236 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
1237
1238 // Selectively erase blur region in the curbe
1239- gfx_context.QRP_ColorModTexAlpha(left_corner->GetWidth() - left_corner_offset - offset,
1240+ gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset - offset,
1241 geo.y + (geo.height - bottom->GetHeight()),
1242 real_width + offset,
1243 bottom->GetHeight(),
1244@@ -642,7 +684,7 @@
1245 // Write correct alpha
1246 gfx_context.GetRenderStates().SetBlend(false);
1247 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
1248- RenderInverseMask(gfx_context, left_corner->GetWidth() - left_corner_offset - offset,
1249+ RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset - offset,
1250 geo.y + (geo.height - bottom->GetHeight()),
1251 real_width + offset,
1252 bottom->GetHeight(),
1253@@ -654,7 +696,7 @@
1254 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
1255 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
1256
1257- gfx_context.QRP_1Tex(left_corner->GetWidth() - left_corner_offset - offset,
1258+ gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset - offset,
1259 geo.y + (geo.height - bottom->GetHeight()),
1260 real_width + offset,
1261 bottom->GetHeight(),
1262@@ -669,9 +711,9 @@
1263
1264 // Selectively erase blur region in the curbe
1265 gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset,
1266- geo.y + (geo.height - left_corner->GetHeight()),
1267- left_corner->GetWidth(),
1268- left_corner->GetHeight(),
1269+ geo.y + (geo.height - left_corner_size.height),
1270+ left_corner_size.width,
1271+ left_corner_size.height,
1272 left_corner_mask->GetDeviceTexture(),
1273 texxform,
1274 nux::color::Black);
1275@@ -680,9 +722,9 @@
1276 gfx_context.GetRenderStates().SetBlend(false);
1277 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
1278 RenderInverseMask(gfx_context, geo.x - left_corner_offset,
1279- geo.y + (geo.height - left_corner->GetHeight()),
1280- left_corner->GetWidth(),
1281- left_corner->GetHeight(),
1282+ geo.y + (geo.height - left_corner_size.height),
1283+ left_corner_size.width,
1284+ left_corner_size.height,
1285 left_corner_mask->GetDeviceTexture(),
1286 texxform,
1287 nux::color::White);
1288@@ -692,9 +734,9 @@
1289 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
1290
1291 gfx_context.QRP_1Tex(geo.x - left_corner_offset,
1292- geo.y + (geo.height - left_corner->GetHeight()),
1293- left_corner->GetWidth(),
1294- left_corner->GetHeight(),
1295+ geo.y + (geo.height - left_corner_size.height),
1296+ left_corner_size.width,
1297+ left_corner_size.height,
1298 left_corner->GetDeviceTexture(),
1299 texxform,
1300 nux::color::White);
1301@@ -708,7 +750,7 @@
1302 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
1303 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
1304
1305- gfx_context.QRP_1Tex(geo.x - 10,
1306+ gfx_context.QRP_1Tex(geo.x - left_corner_offset,
1307 geo.y + geo.height,
1308 left_tile->GetWidth(),
1309 real_height + offset,
1310@@ -723,9 +765,9 @@
1311
1312 // Selectively erase blur region in the curbe
1313 gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(),
1314- geo.y + top_corner->GetHeight() - top_corner_offset,
1315+ geo.y + top_corner_size.height - top_corner_offset,
1316 right->GetWidth(),
1317- geo.height - corner->GetHeight() - (top_corner->GetHeight() - top_corner_offset),
1318+ geo.height - corner_size.height - (top_corner_size.height - top_corner_offset),
1319 right_mask->GetDeviceTexture(),
1320 texxform,
1321 nux::color::Black);
1322@@ -734,9 +776,9 @@
1323 gfx_context.GetRenderStates().SetBlend(false);
1324 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
1325 RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(),
1326- geo.y + top_corner->GetHeight() - top_corner_offset,
1327+ geo.y + top_corner_size.height - top_corner_offset,
1328 right->GetWidth(),
1329- geo.height - corner->GetHeight() - (top_corner->GetHeight() - top_corner_offset),
1330+ geo.height - corner_size.height - (top_corner_size.height - top_corner_offset),
1331 right_mask->GetDeviceTexture(),
1332 texxform,
1333 nux::color::White);
1334@@ -746,9 +788,9 @@
1335 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
1336
1337 gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(),
1338- geo.y + top_corner->GetHeight() - top_corner_offset,
1339+ geo.y + top_corner_size.height - top_corner_offset,
1340 right->GetWidth(),
1341- geo.height - corner->GetHeight() - (top_corner->GetHeight() - top_corner_offset),
1342+ geo.height - corner_size.height - (top_corner_size.height - top_corner_offset),
1343 right->GetDeviceTexture(),
1344 texxform,
1345 nux::color::White);
1346@@ -761,8 +803,8 @@
1347 // Selectively erase blur region in the curbe
1348 gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(),
1349 geo.y - top_corner_offset,
1350- top_corner->GetWidth(),
1351- top_corner->GetHeight(),
1352+ top_corner_size.width,
1353+ top_corner_size.height,
1354 top_corner_mask->GetDeviceTexture(),
1355 texxform,
1356 nux::color::Black);
1357@@ -772,8 +814,8 @@
1358 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
1359 RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(),
1360 geo.y - top_corner_offset,
1361- top_corner->GetWidth(),
1362- top_corner->GetHeight(),
1363+ top_corner_size.width,
1364+ top_corner_size.height,
1365 top_corner_mask->GetDeviceTexture(),
1366 texxform,
1367 nux::color::White);
1368@@ -783,8 +825,8 @@
1369 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
1370 gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(),
1371 geo.y - top_corner_offset,
1372- top_corner->GetWidth(),
1373- top_corner->GetHeight(),
1374+ top_corner_size.width,
1375+ top_corner_size.height,
1376 top_corner->GetDeviceTexture(),
1377 texxform,
1378 nux::color::White);
1379@@ -796,7 +838,7 @@
1380
1381 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
1382 gfx_context.QRP_1Tex(geo.x + geo.width,
1383- geo.y - 10,
1384+ geo.y - top_corner_offset,
1385 geometry.width - (geo.x + geo.width),
1386 top_tile->GetHeight(),
1387 top_tile->GetDeviceTexture(),
1388
1389=== modified file 'unity-shared/PreviewStyle.cpp'
1390--- unity-shared/PreviewStyle.cpp 2014-07-11 03:37:01 +0000
1391+++ unity-shared/PreviewStyle.cpp 2014-07-11 03:37:01 +0000
1392@@ -98,7 +98,6 @@
1393 , preview_nav_right_texture_("/preview_next.svg")
1394 , preview_play_texture_("/preview_play.svg")
1395 , preview_pause_texture_("/preview_pause.svg")
1396- , preview_spin_texture_("/search_spin.svg")
1397 , warning_icon_texture_("/warning_icon.png")
1398 {
1399 }
1400@@ -110,7 +109,6 @@
1401 LazyLoadTexture<32> preview_nav_right_texture_;
1402 LazyLoadTexture<32> preview_play_texture_;
1403 LazyLoadTexture<32> preview_pause_texture_;
1404- LazyLoadTexture<32> preview_spin_texture_;
1405 LazyLoadTexture<22> warning_icon_texture_;
1406 };
1407
1408@@ -503,11 +501,6 @@
1409 return pimpl->warning_icon_texture_.texture();
1410 }
1411
1412-nux::BaseTexture* Style::GetSearchSpinIcon(int size)
1413-{
1414- return pimpl->preview_spin_texture_.texture(size);
1415-}
1416-
1417
1418 } // namespace previews
1419 } // namespace dash
1420
1421=== modified file 'unity-shared/PreviewStyle.h'
1422--- unity-shared/PreviewStyle.h 2014-06-10 13:36:04 +0000
1423+++ unity-shared/PreviewStyle.h 2014-07-11 03:37:01 +0000
1424@@ -151,7 +151,6 @@
1425 nux::BaseTexture* GetPlayIcon();
1426 nux::BaseTexture* GetPauseIcon();
1427 nux::BaseTexture* GetLockIcon();
1428- nux::BaseTexture* GetSearchSpinIcon(int size = -1);
1429
1430 ////////////////////////////////
1431 // Payment Preview
1432
1433=== modified file 'unity-shared/RatingsButton.cpp'
1434--- unity-shared/RatingsButton.cpp 2014-07-11 03:37:01 +0000
1435+++ unity-shared/RatingsButton.cpp 2014-07-11 03:37:01 +0000
1436@@ -126,7 +126,7 @@
1437 for (int index = 0; index < NUM_STARS; ++index)
1438 {
1439 dash::Style& style = dash::Style::Instance();
1440- nux::BaseTexture* texture = style.GetStarSelectedIcon();
1441+ auto texture = style.GetStarSelectedIcon();
1442 if (index < total_full_stars)
1443 {
1444 if (GetVisualState() == nux::ButtonVisualState::VISUAL_STATE_NORMAL)
1445
1446=== modified file 'unity-shared/RawPixel.h'
1447--- unity-shared/RawPixel.h 2014-02-26 00:01:21 +0000
1448+++ unity-shared/RawPixel.h 2014-07-11 03:37:01 +0000
1449@@ -28,7 +28,7 @@
1450 class RawPixel
1451 {
1452 public:
1453- RawPixel(double raw_pixel);
1454+ RawPixel(double raw_pixel = 0);
1455
1456 int CP(EMConverter::Ptr const&) const;
1457 int CP(double scale) const;
1458
1459=== modified file 'unity-shared/SearchBarSpinner.cpp'
1460--- unity-shared/SearchBarSpinner.cpp 2014-07-11 03:37:01 +0000
1461+++ unity-shared/SearchBarSpinner.cpp 2014-07-11 03:37:01 +0000
1462@@ -36,13 +36,6 @@
1463 , search_timeout_(-1)
1464 , rotation_(0.0f)
1465 {
1466- dash::Style& style = dash::Style::Instance();
1467-
1468- magnify_ = style.GetSearchMagnifyIcon();
1469- circle_ = style.GetSearchCircleIcon();
1470- close_ = style.GetSearchCloseIcon();
1471- spin_ = style.GetSearchSpinIcon();
1472-
1473 rotate_.Identity();
1474 rotate_.Rotate_z(0.0);
1475 UpdateScale(scale);
1476@@ -52,7 +45,14 @@
1477
1478 void SearchBarSpinner::UpdateScale(double scale)
1479 {
1480- SetMinMaxSize(RawPixel(magnify_->GetWidth()).CP(scale), RawPixel(magnify_->GetHeight()).CP(scale));
1481+ auto& style = dash::Style::Instance();
1482+
1483+ magnify_ = style.GetSearchMagnifyIcon(scale);
1484+ circle_ = style.GetSearchCircleIcon(scale);
1485+ close_ = style.GetSearchCloseIcon(scale);
1486+ spin_ = style.GetSearchSpinIcon(scale);
1487+
1488+ SetMinMaxSize(magnify_->GetWidth(), magnify_->GetHeight());
1489 QueueDraw();
1490 }
1491
1492@@ -65,7 +65,7 @@
1493
1494 nux::GetPainter().PaintBackground(GfxContext, geo);
1495
1496- texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_SCALE_COORD);
1497+ texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
1498 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
1499 texxform.SetFilter(nux::TEXFILTER_LINEAR, nux::TEXFILTER_LINEAR);
1500
1501@@ -77,8 +77,7 @@
1502
1503 if (state_ == STATE_READY)
1504 {
1505- nux::Size magnifier_size(RawPixel(magnify_->GetWidth()).CP(scale),
1506- RawPixel(magnify_->GetHeight()).CP(scale));
1507+ nux::Size magnifier_size(magnify_->GetWidth(), magnify_->GetHeight());
1508
1509 GfxContext.QRP_1Tex(geo.x + ((geo.width - magnifier_size.width) / 2),
1510 geo.y + ((geo.height - magnifier_size.height) / 2),
1511@@ -90,8 +89,7 @@
1512 }
1513 else if (state_ == STATE_SEARCHING)
1514 {
1515- nux::Size spin_size(RawPixel(spin_->GetWidth()).CP(scale),
1516- RawPixel(spin_->GetHeight()).CP(scale));
1517+ nux::Size spin_size(spin_->GetWidth(), spin_->GetHeight());
1518 nux::Geometry spin_geo(geo.x + ((geo.width - spin_size.width) / 2),
1519 geo.y + ((geo.height - spin_size.height) / 2),
1520 spin_size.width,
1521@@ -124,8 +122,7 @@
1522 }
1523 else
1524 {
1525- nux::Size circle_size(RawPixel(circle_->GetWidth()).CP(scale),
1526- RawPixel(circle_->GetHeight()).CP(scale));
1527+ nux::Size circle_size(circle_->GetWidth(), circle_->GetHeight());
1528 GfxContext.QRP_1Tex(geo.x + ((geo.width - circle_size.width) / 2),
1529 geo.y + ((geo.height - circle_size.height) / 2),
1530 circle_size.width,
1531@@ -134,8 +131,7 @@
1532 texxform,
1533 nux::color::White);
1534
1535- nux::Size close_size(RawPixel(close_->GetWidth()).CP(scale),
1536- RawPixel(close_->GetHeight()).CP(scale));
1537+ nux::Size close_size(close_->GetWidth(), close_->GetHeight());
1538 GfxContext.QRP_1Tex(geo.x + ((geo.width - close_size.width) / 2),
1539 geo.y + ((geo.height - close_size.height) / 2),
1540 close_size.width,
1541
1542=== modified file 'unity-shared/SearchBarSpinner.h'
1543--- unity-shared/SearchBarSpinner.h 2014-07-11 03:37:01 +0000
1544+++ unity-shared/SearchBarSpinner.h 2014-07-11 03:37:01 +0000
1545@@ -68,10 +68,10 @@
1546
1547 SpinnerState state_;
1548
1549- nux::BaseTexture* magnify_;
1550- nux::BaseTexture* circle_;
1551- nux::BaseTexture* close_;
1552- nux::BaseTexture* spin_;
1553+ nux::ObjectPtr<nux::BaseTexture> magnify_;
1554+ nux::ObjectPtr<nux::BaseTexture> circle_;
1555+ nux::ObjectPtr<nux::BaseTexture> close_;
1556+ nux::ObjectPtr<nux::BaseTexture> spin_;
1557
1558 glib::Source::UniquePtr spinner_timeout_;
1559 glib::Source::UniquePtr frame_timeout_;
1560
1561=== modified file 'unity-shared/TextureCache.cpp'
1562--- unity-shared/TextureCache.cpp 2014-03-27 12:20:13 +0000
1563+++ unity-shared/TextureCache.cpp 2014-07-11 03:37:01 +0000
1564@@ -27,6 +27,15 @@
1565 namespace unity
1566 {
1567 DECLARE_LOGGER(logger, "unity.internal.texturecache");
1568+namespace
1569+{
1570+// Stolen from boost
1571+template <class T>
1572+inline std::size_t hash_combine(std::size_t seed, T const& v)
1573+{
1574+ return seed ^ (std::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2));
1575+}
1576+}
1577
1578 TextureCache& TextureCache::GetDefault()
1579 {
1580@@ -42,9 +51,7 @@
1581
1582 std::size_t TextureCache::Hash(std::string const& id, int width, int height)
1583 {
1584- return ((std::hash<std::string>()(id)
1585- ^ (std::hash<int>()(width) << 1)) >> 1)
1586- ^ (std::hash<int>()(height) << 1);
1587+ return hash_combine(hash_combine(std::hash<std::string>()(id), width), height);
1588 }
1589
1590 TextureCache::BaseTexturePtr TextureCache::FindTexture(std::string const& texture_id,