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/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/base/filter_operation.h" | 10 #include "cc/base/filter_operation.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 void CalcDrawEtc(TestContentLayerImpl* root) { | 211 void CalcDrawEtc(TestContentLayerImpl* root) { |
212 root->layer_tree_impl()->BuildLayerListForTesting(); | 212 root->layer_tree_impl()->BuildLayerListForTesting(); |
213 DCHECK(root == root->layer_tree_impl()->root_layer_for_testing()); | 213 DCHECK(root == root->layer_tree_impl()->root_layer_for_testing()); |
214 | 214 |
215 // These occlusion tests attach and detach layers in multiple | 215 // These occlusion tests attach and detach layers in multiple |
216 // iterations, so rebuild property trees every time. | 216 // iterations, so rebuild property trees every time. |
217 root->layer_tree_impl()->property_trees()->needs_rebuild = true; | 217 root->layer_tree_impl()->property_trees()->needs_rebuild = true; |
218 | 218 |
219 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root); | |
220 | |
221 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 219 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
222 root, root->bounds(), &render_surface_layer_list_impl_); | 220 root, root->bounds(), &render_surface_layer_list_impl_); |
223 inputs.can_adjust_raster_scales = true; | 221 inputs.can_adjust_raster_scales = true; |
224 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); | 222 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
225 | 223 |
226 layer_iterator_ = layer_iterator_begin_ = | 224 layer_iterator_ = layer_iterator_begin_ = |
227 LayerIterator::Begin(&render_surface_layer_list_impl_); | 225 LayerIterator::Begin(&render_surface_layer_list_impl_); |
228 } | 226 } |
229 | 227 |
230 void EnterLayer(LayerImpl* layer, OcclusionTracker* occlusion) { | 228 void EnterLayer(LayerImpl* layer, OcclusionTracker* occlusion) { |
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2425 EXPECT_EQ(gfx::Rect(), | 2423 EXPECT_EQ(gfx::Rect(), |
2426 occlusion.UnoccludedSurfaceContentRect( | 2424 occlusion.UnoccludedSurfaceContentRect( |
2427 surface, gfx::Rect(80, 70, 50, 50))); | 2425 surface, gfx::Rect(80, 70, 50, 50))); |
2428 } | 2426 } |
2429 }; | 2427 }; |
2430 | 2428 |
2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2429 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
2432 | 2430 |
2433 } // namespace | 2431 } // namespace |
2434 } // namespace cc | 2432 } // namespace cc |
OLD | NEW |