Merge lp:~fboucault/unity-2d/fix_background_color into lp:unity-2d/0.4

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 381
Merged at revision: 390
Proposed branch: lp:~fboucault/unity-2d/fix_background_color
Merge into: lp:unity-2d/0.4
Diff against target: 74 lines (+6/-8)
3 files modified
places/GnomeBackground.qml (+3/-3)
places/UnityPlaces/blendedimageprovider.cpp (+0/-2)
spread/GnomeBackground.qml (+3/-3)
To merge this branch: bzr merge lp:~fboucault/unity-2d/fix_background_color
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
Olivier Tilloy Pending
Review via email: mp+47227@code.launchpad.net

Description of the change

GnomeBackground: fixed 'wallpaper' and 'scaled' modes (cf. launchpad bug #689531).

'wallpaper' was broken because the sourceSize was set and taken into account even
if the image's size was smaller (http://bugreports.qt.nokia.com/browse/QTBUG-16860).
Thanks to the newly introduced CacheEffect, there is no need to prescale the Image
anymore therefore using sourceSize can be avoided. Unfortunately BlendedImageProvider
was failing if sourceSize was unset. This is now fixed.

'scaled' was broken because the background color was invisible whenever the image
was visible. This optimization is no longer necessary thanks to the CacheEffect.

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

Florian, please hold on on this merge for a bit. I noticed a few issues with CacheEffect after i merged it from trunk into the workspaces switcher branch.
It seems to not work very well while the size is animated. It leaves "trails" of the previous size behind (as if the rendering didn't clear the previous frame before drawing the new one)

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

Setting as approved as the issue affects only animated usage of the CacheEffect, which isn't happening here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/GnomeBackground.qml'
2--- places/GnomeBackground.qml 2011-01-20 04:29:08 +0000
3+++ places/GnomeBackground.qml 2011-01-24 09:48:29 +0000
4@@ -34,7 +34,6 @@
5
6 anchors.fill: parent
7 color: primary_color.value
8- visible: !picture.visible
9 }
10
11 Image {
12@@ -62,7 +61,8 @@
13 }
14 width: dashView.screenGeometry.width
15 height: dashView.screenGeometry.height
16- sourceSize.width: width
17+
18+ smooth: true
19 x: -dashView.availableGeometry.x
20 y: -dashView.availableGeometry.y
21
22@@ -83,7 +83,7 @@
23 return Image.Stretch
24 else if(picture_options.value == "zoom")
25 return Image.PreserveAspectCrop
26- else return Image.Tile
27+ else return Image.PreserveAspectFit
28 }
29 }
30 }
31
32=== modified file 'places/UnityPlaces/blendedimageprovider.cpp'
33--- places/UnityPlaces/blendedimageprovider.cpp 2011-01-15 01:41:03 +0000
34+++ places/UnityPlaces/blendedimageprovider.cpp 2011-01-24 09:48:29 +0000
35@@ -47,8 +47,6 @@
36 image = image.scaledToWidth(requestedSize.width(), Qt::SmoothTransformation);
37 else if(requestedSize.isValid())
38 image = image.scaled(requestedSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
39- else
40- return QImage();
41
42 if(size)
43 *size = image.size();
44
45=== modified file 'spread/GnomeBackground.qml'
46--- spread/GnomeBackground.qml 2011-01-20 04:29:08 +0000
47+++ spread/GnomeBackground.qml 2011-01-24 09:48:29 +0000
48@@ -34,7 +34,6 @@
49
50 anchors.fill: parent
51 color: primary_color.value
52- visible: !picture.visible
53 }
54
55 Image {
56@@ -62,7 +61,8 @@
57 }
58 width: screenGeometry.width
59 height: screenGeometry.height
60- sourceSize.width: width
61+
62+ smooth: true
63 x: -availableGeometry.x
64 y: -availableGeometry.y
65
66@@ -83,7 +83,7 @@
67 return Image.Stretch
68 else if(picture_options.value == "zoom")
69 return Image.PreserveAspectCrop
70- else return Image.Tile
71+ else return Image.PreserveAspectFit
72 }
73 }
74 }

Subscribers

People subscribed via source and target branches