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

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
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) Needs Fixing
Review via email: mp+66957@code.launchpad.net

Description of the change

[dash] Cache background rendering when in desktop mode.

To post a comment you must log in.
Revision history for this message
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:
 * http://people.canonical.com/~rsalveti/unity-2d/unity-2d-trunk-opengl.png
 * http://people.canonical.com/~rsalveti/unity-2d/unity-2d-cache_dash_background-opengl.png
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
Revision history for this message
Florian Boucault (fboucault) wrote :

Can you try again with the branch in https://code.launchpad.net/~fboucault/unity-2d/opengl_plus_composite_fix/+merge/66932 on top of the patch discussed here?

I expect the issues you screenshoted to disappear with that.

Revision history for this message
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.

Revision history for this message
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);

into:
            setAttribute(Qt::WA_OpaquePaintEvent, false);

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

            glWidget->setAutoFillBackground(true);

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

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

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Fair enough. Moved the discussion for the additional issue to https://bugs.launchpad.net/unity-2d/+bug/810198.

Thanks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'places/dash.qml'
--- places/dash.qml 2011-06-23 17:08:53 +0000
+++ places/dash.qml 2011-07-05 19:03:42 +0000
@@ -97,6 +97,11 @@
97 }97 }
9898
99 BorderImage {99 BorderImage {
100 /* Avoid redraw at rendering necessary to prevent high CPU usage.
101 Ref.: https://bugs.launchpad.net/unity-2d/+bug/806122
102 */
103 effect: CacheEffect {}
104
100 anchors.fill: parent105 anchors.fill: parent
101 visible: dashView.dashMode == DashDeclarativeView.DesktopMode106 visible: dashView.dashMode == DashDeclarativeView.DesktopMode
102 source: screen.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci"107 source: screen.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci"

Subscribers

People subscribed via source and target branches