Mir

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

Proposed by Daniel van Vugt
Status: Merged
Approved by: Chris Halse Rogers
Approved revision: no longer in the source branch.
Merged at revision: 1523
Proposed branch: lp:~vanvugt/mir/fix-1301115
Merge into: lp:mir
Diff against target: 35 lines (+13/-1)
2 files modified
src/server/compositor/occlusion.cpp (+1/-1)
tests/unit-tests/compositor/test_occlusion.cpp (+12/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1301115
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Chris Halse Rogers Approve
Review via email: mp+213757@code.launchpad.net

Commit message

Ensure partially-offscreen surfaces are not culled as if they were fully
off screen (LP: #1301115)

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

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

Seems simple enough to top-approve with one approval.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/compositor/occlusion.cpp'
2--- src/server/compositor/occlusion.cpp 2014-04-01 20:39:59 +0000
3+++ src/server/compositor/occlusion.cpp 2014-04-02 03:15:07 +0000
4@@ -41,7 +41,7 @@
5 return true; //invisible; definitely occluded.
6
7 // Not weirdly transformed but also not on this monitor? Don't care...
8- if (!area.contains(renderable.screen_position()))
9+ if (!area.overlaps(renderable.screen_position()))
10 return true; // Not on the display; definitely occluded.
11
12 bool occluded = false;
13
14=== modified file 'tests/unit-tests/compositor/test_occlusion.cpp'
15--- tests/unit-tests/compositor/test_occlusion.cpp 2014-03-28 20:25:41 +0000
16+++ tests/unit-tests/compositor/test_occlusion.cpp 2014-04-02 03:15:07 +0000
17@@ -50,6 +50,18 @@
18 EXPECT_EQ(window, list.front());
19 }
20
21+TEST_F(OcclusionFilterTest, partially_offscreen_still_visible)
22+{ // Regression test for LP: #1301115
23+ auto left = std::make_shared<mtd::FakeRenderable>(-10, 10, 100, 100);
24+ auto right = std::make_shared<mtd::FakeRenderable>(1900, 10, 100, 100);
25+ auto top = std::make_shared<mtd::FakeRenderable>(500, -1, 100, 100);
26+ auto bottom = std::make_shared<mtd::FakeRenderable>(200, 1000, 100, 1000);
27+ mg::RenderableList list{left, right, top, bottom};
28+
29+ filter_occlusions_from(list, monitor_rect);
30+ EXPECT_EQ(4u, list.size());
31+}
32+
33 TEST_F(OcclusionFilterTest, smaller_window_occluded)
34 {
35 auto top = std::make_shared<mtd::FakeRenderable>(10, 10, 10, 10);

Subscribers

People subscribed via source and target branches