| 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 "cc/animation/layer_animation_controller.h" | 7 #include "cc/animation/layer_animation_controller.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 typedef OcclusionTracker<Layer> OcclusionTrackerType; | 117 typedef OcclusionTracker<Layer> OcclusionTrackerType; |
| 118 | 118 |
| 119 static LayerPtrType CreateLayer(HostType* host) { return Layer::Create(); } | 119 static LayerPtrType CreateLayer(HostType* host) { return Layer::Create(); } |
| 120 static ContentLayerPtrType CreateContentLayer(HostType* host) { | 120 static ContentLayerPtrType CreateContentLayer(HostType* host) { |
| 121 return make_scoped_refptr(new ContentLayerType()); | 121 return make_scoped_refptr(new ContentLayerType()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 template <typename T> | 124 template <typename T> |
| 125 static LayerPtrType PassLayerPtr(T* layer) { | 125 static LayerPtrType PassLayerPtr(T* layer) { |
| 126 LayerPtrType ref(*layer); | 126 LayerPtrType ref(*layer); |
| 127 *layer = NULL; | 127 *layer = nullptr; |
| 128 return ref; | 128 return ref; |
| 129 } | 129 } |
| 130 | 130 |
| 131 static void DestroyLayer(LayerPtrType* layer) { *layer = NULL; } | 131 static void DestroyLayer(LayerPtrType* layer) { *layer = nullptr; } |
| 132 | 132 |
| 133 static void RecursiveUpdateNumChildren(LayerType* layerType) {} | 133 static void RecursiveUpdateNumChildren(LayerType* layerType) {} |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 struct OcclusionTrackerTestImplThreadTypes { | 136 struct OcclusionTrackerTestImplThreadTypes { |
| 137 typedef LayerImpl LayerType; | 137 typedef LayerImpl LayerType; |
| 138 typedef LayerTreeImpl HostType; | 138 typedef LayerTreeImpl HostType; |
| 139 typedef RenderSurfaceImpl RenderSurfaceType; | 139 typedef RenderSurfaceImpl RenderSurfaceType; |
| 140 typedef TestContentLayerImpl ContentLayerType; | 140 typedef TestContentLayerImpl ContentLayerType; |
| 141 typedef scoped_ptr<LayerImpl> LayerPtrType; | 141 typedef scoped_ptr<LayerImpl> LayerPtrType; |
| (...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3301 EXPECT_EQ(gfx::Rect(), | 3301 EXPECT_EQ(gfx::Rect(), |
| 3302 occlusion.UnoccludedSurfaceContentRect( | 3302 occlusion.UnoccludedSurfaceContentRect( |
| 3303 surface, gfx::Rect(80, 70, 50, 50))); | 3303 surface, gfx::Rect(80, 70, 50, 50))); |
| 3304 } | 3304 } |
| 3305 }; | 3305 }; |
| 3306 | 3306 |
| 3307 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 3307 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 3308 | 3308 |
| 3309 } // namespace | 3309 } // namespace |
| 3310 } // namespace cc | 3310 } // namespace cc |
| OLD | NEW |