Commit 994bc2bd authored by yjliu's avatar yjliu Committed by Commit Bot

Fixed: launcher not using backdrop filter cache when appropriate.

Launcher has a backdrop blur filter so when there is no activity, i.e.
damage, under it, the backdrop filter cached result should be used. The
bug was caused by damage accumulation taking into account the damage
from above or on the RP with the backdrop filter.

Change-Id: Ie98f9e4d32ec9f7b955da505276def18590a623d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494060Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: Jun Liu <yjliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821384}
parent de06e38b
...@@ -1401,8 +1401,13 @@ gfx::Rect SurfaceAggregator::PrewalkRenderPass( ...@@ -1401,8 +1401,13 @@ gfx::Rect SurfaceAggregator::PrewalkRenderPass(
rect_in_target_space.Intersects(damage_rect); rect_in_target_space.Intersects(damage_rect);
bool intersects_damage_from_parent = bool intersects_damage_from_parent =
rect_in_target_space.Intersects(damage_from_parent); rect_in_target_space.Intersects(damage_from_parent);
// The |can_use_backdrop_filter_cache| flag hints if the current quad
// intersects any damage from any quads below in the same surface. If the
// flag is false, it means the intersecting damage is from quads above it
// or from itself.
bool intersects_damage_from_surface = bool intersects_damage_from_surface =
rect_in_target_space.Intersects(surface_root_rp_damage); rect_in_target_space.Intersects(surface_root_rp_damage) &&
!render_pass_quad->can_use_backdrop_filter_cache;
if (intersects_current_damage || intersects_damage_from_parent || if (intersects_current_damage || intersects_damage_from_parent ||
intersects_damage_from_surface) { intersects_damage_from_surface) {
render_pass_quad->can_use_backdrop_filter_cache = false; render_pass_quad->can_use_backdrop_filter_cache = false;
......
...@@ -4003,18 +4003,17 @@ TEST_P(SurfaceAggregatorValidSurfaceWithMergingPassesTest, ...@@ -4003,18 +4003,17 @@ TEST_P(SurfaceAggregatorValidSurfaceWithMergingPassesTest,
aggregated_pass_list[AllowMerge() ? 2 : 1]->quad_list.front(); aggregated_pass_list[AllowMerge() ? 2 : 1]->quad_list.front();
const auto* rp_quad = const auto* rp_quad =
AggregatedRenderPassDrawQuad::MaterialCast(quad_to_test); AggregatedRenderPassDrawQuad::MaterialCast(quad_to_test);
// 1) Without merging, the |quad_to_test| (or more precisely, the // 1) Without merging, for the first aggregation, the child surface has
// |output_rect| of the render pass referenced by the quad that's used for // damage from its root render pass (0,0 60x60). |quad_to_test| is on the
// damage intersection test) (0,0 60x60) has damage below from surface root // root render pass of the child surface, so no damage is under it and its
// render pass (0,0 60x60), so its |can_use_backdrop_filter_cache| resets // |can_use_backdrop_filter_cache| remains unchanged (true).
// to false.
// 2) With merging, the |quad_to_test| would be merged to the root pass of // 2) With merging, the |quad_to_test| would be merged to the root pass of
// the root surface. The damage from below (0,0 100x100), which is the total // the root surface. The damage from below (0,0 100x100), which is the total
// of the damage from second surface quad (0,0 80x80) and from root render // of the damage from second surface quad (0,0 80x80) and from root render
// pass (0,0 100x100), is transformed into the local space of the child // pass (0,0 100x100), is transformed into the local space of the child
// surface as (-20,-30 100x100) and it intersects |quad_to_test|(0,0 60x60), // surface as (-20,-30 100x100) and it intersects |quad_to_test|(0,0 60x60),
// so its |can_use_backdrop_filter_cache| resets to false. // so its |can_use_backdrop_filter_cache| resets to false.
EXPECT_FALSE(rp_quad->can_use_backdrop_filter_cache); EXPECT_EQ(!AllowMerge(), rp_quad->can_use_backdrop_filter_cache);
} }
// Resubmit child frame and since there'll be no damage under the RPDQ with // Resubmit child frame and since there'll be no damage under the RPDQ with
......
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