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

Side by Side Diff: cc/trees/occlusion_tracker.cc

Issue 2119043002: cc: Correct inverted directions in occlusion tracker background filter logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment to point out the scale matrix both enne and I missed Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 affected_area_in_target.Intersect(contributing_surface->clip_rect()); 204 affected_area_in_target.Intersect(contributing_surface->clip_rect());
205 } 205 }
206 if (affected_area_in_target.IsEmpty()) 206 if (affected_area_in_target.IsEmpty())
207 return; 207 return;
208 208
209 int outset_top, outset_right, outset_bottom, outset_left; 209 int outset_top, outset_right, outset_bottom, outset_left;
210 contributing_surface->BackgroundFilters().GetOutsets( 210 contributing_surface->BackgroundFilters().GetOutsets(
211 &outset_top, &outset_right, &outset_bottom, &outset_left); 211 &outset_top, &outset_right, &outset_bottom, &outset_left);
212 212
213 // The filter can move pixels from outside of the clip, so allow affected_area 213 // The filter can move pixels from outside of the clip, so allow affected_area
214 // to expand outside the clip. 214 // to expand outside the clip. Notably the content we're concerned with here
215 affected_area_in_target.Inset( 215 // is not the affected area, but rather stuff slightly outside it. Thus the
216 -outset_left, -outset_top, -outset_right, -outset_bottom); 216 // directions of the outsets are reversed from normal.
217 affected_area_in_target.Inset(-outset_right, -outset_bottom, -outset_left,
218 -outset_top);
217 SimpleEnclosedRegion affected_occlusion = *occlusion_from_inside_target; 219 SimpleEnclosedRegion affected_occlusion = *occlusion_from_inside_target;
218 affected_occlusion.Intersect(affected_area_in_target); 220 affected_occlusion.Intersect(affected_area_in_target);
219 221
220 occlusion_from_inside_target->Subtract(affected_area_in_target); 222 occlusion_from_inside_target->Subtract(affected_area_in_target);
221 for (size_t i = 0; i < affected_occlusion.GetRegionComplexity(); ++i) { 223 for (size_t i = 0; i < affected_occlusion.GetRegionComplexity(); ++i) {
222 gfx::Rect occlusion_rect = affected_occlusion.GetRect(i); 224 gfx::Rect occlusion_rect = affected_occlusion.GetRect(i);
223 225
224 // Shrink the rect by expanding the non-opaque pixels outside the rect. 226 // Shrink the rect by expanding the non-opaque pixels outside the rect.
225 227
226 // The left outset of the filters moves pixels on the right side of 228 // The left outset of the filters moves pixels on the right side of
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 DCHECK(layer_tree->RootRenderSurface() == stack_.back().target); 384 DCHECK(layer_tree->RootRenderSurface() == stack_.back().target);
383 const SimpleEnclosedRegion& occluded = 385 const SimpleEnclosedRegion& occluded =
384 stack_.back().occlusion_from_inside_target; 386 stack_.back().occlusion_from_inside_target;
385 Region visible_region(screen_space_clip_rect_); 387 Region visible_region(screen_space_clip_rect_);
386 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) 388 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i)
387 visible_region.Subtract(occluded.GetRect(i)); 389 visible_region.Subtract(occluded.GetRect(i));
388 return visible_region; 390 return visible_region;
389 } 391 }
390 392
391 } // namespace cc 393 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698