| 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 "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 // These occlusion tests attach and detach layers in multiple | 226 // These occlusion tests attach and detach layers in multiple |
| 227 // iterations, so rebuild property trees every time. | 227 // iterations, so rebuild property trees every time. |
| 228 root->layer_tree_impl()->property_trees()->needs_rebuild = true; | 228 root->layer_tree_impl()->property_trees()->needs_rebuild = true; |
| 229 | 229 |
| 230 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root); | 230 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root); |
| 231 | 231 |
| 232 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 232 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
| 233 root, root->bounds(), &render_surface_layer_list_impl_); | 233 root, root->bounds(), &render_surface_layer_list_impl_); |
| 234 inputs.can_adjust_raster_scales = true; | 234 inputs.can_adjust_raster_scales = true; |
| 235 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 235 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
| 236 | 236 |
| 237 layer_iterator_ = layer_iterator_begin_ = | 237 layer_iterator_ = layer_iterator_begin_ = |
| 238 LayerIterator::Begin(&render_surface_layer_list_impl_); | 238 LayerIterator::Begin(&render_surface_layer_list_impl_); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void EnterLayer(LayerImpl* layer, OcclusionTracker* occlusion) { | 241 void EnterLayer(LayerImpl* layer, OcclusionTracker* occlusion) { |
| 242 ASSERT_EQ(*layer_iterator_, layer); | 242 ASSERT_EQ(*layer_iterator_, layer); |
| 243 ASSERT_TRUE(layer_iterator_.represents_itself()); | 243 ASSERT_TRUE(layer_iterator_.represents_itself()); |
| 244 occlusion->EnterLayer(layer_iterator_); | 244 occlusion->EnterLayer(layer_iterator_); |
| 245 } | 245 } |
| (...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 EXPECT_EQ(gfx::Rect(), | 2514 EXPECT_EQ(gfx::Rect(), |
| 2515 occlusion.UnoccludedSurfaceContentRect( | 2515 occlusion.UnoccludedSurfaceContentRect( |
| 2516 surface, gfx::Rect(80, 70, 50, 50))); | 2516 surface, gfx::Rect(80, 70, 50, 50))); |
| 2517 } | 2517 } |
| 2518 }; | 2518 }; |
| 2519 | 2519 |
| 2520 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2520 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2521 | 2521 |
| 2522 } // namespace | 2522 } // namespace |
| 2523 } // namespace cc | 2523 } // namespace cc |
| OLD | NEW |