OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/damage_tracker.h" | 5 #include "cc/trees/damage_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/base/filter_operation.h" | 9 #include "cc/base/filter_operation.h" |
10 #include "cc/base/filter_operations.h" | 10 #include "cc/base/filter_operations.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace { | 26 namespace { |
27 | 27 |
28 void ExecuteCalculateDrawProperties(LayerImpl* root, | 28 void ExecuteCalculateDrawProperties(LayerImpl* root, |
29 float device_scale_factor, | 29 float device_scale_factor, |
30 LayerImplList* render_surface_layer_list) { | 30 LayerImplList* render_surface_layer_list) { |
31 // Sanity check: The test itself should create the root layer's render | 31 // Sanity check: The test itself should create the root layer's render |
32 // surface, so that the surface (and its damage tracker) can | 32 // surface, so that the surface (and its damage tracker) can |
33 // persist across multiple calls to this function. | 33 // persist across multiple calls to this function. |
34 ASSERT_FALSE(render_surface_layer_list->size()); | 34 ASSERT_FALSE(render_surface_layer_list->size()); |
35 | 35 |
36 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root); | |
37 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 36 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
38 root, root->bounds(), device_scale_factor, render_surface_layer_list); | 37 root, root->bounds(), device_scale_factor, render_surface_layer_list); |
39 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); | 38 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
40 ASSERT_TRUE(root->GetRenderSurface()); | 39 ASSERT_TRUE(root->GetRenderSurface()); |
41 } | 40 } |
42 | 41 |
43 void ClearDamageForAllSurfaces(LayerImpl* root) { | 42 void ClearDamageForAllSurfaces(LayerImpl* root) { |
44 for (auto* layer : *root->layer_tree_impl()) { | 43 for (auto* layer : *root->layer_tree_impl()) { |
45 if (layer->GetRenderSurface()) | 44 if (layer->GetRenderSurface()) |
46 layer->GetRenderSurface()->damage_tracker()->DidDrawDamagedArea(); | 45 layer->GetRenderSurface()->damage_tracker()->DidDrawDamagedArea(); |
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 ASSERT_TRUE(root->GetRenderSurface()->damage_tracker()->GetDamageRectIfValid( | 1691 ASSERT_TRUE(root->GetRenderSurface()->damage_tracker()->GetDamageRectIfValid( |
1693 &damage_rect)); | 1692 &damage_rect)); |
1694 EXPECT_TRUE(damage_rect.Contains(root->GetRenderSurface()->content_rect())); | 1693 EXPECT_TRUE(damage_rect.Contains(root->GetRenderSurface()->content_rect())); |
1695 EXPECT_TRUE(damage_rect.Contains( | 1694 EXPECT_TRUE(damage_rect.Contains( |
1696 gfx::ToEnclosingRect(child1->GetRenderSurface()->DrawableContentRect()))); | 1695 gfx::ToEnclosingRect(child1->GetRenderSurface()->DrawableContentRect()))); |
1697 EXPECT_EQ(damage_rect, root->GetRenderSurface()->GetDamageRect()); | 1696 EXPECT_EQ(damage_rect, root->GetRenderSurface()->GetDamageRect()); |
1698 } | 1697 } |
1699 | 1698 |
1700 } // namespace | 1699 } // namespace |
1701 } // namespace cc | 1700 } // namespace cc |
OLD | NEW |