Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2242)

Unified Diff: cc/trees/occlusion_tracker.cc

Issue 2892073002: cc: Correct inverted directions in occlusion tracker background filter logic (Closed)
Patch Set: nits Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/occlusion_tracker.cc
diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc
index 523b01f830f4a52408dbfb401a4f82ccbdaa4197..8aa513bfe1775686c25bf2fc20bd292a60d5313e 100644
--- a/cc/trees/occlusion_tracker.cc
+++ b/cc/trees/occlusion_tracker.cc
@@ -221,16 +221,17 @@ static void ReduceOcclusionBelowSurface(
if (affected_area_in_target.IsEmpty())
return;
+ // The filter's bounds for asymmetric filters (ex: drop shadow) are
+ // relative to the target surface, which moves the pixels from outside of the
+ // clip to the filtered surface. As a result, |affected_area| needs to expand.
+ // Since we are concerned with the target surface, we need to swap the outsets
+ // before applying them to the filtered surface bounds.
int outset_top, outset_right, outset_bottom, outset_left;
contributing_surface->BackgroundFilters().GetOutsets(
- &outset_top, &outset_right, &outset_bottom, &outset_left);
-
- // The filter can move pixels from outside of the clip, so allow affected_area
- // to expand outside the clip. Notably the content we're concerned with here
- // is not the affected area, but rather stuff slightly outside it. Thus the
- // directions of the outsets are reversed from normal.
- affected_area_in_target.Inset(-outset_right, -outset_bottom, -outset_left,
- -outset_top);
+ &outset_bottom, &outset_left, &outset_top, &outset_right);
+
+ affected_area_in_target.Inset(-outset_left, -outset_top, -outset_right,
+ -outset_bottom);
SimpleEnclosedRegion affected_occlusion = *occlusion_from_inside_target;
affected_occlusion.Intersect(affected_area_in_target);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698