| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |