Merge lp:~fboucault/unity-2d/spread_limit_sizes into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Superseded
Proposed branch: lp:~fboucault/unity-2d/spread_limit_sizes
Merge into: lp:unity-2d/3.0
Diff against target: 57 lines (+25/-1)
3 files modified
libunity-2d-private/Unity2d/GnomeBackground.qml (+6/-0)
libunity-2d-private/Unity2d/windowimageprovider.cpp (+11/-1)
spread/Window.qml (+8/-0)
To merge this branch: bzr merge lp:~fboucault/unity-2d/spread_limit_sizes
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Needs Fixing
Review via email: mp+67517@code.launchpad.net

This proposal has been superseded by a proposal from 2011-12-07.

Description of the change

[spread] Windows and background are now limited in size to 512 which saves video
memory when using the OpenGL backend and can improve overall performance.

To post a comment you must log in.
Revision history for this message
Ugo Riboni (uriboni) wrote :

The idea and the code are good, but when testing it gnome-terminal windows appear very pixelated when zooming in and out, and it's not pleasant at all to see.

review: Needs Fixing
619. By Florian Boucault

Merged lp:unity-2d

620. By Florian Boucault

Removed unused code, reduced diff and simplified comments.

Unmerged revisions

620. By Florian Boucault

Removed unused code, reduced diff and simplified comments.

619. By Florian Boucault

Merged lp:unity-2d

618. By Florian Boucault

[spread] Windows and background are now limited in size to 512 which saves video
memory when using the OpenGL backend and can improve overall performance.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/Unity2d/GnomeBackground.qml'
2--- libunity-2d-private/Unity2d/GnomeBackground.qml 2011-06-23 17:08:53 +0000
3+++ libunity-2d-private/Unity2d/GnomeBackground.qml 2011-07-11 10:38:10 +0000
4@@ -85,6 +85,12 @@
5 }
6 width: screen.geometry.width
7 height: screen.geometry.height
8+ /* Limit the size of the background thus:
9+ - saving video memory when using the OpenGL backend
10+ - making scaling cheaper in the spread when using the raster backend
11+ */
12+ sourceSize.width: 512
13+ sourceSize.height: 0
14
15 smooth: true
16 x: screen.availableGeometry.x
17
18=== modified file 'libunity-2d-private/Unity2d/windowimageprovider.cpp'
19--- libunity-2d-private/Unity2d/windowimageprovider.cpp 2011-04-28 13:09:25 +0000
20+++ libunity-2d-private/Unity2d/windowimageprovider.cpp 2011-07-11 10:38:10 +0000
21@@ -129,7 +129,17 @@
22
23 if (!image.isNull()) {
24 if (requestedSize.isValid()) {
25- image = image.scaled(requestedSize);
26+ /* If the image's actual size is larger than the sourceSize, the
27+ image is scaled down. If only one dimension of the size is set
28+ to greater than 0, the other dimension is set in proportion to
29+ preserve the source image's aspect ratio. */
30+ if (requestedSize.width() == 0) {
31+ image = image.scaledToHeight(requestedSize.height());
32+ } else if (requestedSize.height() == 0) {
33+ image = image.scaledToHeight(requestedSize.width());
34+ } else {
35+ image = image.scaled(requestedSize, Qt::KeepAspectRatio);
36+ }
37 }
38 size->setWidth(image.width());
39 size->setHeight(image.height());
40
41=== modified file 'spread/Window.qml'
42--- spread/Window.qml 2011-06-23 17:08:53 +0000
43+++ spread/Window.qml 2011-07-11 10:38:10 +0000
44@@ -79,6 +79,14 @@
45 + windowInfo.contentXid + "@"
46 + screen.currentTime()
47
48+ /* The window is scaled to a rectangle as large as possible inside
49+ sourceSize while preserving its aspect ratio.
50+ It saves video memory when using the OpenGL backend.
51+ It makes scaling cheaper in the spread when using the raster backend.
52+ */
53+ sourceSize.width: 512
54+ sourceSize.height: 512
55+
56 /* Disabled during animations for performance reasons */
57 smooth: !animating
58

Subscribers

People subscribed via source and target branches