Commit ea75328d authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Fixed underlay Z order for multiple underlay layers.

The z order of an underlay should be a decreasing number for each
underlay layer at the bottom. It doesn't have to be a contiguous
number though.

Bug: 868561
Change-Id: I3ba9afbd9f02404ca23f416a464f18c30771b962
Reviewed-on: https://chromium-review.googlesource.com/c/1488151
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635870}
parent 6b12172c
......@@ -494,10 +494,10 @@ void DCLayerOverlayProcessor::ProcessForUnderlay(
gfx::Rect* this_frame_underlay_rect,
gfx::Rect* this_frame_underlay_occlusion,
DCLayerOverlay* dc_layer) {
// TODO(magchen): Assign decreasing z-order so that underlays processed
// earlier, and hence which are above the subsequent underlays, are placed
// above in the direct composition visual tree.
dc_layer->z_order = -1;
// Assign decreasing z-order so that underlays processed earlier, and hence
// which are above the subsequent underlays, are placed above in the direct
// composition visual tree.
dc_layer->z_order = -1 - current_frame_processed_overlay_count_;
const SharedQuadState* shared_quad_state = it->shared_quad_state;
gfx::Rect rect = it->visible_rect;
......
......@@ -2411,7 +2411,8 @@ TEST_F(DCLayerOverlayTest, Occluded) {
EXPECT_EQ(0U, overlay_list.size());
EXPECT_EQ(2U, dc_layer_list.size());
EXPECT_EQ(0U, output_surface_->bind_framebuffer_count());
EXPECT_EQ(-1, dc_layer_list.back().z_order);
EXPECT_EQ(-1, dc_layer_list.front().z_order);
EXPECT_EQ(-2, dc_layer_list.back().z_order);
// Entire underlay rect must be redrawn.
EXPECT_EQ(gfx::Rect(0, 0, 256, 256), damage_rect_);
}
......@@ -2446,7 +2447,8 @@ TEST_F(DCLayerOverlayTest, Occluded) {
EXPECT_EQ(0U, overlay_list.size());
EXPECT_EQ(2U, dc_layer_list.size());
EXPECT_EQ(0U, output_surface_->bind_framebuffer_count());
EXPECT_EQ(-1, dc_layer_list.back().z_order);
EXPECT_EQ(-1, dc_layer_list.front().z_order);
EXPECT_EQ(-2, dc_layer_list.back().z_order);
// The underlay rectangle is the same, so the damage for first video quad is
// contained within the combined occluding rects for this and the last
// frame. Second video quad also adds its damage.
......
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