Merge lp:~unity-team/unity8/croppedImageMinimumSourceSize into lp:unity8
- croppedImageMinimumSourceSize
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | kevin gunn | ||||||||
Approved revision: | 1213 | ||||||||
Merged at revision: | 1325 | ||||||||
Proposed branch: | lp:~unity-team/unity8/croppedImageMinimumSourceSize | ||||||||
Merge into: | lp:unity8 | ||||||||
Prerequisite: | lp:~unity-team/unity8/scopes_more_things_on_memory | ||||||||
Diff against target: |
239 lines (+55/-28) 9 files modified
plugins/Dash/CardCreator.js (+4/-7) plugins/Dash/CroppedImageMinimumSourceSize.qml (+38/-0) plugins/Dash/qmldir (+2/-1) tests/plugins/Dash/cardcreator/1.res (+2/-2) tests/plugins/Dash/cardcreator/2.res (+2/-5) tests/plugins/Dash/cardcreator/3.res (+2/-2) tests/plugins/Dash/cardcreator/4.res (+1/-4) tests/plugins/Dash/cardcreator/5.res (+2/-2) tests/plugins/Dash/cardcreator/7.res (+2/-5) |
||||||||
To merge this branch: | bzr merge lp:~unity-team/unity8/croppedImageMinimumSourceSize | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Mirco Müller (community) | Approve | ||
Albert Astals Cid (community) | is my code | Abstain | |
Lars Karlitski | Pending | ||
Andrea Cimitan | Pending | ||
Review via email: mp+233319@code.launchpad.net |
This proposal supersedes a proposal from 2014-08-25.
Commit message
Save texture memory by limiting sourceSize
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
Andrea Cimitan (cimi) : Posted in a previous version of this proposal | # |
Andrea Cimitan (cimi) : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:1203
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal | # |
Instead of using resized and resizing, shall we use a string property (or int) representing "none" "resizing" "resized" states?
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal | # |
> Instead of using resized and resizing, shall we use a string property (or int)
> representing "none" "resizing" "resized" states?
I think this way is easier, the "resizing" is an internal state, the outer world only cares for none and resized, thus that boolean is the one they should be using directly.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1204
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1205
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1206
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) : | # |
Andrea Cimitan (cimi) : | # |
- 1207. By Albert Astals Cid
-
properties at the begnning
- 1208. By Albert Astals Cid
-
Merge
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1207
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1208
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1209. By Albert Astals Cid
-
Do not rename
- 1210. By Albert Astals Cid
-
merge
- 1211. By Albert Astals Cid
-
This seems to come from a broken merge
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1210
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1211
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Mirco Müller (macslow) wrote : | # |
Code looks good, but I still need to run it on the device for testing/measuring. Depencency-problems currently keep me from installing the .debs from output.zip.
This qml-test fails:
- qmltestrunner:
Albert Astals Cid (aacid) wrote : | # |
> Code looks good, but I still need to run it on the device for
> testing/measuring. Depencency-problems currently keep me from installing the
> .debs from output.zip.
>
> This qml-test fails:
> - qmltestrunner:
Are you running with the pre-requisite?
- 1212. By Albert Astals Cid
-
Merge
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1212
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1213. By Albert Astals Cid
-
Merge
Mirco Müller (macslow) wrote : | # |
Still trying to get lp:ubuntu-ui-toolkit/staging compiled (into a .deb) so I can properly test.
Mirco Müller (macslow) wrote : | # |
Ok, finally got the prerequisite lp:ubuntu-ui-toolkit/staging working and was able to properly test this locally. All fine and qmltests pass too. Now all we need is to wait for Jenkins to get its act together and I'm fine with top-approving.
Andrea Cimitan (cimi) wrote : | # |
on my side, used this many times, works fine indeed...
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1213
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'plugins/Dash/CardCreator.js' |
2 | --- plugins/Dash/CardCreator.js 2014-09-23 13:39:16 +0000 |
3 | +++ plugins/Dash/CardCreator.js 2014-09-23 13:39:16 +0000 |
4 | @@ -82,13 +82,13 @@ |
5 | height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height }); \n\ |
6 | } \n\ |
7 | } \n\ |
8 | - image: Image { \n\ |
9 | + image: CroppedImageMinimumSourceSize { \n\ |
10 | objectName: "artImage"; \n\ |
11 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\ |
12 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } \n\ |
13 | cache: true; \n\ |
14 | asynchronous: root.asynchronous; \n\ |
15 | - fillMode: Image.PreserveAspectCrop; \n\ |
16 | + visible: false; \n\ |
17 | width: %2; \n\ |
18 | height: %3; \n\ |
19 | } \n\ |
20 | @@ -191,17 +191,14 @@ |
21 | |
22 | // %1 is used as anchors of mascotImage |
23 | // %2 is used as visible of mascotImage |
24 | -var kMascotImageCode = 'Image { \n\ |
25 | +var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\ |
26 | id: mascotImage; \n\ |
27 | objectName: "mascotImage"; \n\ |
28 | anchors { %1 } \n\ |
29 | - readonly property int maxSize: Math.max(width, height) * 4; \n\ |
30 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\ |
31 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } \n\ |
32 | width: units.gu(6); \n\ |
33 | height: units.gu(5.625); \n\ |
34 | - sourceSize { width: maxSize; height: maxSize } \n\ |
35 | - fillMode: Image.PreserveAspectCrop; \n\ |
36 | horizontalAlignment: Image.AlignHCenter; \n\ |
37 | verticalAlignment: Image.AlignVCenter; \n\ |
38 | visible: %2; \n\ |
39 | @@ -438,7 +435,7 @@ |
40 | mascotShapeCode = kMascotShapeLoaderCode.arg(mascotAnchors); |
41 | } |
42 | |
43 | - var mascotImageVisible = useMascotShape ? 'false' : 'showHeader'; |
44 | + var mascotImageVisible = useMascotShape ? 'false' : 'showHeader && resized'; |
45 | mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible); |
46 | } |
47 | |
48 | |
49 | === added file 'plugins/Dash/CroppedImageMinimumSourceSize.qml' |
50 | --- plugins/Dash/CroppedImageMinimumSourceSize.qml 1970-01-01 00:00:00 +0000 |
51 | +++ plugins/Dash/CroppedImageMinimumSourceSize.qml 2014-09-23 13:39:16 +0000 |
52 | @@ -0,0 +1,38 @@ |
53 | +/* |
54 | + * Copyright (C) 2014 Canonical, Ltd. |
55 | + * |
56 | + * This program is free software; you can redistribute it and/or modify |
57 | + * it under the terms of the GNU General Public License as published by |
58 | + * the Free Software Foundation; version 3. |
59 | + * |
60 | + * This program is distributed in the hope that it will be useful, |
61 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
62 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
63 | + * GNU General Public License for more details. |
64 | + * |
65 | + * You should have received a copy of the GNU General Public License |
66 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
67 | + */ |
68 | + |
69 | +import QtQuick 2.3 |
70 | + |
71 | +Image { |
72 | + property bool resized: false |
73 | + property bool resizing: false |
74 | + fillMode: Image.PreserveAspectCrop |
75 | + visible: resized |
76 | + onSourceSizeChanged: { |
77 | + if (!resized && !resizing) { |
78 | + resizing = true; |
79 | + var ar = width / height; |
80 | + var ssar = sourceSize.width / sourceSize.height; |
81 | + if (ar > ssar) { |
82 | + sourceSize = Qt.size(width, 0); |
83 | + } else { |
84 | + sourceSize = Qt.size(0, height); |
85 | + } |
86 | + resizing = false; |
87 | + resized = true; |
88 | + } |
89 | + } |
90 | +} |
91 | |
92 | === modified file 'plugins/Dash/qmldir' |
93 | --- plugins/Dash/qmldir 2014-07-22 10:03:37 +0000 |
94 | +++ plugins/Dash/qmldir 2014-09-23 13:39:16 +0000 |
95 | @@ -3,4 +3,5 @@ |
96 | typeinfo Dash.qmltypes |
97 | singleton CardCreatorCache 0.1 CardCreatorCache.qml |
98 | ScopeStyle 0.1 ScopeStyle.qml |
99 | -CardAttributes 0.1 CardAttributes.qml |
100 | \ No newline at end of file |
101 | +CardAttributes 0.1 CardAttributes.qml |
102 | +CroppedImageMinimumSourceSize 0.1 CroppedImageMinimumSourceSize.qml |
103 | |
104 | === modified file 'tests/plugins/Dash/cardcreator/1.res' |
105 | --- tests/plugins/Dash/cardcreator/1.res 2014-09-23 13:39:16 +0000 |
106 | +++ tests/plugins/Dash/cardcreator/1.res 2014-09-23 13:39:16 +0000 |
107 | @@ -44,13 +44,13 @@ |
108 | height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height }); |
109 | } |
110 | } |
111 | - image: Image { |
112 | + image: CroppedImageMinimumSourceSize { |
113 | objectName: "artImage"; |
114 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
115 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } |
116 | cache: true; |
117 | asynchronous: root.asynchronous; |
118 | - fillMode: Image.PreserveAspectCrop; |
119 | + visible: false; |
120 | width: root.width; |
121 | height: width / artShape.aspect; |
122 | } |
123 | |
124 | === modified file 'tests/plugins/Dash/cardcreator/2.res' |
125 | --- tests/plugins/Dash/cardcreator/2.res 2014-09-23 13:39:16 +0000 |
126 | +++ tests/plugins/Dash/cardcreator/2.res 2014-09-23 13:39:16 +0000 |
127 | @@ -62,20 +62,17 @@ |
128 | anchors.margins: margins; |
129 | anchors.rightMargin: 0; |
130 | data: [ |
131 | -Image { |
132 | +CroppedImageMinimumSourceSize { |
133 | id: mascotImage; |
134 | objectName: "mascotImage"; |
135 | anchors { verticalCenter: parent.verticalCenter; } |
136 | - readonly property int maxSize: Math.max(width, height) * 4; |
137 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
138 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } |
139 | width: units.gu(6); |
140 | height: units.gu(5.625); |
141 | - sourceSize { width: maxSize; height: maxSize } |
142 | - fillMode: Image.PreserveAspectCrop; |
143 | horizontalAlignment: Image.AlignHCenter; |
144 | verticalAlignment: Image.AlignVCenter; |
145 | - visible: showHeader; |
146 | + visible: showHeader && resized; |
147 | } |
148 | ,Item { |
149 | id: headerTitleContainer; |
150 | |
151 | === modified file 'tests/plugins/Dash/cardcreator/3.res' |
152 | --- tests/plugins/Dash/cardcreator/3.res 2014-09-23 13:39:16 +0000 |
153 | +++ tests/plugins/Dash/cardcreator/3.res 2014-09-23 13:39:16 +0000 |
154 | @@ -44,13 +44,13 @@ |
155 | height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height }); |
156 | } |
157 | } |
158 | - image: Image { |
159 | + image: CroppedImageMinimumSourceSize { |
160 | objectName: "artImage"; |
161 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
162 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } |
163 | cache: true; |
164 | asynchronous: root.asynchronous; |
165 | - fillMode: Image.PreserveAspectCrop; |
166 | + visible: false; |
167 | width: root.width; |
168 | height: width / artShape.aspect; |
169 | } |
170 | |
171 | === modified file 'tests/plugins/Dash/cardcreator/4.res' |
172 | --- tests/plugins/Dash/cardcreator/4.res 2014-09-23 13:39:16 +0000 |
173 | +++ tests/plugins/Dash/cardcreator/4.res 2014-09-23 13:39:16 +0000 |
174 | @@ -41,17 +41,14 @@ |
175 | anchors { verticalCenter: parent.verticalCenter; } |
176 | } |
177 | |
178 | -,Image { |
179 | +,CroppedImageMinimumSourceSize { |
180 | id: mascotImage; |
181 | objectName: "mascotImage"; |
182 | anchors { verticalCenter: parent.verticalCenter; } |
183 | - readonly property int maxSize: Math.max(width, height) * 4; |
184 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
185 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } |
186 | width: units.gu(6); |
187 | height: units.gu(5.625); |
188 | - sourceSize { width: maxSize; height: maxSize } |
189 | - fillMode: Image.PreserveAspectCrop; |
190 | horizontalAlignment: Image.AlignHCenter; |
191 | verticalAlignment: Image.AlignVCenter; |
192 | visible: false; |
193 | |
194 | === modified file 'tests/plugins/Dash/cardcreator/5.res' |
195 | --- tests/plugins/Dash/cardcreator/5.res 2014-09-23 13:39:16 +0000 |
196 | +++ tests/plugins/Dash/cardcreator/5.res 2014-09-23 13:39:16 +0000 |
197 | @@ -44,13 +44,13 @@ |
198 | height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height }); |
199 | } |
200 | } |
201 | - image: Image { |
202 | + image: CroppedImageMinimumSourceSize { |
203 | objectName: "artImage"; |
204 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
205 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } |
206 | cache: true; |
207 | asynchronous: root.asynchronous; |
208 | - fillMode: Image.PreserveAspectCrop; |
209 | + visible: false; |
210 | width: root.width; |
211 | height: width / artShape.aspect; |
212 | } |
213 | |
214 | === modified file 'tests/plugins/Dash/cardcreator/7.res' |
215 | --- tests/plugins/Dash/cardcreator/7.res 2014-09-23 13:39:16 +0000 |
216 | +++ tests/plugins/Dash/cardcreator/7.res 2014-09-23 13:39:16 +0000 |
217 | @@ -62,20 +62,17 @@ |
218 | anchors.margins: margins; |
219 | anchors.rightMargin: 0; |
220 | data: [ |
221 | -Image { |
222 | +CroppedImageMinimumSourceSize { |
223 | id: mascotImage; |
224 | objectName: "mascotImage"; |
225 | anchors { verticalCenter: parent.verticalCenter; } |
226 | - readonly property int maxSize: Math.max(width, height) * 4; |
227 | property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
228 | source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } |
229 | width: units.gu(6); |
230 | height: units.gu(5.625); |
231 | - sourceSize { width: maxSize; height: maxSize } |
232 | - fillMode: Image.PreserveAspectCrop; |
233 | horizontalAlignment: Image.AlignHCenter; |
234 | verticalAlignment: Image.AlignVCenter; |
235 | - visible: showHeader; |
236 | + visible: showHeader && resized; |
237 | } |
238 | |
239 | ,Item { |
FAILED: Continuous integration, rev:1201 jenkins. qa.ubuntu. com/job/ unity8- ci/4073/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/3978 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- utopic/ 1074 jenkins. qa.ubuntu. com/job/ unity8- utopic- amd64-ci/ 1167 jenkins. qa.ubuntu. com/job/ unity8- utopic- i386-ci/ 1167 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/3825 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/5228 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/5228/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 12023
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/4073/ rebuild
http://