| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/debug/overdraw_metrics.h" | |
| 11 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| 12 #include "cc/layers/layer_impl.h" | 11 #include "cc/layers/layer_impl.h" |
| 13 #include "cc/layers/render_surface.h" | 12 #include "cc/layers/render_surface.h" |
| 14 #include "cc/layers/render_surface_impl.h" | 13 #include "cc/layers/render_surface_impl.h" |
| 15 #include "ui/gfx/quad_f.h" | 14 #include "ui/gfx/quad_f.h" |
| 16 #include "ui/gfx/rect_conversions.h" | 15 #include "ui/gfx/rect_conversions.h" |
| 17 | 16 |
| 18 namespace cc { | 17 namespace cc { |
| 19 | 18 |
| 20 template <typename LayerType> | 19 template <typename LayerType> |
| 21 OcclusionTracker<LayerType>::OcclusionTracker( | 20 OcclusionTracker<LayerType>::OcclusionTracker( |
| 22 const gfx::Rect& screen_space_clip_rect, | 21 const gfx::Rect& screen_space_clip_rect) |
| 23 bool record_metrics_for_frame) | |
| 24 : screen_space_clip_rect_(screen_space_clip_rect), | 22 : screen_space_clip_rect_(screen_space_clip_rect), |
| 25 overdraw_metrics_(OverdrawMetrics::Create(record_metrics_for_frame)), | |
| 26 occluding_screen_space_rects_(NULL), | 23 occluding_screen_space_rects_(NULL), |
| 27 non_occluding_screen_space_rects_(NULL) {} | 24 non_occluding_screen_space_rects_(NULL) {} |
| 28 | 25 |
| 29 template <typename LayerType> | 26 template <typename LayerType> |
| 30 OcclusionTracker<LayerType>::~OcclusionTracker() {} | 27 OcclusionTracker<LayerType>::~OcclusionTracker() {} |
| 31 | 28 |
| 32 template <typename LayerType> | 29 template <typename LayerType> |
| 33 void OcclusionTracker<LayerType>::EnterLayer( | 30 void OcclusionTracker<LayerType>::EnterLayer( |
| 34 const LayerIteratorPosition<LayerType>& layer_iterator) { | 31 const LayerIteratorPosition<LayerType>& layer_iterator) { |
| 35 LayerType* render_target = layer_iterator.target_render_surface_layer; | 32 LayerType* render_target = layer_iterator.target_render_surface_layer; |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 unoccluded_rect.Intersect(content_rect); | 657 unoccluded_rect.Intersect(content_rect); |
| 661 | 658 |
| 662 return unoccluded_rect; | 659 return unoccluded_rect; |
| 663 } | 660 } |
| 664 | 661 |
| 665 // Instantiate (and export) templates here for the linker. | 662 // Instantiate (and export) templates here for the linker. |
| 666 template class OcclusionTracker<Layer>; | 663 template class OcclusionTracker<Layer>; |
| 667 template class OcclusionTracker<LayerImpl>; | 664 template class OcclusionTracker<LayerImpl>; |
| 668 | 665 |
| 669 } // namespace cc | 666 } // namespace cc |
| OLD | NEW |