Mir

Merge lp:~alan-griffiths/mir/fix-1700981 into lp:mir

Proposed by Alan Griffiths on 2017-06-28
Status: Merged
Approved by: Brandon Schaefer on 2017-06-28
Approved revision: 4201
Merged at revision: 4201
Proposed branch: lp:~alan-griffiths/mir/fix-1700981
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/fix-1699484
Diff against target: 57 lines (+20/-13)
1 file modified
src/server/graphics/nested/display_buffer.cpp (+20/-13)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1700981
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) 2017-06-28 Approve on 2017-06-28
Mir CI Bot continuous-integration Approve on 2017-06-28
Review via email: mp+326434@code.launchpad.net

Commit message

Fix nested passthrough to respect the size of renderables

To post a comment you must log in.
lp:~alan-griffiths/mir/fix-1700981 updated on 2017-06-28
4201. By Alan Griffiths on 2017-06-28

Refactor for easier comprehension

Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4200
https://mir-jenkins.ubuntu.com/job/mir-ci/3465/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4729
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4887
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4876
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4876
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4876
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4766/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4766
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4766/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4201
https://mir-jenkins.ubuntu.com/job/mir-ci/3466/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4731
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4889
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4878
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4878
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4878
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4768/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4768
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4768/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Brandon Schaefer (brandontschaefer) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/graphics/nested/display_buffer.cpp'
2--- src/server/graphics/nested/display_buffer.cpp 2017-05-08 03:04:26 +0000
3+++ src/server/graphics/nested/display_buffer.cpp 2017-06-28 15:50:45 +0000
4@@ -117,17 +117,24 @@
5 bool mgn::detail::DisplayBuffer::overlay(RenderableList const& list)
6 {
7 if ((passthrough_option == mgn::PassthroughOption::disabled) ||
8- list.empty() ||
9- (list.back()->screen_position() != area) ||
10- (list.back()->alpha() != 1.0f) ||
11- (list.back()->shaped()) ||
12- (list.back()->transformation() != identity))
13- {
14- //could not represent scene with subsurfaces
15- return false;
16- }
17-
18- auto passthrough_buffer = list.back()->buffer();
19+ list.empty())
20+ {
21+ //could not represent scene with subsurfaces
22+ return false;
23+ }
24+
25+ auto const topmost = list.back();
26+
27+ if ((topmost->screen_position() != area) ||
28+ (topmost->alpha() != 1.0f) ||
29+ (topmost->shaped()) ||
30+ (topmost->transformation() != identity))
31+ {
32+ //could not represent scene with subsurfaces
33+ return false;
34+ }
35+
36+ auto passthrough_buffer = topmost->buffer();
37 auto native = dynamic_cast<mgn::NativeBuffer*>(passthrough_buffer->native_buffer_handle().get());
38 if (!native)
39 return false;
40@@ -144,7 +151,7 @@
41 if ((submission_info == last_submitted) && (submitted != submitted_buffers.end()))
42 return true;
43
44- if (list.back()->swap_interval() == 0)
45+ if (topmost->swap_interval() == 0)
46 host_chain->set_submission_mode(mgn::SubmissionMode::dropping);
47 else
48 host_chain->set_submission_mode(mgn::SubmissionMode::queueing);
49@@ -161,7 +168,7 @@
50 if (content != BackingContent::chain)
51 {
52 auto spec = host_connection->create_surface_spec();
53- spec->add_chain(*host_chain, geom::Displacement{0,0}, passthrough_buffer->size());
54+ spec->add_chain(*host_chain, geom::Displacement{0,0}, area.size);
55 content = BackingContent::chain;
56 host_surface->apply_spec(*spec);
57 }

Subscribers

People subscribed via source and target branches