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

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

Issue 2080703005: cc: Remove LayerTreeImpl::root_layer usage outside tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « cc/trees/layer_tree_impl_unittest.cc ('k') | cc/trees/property_tree.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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 transformed_rect.Intersect(clip_rect_in_target); 384 transformed_rect.Intersect(clip_rect_in_target);
385 if (transformed_rect.width() < minimum_tracking_size_.width() && 385 if (transformed_rect.width() < minimum_tracking_size_.width() &&
386 transformed_rect.height() < minimum_tracking_size_.height()) 386 transformed_rect.height() < minimum_tracking_size_.height())
387 continue; 387 continue;
388 stack_.back().occlusion_from_inside_target.Union(transformed_rect); 388 stack_.back().occlusion_from_inside_target.Union(transformed_rect);
389 } 389 }
390 } 390 }
391 391
392 Region OcclusionTracker::ComputeVisibleRegionInScreen( 392 Region OcclusionTracker::ComputeVisibleRegionInScreen(
393 const LayerTreeImpl* layer_tree) const { 393 const LayerTreeImpl* layer_tree) const {
394 DCHECK(layer_tree->root_layer()->render_surface() == stack_.back().target); 394 DCHECK(layer_tree->RootRenderSurface() == stack_.back().target);
395 const SimpleEnclosedRegion& occluded = 395 const SimpleEnclosedRegion& occluded =
396 stack_.back().occlusion_from_inside_target; 396 stack_.back().occlusion_from_inside_target;
397 Region visible_region(screen_space_clip_rect_); 397 Region visible_region(screen_space_clip_rect_);
398 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) 398 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i)
399 visible_region.Subtract(occluded.GetRect(i)); 399 visible_region.Subtract(occluded.GetRect(i));
400 return visible_region; 400 return visible_region;
401 } 401 }
402 402
403 } // namespace cc 403 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698