Merge lp:~albaguirre/qtmir/ignore-first-frame into lp:qtmir

Proposed by Alberto Aguirre
Status: Rejected
Rejected by: Alberto Aguirre
Proposed branch: lp:~albaguirre/qtmir/ignore-first-frame
Merge into: lp:qtmir
Diff against target: 38 lines (+9/-1)
2 files modified
src/modules/Unity/Application/mirsurfaceitem.cpp (+8/-1)
src/modules/Unity/Application/mirsurfaceitem.h (+1/-0)
To merge this branch: bzr merge lp:~albaguirre/qtmir/ignore-first-frame
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Mir development team Pending
Review via email: mp+231612@code.launchpad.net

Commit message

Ignore application first posted frame

Ignore the first posted frame as it will be blank. Since the surface
is alpha enabled it's alpha channel is initialized to 0 (completely
transparent). If the frame is posted it will show through a flash
of the surface beneath (usually dash).

Description of the change

Ignore application first posted frame

Ignore the first posted frame as it will be blank. Since the surface
is alpha enabled it's alpha channel is initialized to 0 (completely
transparent). If the frame is posted it will show through a flash
of the surface beneath (usually dash).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

The root cause is actually a bug in mir: https://bugs.launchpad.net/mir/+bug/1359406

Unmerged revisions

237. By Alberto Aguirre

Ignore application first posted frame

Ignore the first posted frame as it will be blank. Since the surface
is alpha enabled it's alpha channel is initialized to 0 (completely
transparent). If the frame is posted it will show through a flash
of the surface beneath (usually dash).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp'
2--- src/modules/Unity/Application/mirsurfaceitem.cpp 2014-08-12 18:23:06 +0000
3+++ src/modules/Unity/Application/mirsurfaceitem.cpp 2014-08-20 19:05:50 +0000
4@@ -216,7 +216,7 @@
5 };
6
7 MirSurfaceObserver::MirSurfaceObserver()
8- : m_listener(nullptr) {
9+ : m_listener(nullptr), first_frame_posted(false) {
10 }
11
12 void MirSurfaceObserver::setListener(QObject *listener) {
13@@ -225,6 +225,13 @@
14
15 void MirSurfaceObserver::frame_posted(int frames_available) {
16 Q_UNUSED(frames_available);
17+
18+ //Ignore the first frame, it's blank for some reason.
19+ if (!first_frame_posted)
20+ {
21+ first_frame_posted = true;
22+ return;
23+ }
24 QMetaObject::invokeMethod(m_listener, "surfaceDamaged");
25 }
26
27
28=== modified file 'src/modules/Unity/Application/mirsurfaceitem.h'
29--- src/modules/Unity/Application/mirsurfaceitem.h 2014-07-23 11:57:49 +0000
30+++ src/modules/Unity/Application/mirsurfaceitem.h 2014-08-20 19:05:50 +0000
31@@ -62,6 +62,7 @@
32 void orientation_set_to(MirOrientation) override {}
33 private:
34 QObject *m_listener;
35+ bool first_frame_posted;
36 };
37
38 class MirSurfaceItem : public QQuickItem

Subscribers

People subscribed via source and target branches