| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return !rs->screen_space_transforms_are_animating(); | 133 return !rs->screen_space_transforms_are_animating(); |
| 134 } | 134 } |
| 135 static inline bool SurfaceTransformsToScreenKnown(const RenderSurfaceImpl* rs) { | 135 static inline bool SurfaceTransformsToScreenKnown(const RenderSurfaceImpl* rs) { |
| 136 return true; | 136 return true; |
| 137 } | 137 } |
| 138 | 138 |
| 139 static inline bool LayerIsInUnsorted3dRenderingContext(const Layer* layer) { | 139 static inline bool LayerIsInUnsorted3dRenderingContext(const Layer* layer) { |
| 140 return layer->Is3dSorted(); | 140 return layer->Is3dSorted(); |
| 141 } | 141 } |
| 142 static inline bool LayerIsInUnsorted3dRenderingContext(const LayerImpl* layer) { | 142 static inline bool LayerIsInUnsorted3dRenderingContext(const LayerImpl* layer) { |
| 143 return false; | 143 return layer->Is3dSorted(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 template <typename LayerType> | 146 template <typename LayerType> |
| 147 static inline bool LayerIsHidden(const LayerType* layer) { | 147 static inline bool LayerIsHidden(const LayerType* layer) { |
| 148 return layer->hide_layer_and_subtree() || | 148 return layer->hide_layer_and_subtree() || |
| 149 (layer->parent() && LayerIsHidden(layer->parent())); | 149 (layer->parent() && LayerIsHidden(layer->parent())); |
| 150 } | 150 } |
| 151 | 151 |
| 152 template <typename LayerType> | 152 template <typename LayerType> |
| 153 void OcclusionTracker<LayerType>::EnterRenderTarget( | 153 void OcclusionTracker<LayerType>::EnterRenderTarget( |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) | 548 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) |
| 549 visible_region.Subtract(occluded.GetRect(i)); | 549 visible_region.Subtract(occluded.GetRect(i)); |
| 550 return visible_region; | 550 return visible_region; |
| 551 } | 551 } |
| 552 | 552 |
| 553 // Instantiate (and export) templates here for the linker. | 553 // Instantiate (and export) templates here for the linker. |
| 554 template class OcclusionTracker<Layer>; | 554 template class OcclusionTracker<Layer>; |
| 555 template class OcclusionTracker<LayerImpl>; | 555 template class OcclusionTracker<LayerImpl>; |
| 556 | 556 |
| 557 } // namespace cc | 557 } // namespace cc |
| OLD | NEW |