Mir

Merge lp:~kdub/mir/fix-1485070 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Merged at revision: 2848
Proposed branch: lp:~kdub/mir/fix-1485070
Merge into: lp:mir
Diff against target: 37 lines (+18/-1)
2 files modified
src/platforms/android/server/display_buffer.cpp (+3/-1)
tests/unit-tests/graphics/android/test_display_buffer.cpp (+15/-0)
To merge this branch: bzr merge lp:~kdub/mir/fix-1485070
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+268124@code.launchpad.net

Commit message

android: reject overlay optimization if DisplayBuffer is rotated.

fixes lp: #1485070

Description of the change

android: reject overlay optimization if DisplayBuffer is rotated.

fixes lp: #1485070

HWC is able to handle this, but a bit more work is needed (https://trello.com/c/G1dPmg12). For now just reject the optimization.

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

Seems to be consistent with the Mesa implementation now.

I always confuse myself with the function naming. Although the inline documentation explains it, the function name DisplayBuffer::orientation() does little to explain the intended semantics...

    /** Returns the orientation of the display buffer relative to how the
     * user should see it (the orientation of the output).
     * This tells us how much (if any) rotation the renderer needs to do.
     * If your DisplayBuffer can do the rotation itself then this will
     * always return mir_orientation_normal. If the DisplayBuffer does not
     * implement the rotation itself then this function will return the
     * amount of rotation the renderer must do to make things "look right".
     */
    virtual MirOrientation orientation() const = 0;

My fault.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/android/server/display_buffer.cpp'
2--- src/platforms/android/server/display_buffer.cpp 2015-06-24 08:17:02 +0000
3+++ src/platforms/android/server/display_buffer.cpp 2015-08-14 18:31:31 +0000
4@@ -80,7 +80,9 @@
5
6 bool mga::DisplayBuffer::post_renderables_if_optimizable(RenderableList const& renderlist)
7 {
8- if (!overlay_enabled || !display_device->compatible_renderlist(renderlist))
9+ if (!overlay_enabled ||
10+ !display_device->compatible_renderlist(renderlist) ||
11+ orientation_ != mir_orientation_normal)
12 return false;
13
14 layer_list->update_list(renderlist, offset_from_origin);
15
16=== modified file 'tests/unit-tests/graphics/android/test_display_buffer.cpp'
17--- tests/unit-tests/graphics/android/test_display_buffer.cpp 2015-07-21 04:30:03 +0000
18+++ tests/unit-tests/graphics/android/test_display_buffer.cpp 2015-08-14 18:31:31 +0000
19@@ -313,3 +313,18 @@
20 db.configure(mir_power_mode_on, orientation, offset);
21 EXPECT_THAT(db.view_area().top_left, Eq(geom::Point{origin + offset}));
22 }
23+
24+//lp: #1485070. Could alternitvely rotate all the renderables, once rotation is supported
25+TEST_F(DisplayBuffer, rejects_lists_if_db_is_rotated)
26+{
27+ ON_CALL(*mock_display_device, compatible_renderlist(testing::_))
28+ .WillByDefault(testing::Return(true));
29+ mg::RenderableList const renderlist{
30+ std::make_shared<mtd::StubRenderable>(),
31+ std::make_shared<mtd::StubRenderable>()};
32+
33+ db.configure(mir_power_mode_on, mir_orientation_inverted, geom::Displacement{0,0});
34+ EXPECT_FALSE(db.post_renderables_if_optimizable(renderlist));
35+ db.configure(mir_power_mode_on, mir_orientation_normal, geom::Displacement{0,0});
36+ EXPECT_TRUE(db.post_renderables_if_optimizable(renderlist));
37+}

Subscribers

People subscribed via source and target branches