Merge lp:~vanvugt/qtmir/fix-buffers_ready_for_compositor into lp:qtmir/devel-mir-next

Proposed by Daniel van Vugt
Status: Superseded
Proposed branch: lp:~vanvugt/qtmir/fix-buffers_ready_for_compositor
Merge into: lp:qtmir/devel-mir-next
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
Mir development team Pending
Review via email: mp+248419@code.launchpad.net

This proposal has been superseded by a proposal from 2015-02-04.

Commit message

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

To post a comment you must log in.
317. By Daniel van Vugt

No change. Ping, Jenkins.

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

Unmerged revisions

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-03 17:10:22 +0000
4@@ -440,10 +440,11 @@
5 ensureProvider();
6 bool textureUpdated = false;
7
8+ const void* const user_id = (void*)123;
9 std::unique_ptr<mg::Renderable> renderable =
10- m_surface->compositor_snapshot((void*)123/*user_id*/);
11+ m_surface->compositor_snapshot(user_id);
12
13- if (renderable->buffers_ready_for_compositor() > 0) {
14+ if (m_surface->buffers_ready_for_compositor(user_id) > 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(user_id) > 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 user_id = (void*)123; // TODO: Multimonitor support
34
35- while (renderable->buffers_ready_for_compositor() > 0) {
36+ while (m_surface->buffers_ready_for_compositor(user_id) > 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(user_id)->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(user_id)
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-03 17:10:22 +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-03 17:10:22 +0000
67+++ tests/modules/common/mock_surface.h 2015-02-03 17:10:22 +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