Merge lp:~vanvugt/qtmir/fix-buffers_ready_for_compositor into lp:qtmir

Proposed by Michał Sawicz
Status: Merged
Approved by: Gerry Boland
Approved revision: 320
Merged at revision: 316
Proposed branch: lp:~vanvugt/qtmir/fix-buffers_ready_for_compositor
Merge into: lp:qtmir
Prerequisite: lp:~alan-griffiths/qtmir/port-to-msh-Shell
Diff against target: 75 lines (+9/-10)
3 files modified
src/modules/Unity/Application/mirsurfaceitem.cpp (+8/-8)
tests/modules/common/mock_renderable.h (+0/-2)
tests/modules/common/mock_surface.h (+1/-0)
To merge this branch: bzr merge lp:~vanvugt/qtmir/fix-buffers_ready_for_compositor
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: [email protected]

This proposal supersedes a proposal from 2015-02-03.

Commit message

QtMir changes required to support the Mir branch of the same name. Landing soon.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

1. Latest Mir (0.11 branch or later)
2. The prereq branch listed above.

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes, manual testing with qmlscene.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
317. By Daniel van Vugt

No change. Ping, Jenkins.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

+ const void* const user_id = (void*)123;
We use camelCase instead of _ separators, please use "userId"

Need you to also add the relevant section of https://wiki.ubuntu.com/Process/Merges/Checklists/QtMir to the description or in a comment.

Looks good otherwise.

318. By Daniel van Vugt

camelCase

319. By Daniel van Vugt

Merge latest from parent branch.

320. By Daniel van Vugt

Merge more from latest parent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Needs Mir 0.11

review: Approve

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 2015-01-14 09:07:41 +0000
3+++ src/modules/Unity/Application/mirsurfaceitem.cpp 2015-02-04 17:18:32 +0000
4@@ -440,10 +440,11 @@
5 ensureProvider();
6 bool textureUpdated = false;
7
8+ const void* const userId = (void*)123;
9 std::unique_ptr<mg::Renderable> renderable =
10- m_surface->compositor_snapshot((void*)123/*user_id*/);
11+ m_surface->compositor_snapshot(userId);
12
13- if (renderable->buffers_ready_for_compositor() > 0) {
14+ if (m_surface->buffers_ready_for_compositor(userId) > 0) {
15 if (!m_textureProvider->t) {
16 m_textureProvider->t = new MirBufferSGTexture(renderable->buffer());
17 } else {
18@@ -455,7 +456,7 @@
19 textureUpdated = true;
20 }
21
22- if (renderable->buffers_ready_for_compositor() > 0) {
23+ if (m_surface->buffers_ready_for_compositor(userId) > 0) {
24 QTimer::singleShot(0, this, SLOT(update()));
25 // restart the frame dropper so that we have enough time to render the next frame.
26 m_frameDropperTimer.start();
27@@ -747,18 +748,17 @@
28 {
29 QMutexLocker locker(&m_mutex);
30
31- std::unique_ptr<mg::Renderable> renderable =
32- m_surface->compositor_snapshot((void*)123/*user_id*/);
33+ const void* const userId = (void*)123; // TODO: Multimonitor support
34
35- while (renderable->buffers_ready_for_compositor() > 0) {
36+ while (m_surface->buffers_ready_for_compositor(userId) > 0) {
37 // The line below looks like an innocent, effect-less, getter. But as this
38 // method returns a unique_pointer, not holding its reference causes the
39 // buffer to be destroyed/released straight away.
40- m_surface->compositor_snapshot((void*)123/*user_id*/)->buffer();
41+ m_surface->compositor_snapshot(userId)->buffer();
42 qCDebug(QTMIR_SURFACES) << "MirSurfaceItem::dropPendingBuffers()"
43 << "surface =" << this
44 << "buffer dropped."
45- << renderable->buffers_ready_for_compositor()
46+ << m_surface->buffers_ready_for_compositor(userId)
47 << "left.";
48 }
49 }
50
51=== modified file 'tests/modules/common/mock_renderable.h'
52--- tests/modules/common/mock_renderable.h 2014-09-11 16:18:40 +0000
53+++ tests/modules/common/mock_renderable.h 2015-02-04 17:18:32 +0000
54@@ -34,9 +34,7 @@
55 MOCK_CONST_METHOD0(screen_position, geometry::Rectangle());
56 MOCK_CONST_METHOD0(alpha, float() );
57 MOCK_CONST_METHOD0(transformation, glm::mat4());
58- MOCK_CONST_METHOD0(visible, bool());
59 MOCK_CONST_METHOD0(shaped, bool());
60- MOCK_CONST_METHOD0(buffers_ready_for_compositor, int());
61 };
62
63 } // namespace graphics
64
65=== modified file 'tests/modules/common/mock_surface.h'
66--- tests/modules/common/mock_surface.h 2015-02-04 17:18:32 +0000
67+++ tests/modules/common/mock_surface.h 2015-02-04 17:18:32 +0000
68@@ -65,6 +65,7 @@
69 MOCK_CONST_METHOD0(input_channel, std::shared_ptr<input::InputChannel>());
70 MOCK_METHOD1(set_reception_mode, void(input::InputReceptionMode mode));
71 MOCK_METHOD0(request_client_surface_close, void());
72+ MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*));
73
74 // from mir::input::surface
75 MOCK_CONST_METHOD1(input_area_contains, bool(geometry::Point const& point));

Subscribers

People subscribed via source and target branches