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

Proposed by Florian Boucault
Status: Merged
Approved by: Gerry Boland
Approved revision: 620
Merged at revision: 830
Proposed branch: lp:~fboucault/unity-2d/spread_limit_sizes
Merge into: lp:unity-2d
Diff against target: 50 lines (+18/-1)
3 files modified
libunity-2d-private/Unity2d/GnomeBackground.qml (+9/-0)
libunity-2d-private/src/windowimageprovider.cpp (+1/-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
Gerry Boland (community) Approve
Ugo Riboni Pending
Review via email: mp+84707@code.launchpad.net

This proposal supersedes a proposal from 2011-07-11.

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 : Posted in a previous version of this proposal

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
Revision history for this message
Florian Boucault (fboucault) wrote :

Ugo, Gerry: can you please try today and tell me if as a user it makes you cringe visually. Thanks!

Revision history for this message
Florian Boucault (fboucault) wrote :

I did extensive framerate analysis with the raster drawing backend on my laptop and for that particular patch I obtained a relevant gain in frame rendering time of a few milliseconds, up to around 5ms.

The following measurements were done with QML_SHOW_FRAMERATE=1 on the last frames when exiting the spread after having pressed escape.

limited to 512px

unity-2d-spread: [DEBUG] paintEvent: 14 time since last frame: 21
unity-2d-spread: [DEBUG] paintEvent: 18 time since last frame: 24
unity-2d-spread: [DEBUG] paintEvent: 18 time since last frame: 27
unity-2d-spread: [DEBUG] paintEvent: 25 time since last frame: 28
unity-2d-spread: [DEBUG] paintEvent: 26 time since last frame: 36
unity-2d-spread: [DEBUG] paintEvent: 30 time since last frame: 38

no limit

unity-2d-spread: [DEBUG] paintEvent: 16 time since last frame: 18
unity-2d-spread: [DEBUG] paintEvent: 18 time since last frame: 23
unity-2d-spread: [DEBUG] paintEvent: 23 time since last frame: 28
unity-2d-spread: [DEBUG] paintEvent: 30 time since last frame: 33
unity-2d-spread: [DEBUG] paintEvent: 34 time since last frame: 41
unity-2d-spread: [DEBUG] paintEvent: 35 time since last frame: 49

Revision history for this message
Florian Boucault (fboucault) wrote :

On the Pandaboard and other ARM machines the patch makes a world of difference in the framerate when using the OpenGL drawing backend. No measurements were conducted using the raster drawing backend but we can expect that the gains measured on my macbook pro will be even bigger there.

Revision history for this message
Gerry Boland (gerboland) wrote :

Right now I don't think I would notice the difference if it wasn't pointed out to me.

I tested with maximised dash on a monitor at 1440x900. But I'd like to see how it appears on a higher-resolution screen. Ugo: have you a bigger screen?

Revision history for this message
Ugo Riboni (uriboni) wrote :

I tried at 1920x1200. When the spread is zoomed out there is no noticeable difference.
However when I zoom in on a desktop then I can read the text in an IRC window.
With this patch instead the text appears pixelated in an ugly way and unreadable.

Revision history for this message
Ugo Riboni (uriboni) wrote :
Revision history for this message
Gerry Boland (gerboland) wrote :

With further discussion, we have decided that it is best to accept this change, and see if beta testers object to the visual deterioration. The performance improvements are very beneficial on lower-end machines.

It is planned for higher-end machines that support OpenGL, a separate patch will enable live-previews of windows and by-pass this restriction completely. Or use Compiz and not use the Spread at all. TBC

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-2d/39/console reported an error when processing this lp:~fboucault/unity-2d/spread_limit_sizes branch.
Not merging it.

Revision history for this message
Gerry Boland (gerboland) wrote :

Merge failed due to API breakage. This was reverted, so this should merge now.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-2d/42/console reported an error when processing this lp:~fboucault/unity-2d/spread_limit_sizes branch.
Not merging it.

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-10-21 12:46:08 +0000
3+++ libunity-2d-private/Unity2d/GnomeBackground.qml 2011-12-07 02:20:28 +0000
4@@ -85,6 +85,15 @@
5
6 smooth: true
7
8+ /* Limit the width 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+ The height will be computed to preserve the aspect ratio.
13+ */
14+ sourceSize.width: 512
15+ sourceSize.height: 0
16+
17 /* by default, place the background on top of the desktop background,
18 no matter where the DeclarativeView or the parent object are placed.
19 */
20
21=== modified file 'libunity-2d-private/src/windowimageprovider.cpp'
22--- libunity-2d-private/src/windowimageprovider.cpp 2011-08-09 14:32:13 +0000
23+++ libunity-2d-private/src/windowimageprovider.cpp 2011-12-07 02:20:28 +0000
24@@ -134,7 +134,7 @@
25
26 if (!image.isNull()) {
27 if (requestedSize.isValid()) {
28- image = image.scaled(requestedSize);
29+ image = image.scaled(requestedSize, Qt::KeepAspectRatio);
30 }
31 size->setWidth(image.width());
32 size->setHeight(image.height());
33
34=== modified file 'spread/Window.qml'
35--- spread/Window.qml 2011-06-23 17:08:53 +0000
36+++ spread/Window.qml 2011-12-07 02:20:28 +0000
37@@ -79,6 +79,14 @@
38 + windowInfo.contentXid + "@"
39 + screen.currentTime()
40
41+ /* The window is scaled to a rectangle as large as possible inside
42+ sourceSize while preserving its aspect ratio.
43+ It saves video memory when using the OpenGL backend.
44+ It makes scaling cheaper in the spread when using the raster backend.
45+ */
46+ sourceSize.width: 512
47+ sourceSize.height: 512
48+
49 /* Disabled during animations for performance reasons */
50 smooth: !animating
51

Subscribers

People subscribed via source and target branches