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

Proposed by Florian Boucault on 2011-07-05
Status: Merged
Approved by: Florian Boucault on 2011-07-13
Approved revision: 617
Merged at revision: 626
Proposed branch: lp:~fboucault/unity-2d/cache_dash_background
Merge into: lp:unity-2d/3.0
Diff against target: 15 lines (+5/-0)
1 file modified
places/dash.qml (+5/-0)
To merge this branch: bzr merge lp:~fboucault/unity-2d/cache_dash_background
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) 2011-07-05 Needs Fixing on 2011-07-06
Review via email:

Description of the change

[dash] Cache background rendering when in desktop mode.

To post a comment you must log in.
Ricardo Salveti (rsalveti) wrote :

In general this change makes the dashboard consume a lot less CPU when using with -opengl.

Before the patch (at the more apps screen):
samples pcnt function
9781.00 29.2% QGL2PaintEngineExPrivate::drawPixmapFragments(QPainter::PixmapFragment const*, int, QPixmap const&, QFlags<QPainter::PixmapFragmentHint>)
7405.00 22.1% QVarLengthArray<QPainter::PixmapFragment, 16>::realloc(int, int)
1078.00 3.2% __memzero
 977.00 2.9% _raw_spin_unlock_irqrestore
 778.00 2.3% cpu_v7_dcache_clean_area
 775.00 2.3% _raw_spin_unlock_irq
 759.00 2.3% debug_smp_processor_id
 441.00 1.3% QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*)
 394.00 1.2% qDrawBorderPixmap(QPainter*, QRect const&, QMargins const&, QPixmap const&, QRect const&, QMargins const&, QTileRules const&, QFlags<QDrawBorderPixmap::DrawingHint>)
 392.00 1.2% tick_nohz_stop_sched_tick
 383.00 1.1% add_preempt_count
 359.00 1.1% sub_preempt_count
 342.00 1.0% get_page_from_freelist

After applying the patch (at the more apps screen):
samples pcnt function
 947.00 8.6% debug_smp_processor_id
 638.00 5.8% CopyTexture32Bits
 581.00 5.3% _raw_spin_unlock_irqrestore
 560.00 5.1% QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*)
 524.00 4.8% QVarLengthArray<QPainter::PixmapFragment, 16>::realloc(int, int)
 356.00 3.2% pixman_composite_over_8888_8888_asm_neon
 305.00 2.8% QRasterPaintEngine::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>)
 278.00 2.5% _raw_spin_unlock_irq
 235.00 2.1% QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool)
 233.00 2.1% __memzero
 183.00 1.7% QRasterPaintEnginePrivate::drawImage(QPointF const&, QImage const&, void (*)(unsigned char*, int, unsigned char const*, int, int, int, int), QRect const&, int, QRect const&)
 177.00 1.6% cpu_v7_dcache_clean_area

The screen also seems faster in general, but I also saw two issues with the change:
1 - The border and the background transparency changed, as you can see with the following screenshots:
2 - The dash is still wasting time at the 'more apps' screen even when nothing is being changed at the screen, as you can see from the trace above (but this may be tracked at another bug).

Changing status to 'Needs Fixing' because of the new background behavior at the dash.

review: Needs Fixing
Florian Boucault (fboucault) wrote :

Can you try again with the branch in on top of the patch discussed here?

I expect the issues you screenshoted to disappear with that.

Ricardo Salveti (rsalveti) wrote :

No, even after merging both branches this new issue is still there.

I believe this other branch helps fixing an issue that only appeared with OpenGL, but doesn't have any effect with OpenGLES.

Florian Boucault (fboucault) wrote :

Looking at the screenshots, I don't think this patch makes the situation worse: the dash is not transparent in either case. Before the patch its background is plain white, after the patch its background is plain black. I would merge it for the performance improvement and try to fix the transparency issue separately.
I don't have a working device on which I can try various possible fixes with an OpenGL/ES driver. Could you try one thing and see if the transparency works better?

in libunity-2d-private/src/unity2ddeclarativeview.cpp line 61, change:

            setAttribute(Qt::WA_OpaquePaintEvent, true);

            setAttribute(Qt::WA_OpaquePaintEvent, false);

If that does not help, try to add the following line just after:


Florian Boucault (fboucault) wrote :

Merging as per discussion on IRC. Tests mentioned above still need to be performed on the right device.

Ricardo Salveti (rsalveti) wrote :

Fair enough. Moved the discussion for the additional issue to


Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/dash.qml'
2--- places/dash.qml 2011-06-23 17:08:53 +0000
3+++ places/dash.qml 2011-07-05 19:03:42 +0000
4@@ -97,6 +97,11 @@
5 }
7 BorderImage {
8+ /* Avoid redraw at rendering necessary to prevent high CPU usage.
9+ Ref.:
10+ */
11+ effect: CacheEffect {}
13 anchors.fill: parent
14 visible: dashView.dashMode == DashDeclarativeView.DesktopMode
15 source: screen.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci"


People subscribed via source and target branches