Mir

Merge lp:~vanvugt/mir/fix-1643488 into lp:mir

Proposed by Daniel van Vugt on 2017-01-27
Status: Merged
Approved by: Kevin DuBois on 2017-01-27
Approved revision: 3998
Merged at revision: 3996
Proposed branch: lp:~vanvugt/mir/fix-1643488
Merge into: lp:mir
Diff against target: 109 lines (+44/-2)
4 files modified
playground/demo-shell/demo_compositor.cpp (+1/-0)
playground/demo-shell/window_manager.cpp (+0/-2)
src/server/compositor/default_display_buffer_compositor.cpp (+1/-0)
tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+42/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1643488
Reviewer Review Type Date Requested Status
Alan Griffiths Approve on 2017-01-27
Kevin DuBois (community) 2017-01-27 Approve on 2017-01-27
Mir CI Bot continuous-integration Approve on 2017-01-27
Review via email: mp+315750@code.launchpad.net

Commit message

Ensure screen rotation without renderer reconstruction does not distort
(LP: #1643488)

Description of the change

This will conflict with my other branch but I'll deal with that later.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3998
https://mir-jenkins.ubuntu.com/job/mir-ci/2881/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/3801
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3880
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3870
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3870
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3870
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3828
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3828/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3828
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3828/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3828
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3828/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3828
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3828/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3828
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3828/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3828
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3828/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2881/rebuild

review: Approve (continuous-integration)
Kevin DuBois (kdub) wrote :

lgtm

review: Approve
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'playground/demo-shell/demo_compositor.cpp'
2--- playground/demo-shell/demo_compositor.cpp 2017-01-18 02:29:37 +0000
3+++ playground/demo-shell/demo_compositor.cpp 2017-01-27 09:43:04 +0000
4@@ -126,6 +126,7 @@
5 else
6 {
7 renderer.set_output_transform(display_buffer.orientation(), display_buffer.mirror_mode());
8+ update_viewport();
9 renderer.set_viewport(viewport);
10 renderer.begin(std::move(decorated));
11 renderer.render(renderable_list);
12
13=== modified file 'playground/demo-shell/window_manager.cpp'
14--- playground/demo-shell/window_manager.cpp 2017-01-18 02:29:37 +0000
15+++ playground/demo-shell/window_manager.cpp 2017-01-27 09:43:04 +0000
16@@ -298,7 +298,6 @@
17
18 if (rotating || mode_change || preferred_mode)
19 {
20- compositor->stop();
21 auto conf = display->configuration();
22 conf->for_each_output(
23 [&](mg::UserDisplayConfigurationOutput& output) -> void
24@@ -324,7 +323,6 @@
25 });
26
27 display->configure(*conf);
28- compositor->start();
29 return true;
30 }
31 }
32
33=== modified file 'src/server/compositor/default_display_buffer_compositor.cpp'
34--- src/server/compositor/default_display_buffer_compositor.cpp 2017-01-20 12:32:45 +0000
35+++ src/server/compositor/default_display_buffer_compositor.cpp 2017-01-27 09:43:04 +0000
36@@ -80,6 +80,7 @@
37 else
38 {
39 renderer->set_output_transform(display_buffer.orientation(), display_buffer.mirror_mode());
40+ renderer->set_viewport(view_area);
41 renderer->render(renderable_list);
42
43 report->renderables_in_frame(this, renderable_list);
44
45=== modified file 'tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp'
46--- tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp 2017-01-18 02:29:37 +0000
47+++ tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp 2017-01-27 09:43:04 +0000
48@@ -202,6 +202,44 @@
49 .WillOnce(Return(mir_mirror_mode_none));
50 EXPECT_CALL(mock_renderer, set_output_transform(mir_orientation_normal, mir_mirror_mode_none))
51 .InSequence(render_seq);
52+ EXPECT_CALL(mock_renderer, set_viewport(screen))
53+ .InSequence(render_seq);
54+ EXPECT_CALL(mock_renderer, render(ContainerEq(mg::RenderableList{big, small})))
55+ .InSequence(render_seq);
56+
57+ mc::DefaultDisplayBufferCompositor compositor(
58+ display_buffer,
59+ mt::fake_shared(mock_renderer),
60+ mr::null_compositor_report());
61+
62+ compositor.composite(make_scene_elements({
63+ big,
64+ small
65+ }));
66+}
67+
68+TEST_F(DefaultDisplayBufferCompositor, rotates_viewport)
69+{ // Regression test for LP: #1643488
70+ using namespace testing;
71+
72+ geom::Rectangle const rotated_screen{
73+ screen.top_left,
74+ {screen.size.height.as_int(), screen.size.width.as_int()}};
75+
76+ ON_CALL(display_buffer, view_area())
77+ .WillByDefault(Return(rotated_screen));
78+
79+ Sequence render_seq;
80+ EXPECT_CALL(mock_renderer, suspend())
81+ .Times(0);
82+ EXPECT_CALL(display_buffer, orientation())
83+ .WillOnce(Return(mir_orientation_left));
84+ EXPECT_CALL(display_buffer, mirror_mode())
85+ .WillOnce(Return(mir_mirror_mode_none));
86+ EXPECT_CALL(mock_renderer, set_output_transform(mir_orientation_left, mir_mirror_mode_none))
87+ .InSequence(render_seq);
88+ EXPECT_CALL(mock_renderer, set_viewport(rotated_screen))
89+ .InSequence(render_seq);
90 EXPECT_CALL(mock_renderer, render(ContainerEq(mg::RenderableList{big, small})))
91 .InSequence(render_seq);
92
93@@ -235,6 +273,8 @@
94 .InSequence(seq);
95 EXPECT_CALL(mock_renderer, set_output_transform(mir_orientation_normal, mir_mirror_mode_none))
96 .InSequence(seq);
97+ EXPECT_CALL(mock_renderer, set_viewport(screen))
98+ .InSequence(seq);
99 EXPECT_CALL(mock_renderer, render(IsEmpty()))
100 .InSequence(seq);
101
102@@ -250,6 +290,8 @@
103 .InSequence(seq);
104 EXPECT_CALL(mock_renderer, set_output_transform(mir_orientation_normal, mir_mirror_mode_none))
105 .InSequence(seq);
106+ EXPECT_CALL(mock_renderer, set_viewport(screen))
107+ .InSequence(seq);
108 EXPECT_CALL(mock_renderer, render(IsEmpty()))
109 .InSequence(seq);
110

Subscribers

People subscribed via source and target branches