Commit 4ed711ac authored by dcastagna's avatar dcastagna Committed by Commit bot

cc: Fullscreen overlay removes all the other quads/planes.

OverlayStrategyFullscreen used to promote a quad to an overlay
finding a suitable quad, removing it from the quad_list and
pushing the overlay candidate to the list of overlay candidates.

This behavior was relying on ozone optimization that would
replace the primary plane if there were a fullscreen overlay
on top of it.

This CLs changes OverlayStrategyFullscreen behavior making it more
aggressive.
Once a quad that can be promoted is found, quad_list is erased since
all the quads are either not visible, or covered by the fullscreen
overlay, or the fullscreen overlay itself.

It also clear the overlay_list, that contains the primary buffer,
since the promoted overlay will be replacing it, in this way
we stop relying on the ozone optimization.

BUG=b/29430506
TEST=cc_unittests --gtest_filter="*FullscreenOverlayTest*", also tried it on minnie.
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2281033003
Cr-Commit-Position: refs/heads/master@{#414830}
parent a589940c
......@@ -48,10 +48,12 @@ bool OverlayStrategyFullscreen::Attempt(ResourceProvider* resource_provider,
return false;
}
candidate.plane_z_order = 1;
candidate.plane_z_order = 0;
candidate.overlay_handled = true;
candidate_list->push_back(candidate);
quad_list->EraseAndInvalidateAllPointers(front);
OverlayCandidateList new_candidate_list;
new_candidate_list.push_back(candidate);
candidate_list->swap(new_candidate_list);
render_pass->quad_list = QuadList(); // Remove all the quads
return true;
}
......
......@@ -423,10 +423,12 @@ TEST_F(FullscreenOverlayTest, SuccessfulOverlay) {
ASSERT_EQ(1U, candidate_list.size());
RenderPass* main_pass = pass.get();
// Check that the quad is gone.
EXPECT_EQ(1U, main_pass->quad_list.size());
// Check that all the quads are gone.
EXPECT_EQ(0U, main_pass->quad_list.size());
// Check that we have only one overlay.
EXPECT_EQ(1U, candidate_list.size());
// Check that the right resource id got extracted.
EXPECT_EQ(original_resource_id, candidate_list.back().resource_id);
EXPECT_EQ(original_resource_id, candidate_list.front().resource_id);
}
TEST_F(FullscreenOverlayTest, ResourceSizeInPixelsFail) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment