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/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return !rs->screen_space_transforms_are_animating(); | 148 return !rs->screen_space_transforms_are_animating(); |
149 } | 149 } |
150 static inline bool SurfaceTransformsToScreenKnown(const RenderSurfaceImpl* rs) { | 150 static inline bool SurfaceTransformsToScreenKnown(const RenderSurfaceImpl* rs) { |
151 return true; | 151 return true; |
152 } | 152 } |
153 | 153 |
154 static inline bool LayerIsInUnsorted3dRenderingContext(const Layer* layer) { | 154 static inline bool LayerIsInUnsorted3dRenderingContext(const Layer* layer) { |
155 return layer->Is3dSorted(); | 155 return layer->Is3dSorted(); |
156 } | 156 } |
157 static inline bool LayerIsInUnsorted3dRenderingContext(const LayerImpl* layer) { | 157 static inline bool LayerIsInUnsorted3dRenderingContext(const LayerImpl* layer) { |
158 return false; | 158 return layer->Is3dSorted(); |
159 } | 159 } |
160 | 160 |
161 template <typename LayerType> | 161 template <typename LayerType> |
162 static inline bool LayerIsHidden(const LayerType* layer) { | 162 static inline bool LayerIsHidden(const LayerType* layer) { |
163 return layer->hide_layer_and_subtree() || | 163 return layer->hide_layer_and_subtree() || |
164 (layer->parent() && LayerIsHidden(layer->parent())); | 164 (layer->parent() && LayerIsHidden(layer->parent())); |
165 } | 165 } |
166 | 166 |
167 template <typename LayerType> | 167 template <typename LayerType> |
168 void OcclusionTracker<LayerType>::EnterRenderTarget( | 168 void OcclusionTracker<LayerType>::EnterRenderTarget( |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) | 477 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) |
478 visible_region.Subtract(occluded.GetRect(i)); | 478 visible_region.Subtract(occluded.GetRect(i)); |
479 return visible_region; | 479 return visible_region; |
480 } | 480 } |
481 | 481 |
482 // Instantiate (and export) templates here for the linker. | 482 // Instantiate (and export) templates here for the linker. |
483 template class OcclusionTracker<Layer>; | 483 template class OcclusionTracker<Layer>; |
484 template class OcclusionTracker<LayerImpl>; | 484 template class OcclusionTracker<LayerImpl>; |
485 | 485 |
486 } // namespace cc | 486 } // namespace cc |
OLD | NEW |