Mir

Merge lp:~raof/mir/cursor-suitability-is-per-buffer into lp:mir

Proposed by Chris Halse Rogers
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 4212
Proposed branch: lp:~raof/mir/cursor-suitability-is-per-buffer
Merge into: lp:mir
Prerequisite: lp:~raof/mir/better-buffer-plumbing
Diff against target: 94 lines (+0/-18)
6 files modified
include/server/mir/frontend/buffer_stream.h (+0/-1)
src/server/compositor/stream.cpp (+0/-7)
src/server/compositor/stream.h (+0/-1)
src/server/frontend/session_mediator.cpp (+0/-5)
tests/include/mir/test/doubles/mock_buffer_stream.h (+0/-3)
tests/include/mir/test/doubles/stub_buffer_stream.h (+0/-1)
To merge this branch: bzr merge lp:~raof/mir/cursor-suitability-is-per-buffer
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Alan Griffiths Approve
Brandon Schaefer (community) Approve
Review via email: mp+327666@code.launchpad.net

Commit message

Drop BufferStream::suitable_for_cursor

This is a per-buffer, not per-bufferstream, property.

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

Note that we now don't throw any errors if someone tries to submit a non-argb-8888 buffer to a cursor stream.

That said, we didn't correctly enforce that before - someone setting up a presentation chain could happily submit non-argb buffers to it.

This is something that should be fixed, but it might want to be fixed by supporting non-argb8888 buffers for cursors.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4222
https://mir-jenkins.ubuntu.com/job/mir-ci/3492/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4770/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4942/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4931/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4931/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4931/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4807/console

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4222
https://mir-jenkins.ubuntu.com/job/mir-ci/3494/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4773/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4945/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4934/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4934/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4934/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4810/console

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

03:25:12 Contents conflict in examples/render_surfaces.cpp
03:25:12 1 conflicts encountered.

Otherwise LGTM

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> 03:25:12 Contents conflict in examples/render_surfaces.cpp
> 03:25:12 1 conflicts encountered.
>
> Otherwise LGTM

+1

Revision history for this message
Alan Griffiths (alan-griffiths) :
review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

Oh, did I not actually push that?

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4223
https://mir-jenkins.ubuntu.com/job/mir-ci/3501/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4790
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4965
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4954
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4954
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4954
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4827/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/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4827/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/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4827/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/server/mir/frontend/buffer_stream.h'
2--- include/server/mir/frontend/buffer_stream.h 2017-05-08 03:04:26 +0000
3+++ include/server/mir/frontend/buffer_stream.h 2017-07-21 05:28:32 +0000
4@@ -63,7 +63,6 @@
5 // side once we only support the NBS system.
6 virtual void allow_framedropping(bool) = 0;
7 virtual void set_scale(float scale) = 0;
8- virtual bool suitable_for_cursor() const = 0;
9 protected:
10 BufferStream() = default;
11 BufferStream(BufferStream const&) = delete;
12
13=== modified file 'src/server/compositor/stream.cpp'
14--- src/server/compositor/stream.cpp 2017-07-04 04:06:59 +0000
15+++ src/server/compositor/stream.cpp 2017-07-21 05:28:32 +0000
16@@ -201,10 +201,3 @@
17 void mc::Stream::set_scale(float)
18 {
19 }
20-
21-bool mc::Stream::suitable_for_cursor() const
22-{
23- // We can't reasonably answer this question -
24- // Suitability for cursor use is a per-buffer property, not a per-stream property.
25- return true;
26-}
27
28=== modified file 'src/server/compositor/stream.h'
29--- src/server/compositor/stream.h 2017-07-04 00:54:25 +0000
30+++ src/server/compositor/stream.h 2017-07-21 05:28:32 +0000
31@@ -59,7 +59,6 @@
32 void associate_buffer(graphics::BufferID) override;
33 void disassociate_buffer(graphics::BufferID) override;
34 void set_scale(float scale) override;
35- bool suitable_for_cursor() const override;
36
37 private:
38 enum class ScheduleMode;
39
40=== modified file 'src/server/frontend/session_mediator.cpp'
41--- src/server/frontend/session_mediator.cpp 2017-07-18 01:32:08 +0000
42+++ src/server/frontend/session_mediator.cpp 2017-07-21 05:28:32 +0000
43@@ -757,8 +757,6 @@
44 {
45 mf::BufferStreamId id{surface_specification.cursor_id().value()};
46 auto stream = session->get_buffer_stream(id);
47- if (!stream->suitable_for_cursor())
48- BOOST_THROW_EXCEPTION(std::logic_error("Cursor buffer streams must have mir_pixel_format_argb_8888 format"));
49 mods.stream_cursor = msh::StreamCursor{
50 id, geom::Displacement{surface_specification.hotspot_x(), surface_specification.hotspot_y()} };
51 }
52@@ -1059,9 +1057,6 @@
53 auto hotspot = geom::Displacement{cursor_request->hotspot_x(), cursor_request->hotspot_y()};
54 auto stream = session->get_buffer_stream(stream_id);
55
56- if (!stream->suitable_for_cursor())
57- BOOST_THROW_EXCEPTION(std::logic_error("Cursor buffer streams must have mir_pixel_format_argb_8888 format"));
58-
59 surface->set_cursor_stream(stream, hotspot);
60 }
61 else
62
63=== modified file 'tests/include/mir/test/doubles/mock_buffer_stream.h'
64--- tests/include/mir/test/doubles/mock_buffer_stream.h 2017-05-08 03:04:26 +0000
65+++ tests/include/mir/test/doubles/mock_buffer_stream.h 2017-07-21 05:28:32 +0000
66@@ -53,8 +53,6 @@
67 .WillByDefault(testing::Return(mir_pixel_format_abgr_8888));
68 ON_CALL(*this, stream_size())
69 .WillByDefault(testing::Return(geometry::Size{0,0}));
70- ON_CALL(*this, suitable_for_cursor())
71- .WillByDefault(testing::Return(true));
72 }
73 std::shared_ptr<StubBuffer> buffer { std::make_shared<StubBuffer>() };
74 MOCK_METHOD1(acquire_client_buffer, void(std::function<void(graphics::Buffer* buffer)>));
75@@ -82,7 +80,6 @@
76 MOCK_METHOD1(disassociate_buffer, void(graphics::BufferID));
77 MOCK_METHOD1(associate_buffer, void(graphics::BufferID));
78 MOCK_METHOD1(set_scale, void(float));
79- MOCK_CONST_METHOD0(suitable_for_cursor, bool());
80
81 };
82 }
83
84=== modified file 'tests/include/mir/test/doubles/stub_buffer_stream.h'
85--- tests/include/mir/test/doubles/stub_buffer_stream.h 2017-05-08 03:04:26 +0000
86+++ tests/include/mir/test/doubles/stub_buffer_stream.h 2017-07-21 05:28:32 +0000
87@@ -82,7 +82,6 @@
88 void associate_buffer(graphics::BufferID) override {}
89 void disassociate_buffer(graphics::BufferID) override {}
90 void set_scale(float) override {}
91- bool suitable_for_cursor() const override { return false; }
92
93 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;
94 int nready = 0;

Subscribers

People subscribed via source and target branches