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 "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "cc/layers/layer_impl.h" | 8 #include "cc/layers/layer_impl.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // persist across multiple calls to this function. | 33 // persist across multiple calls to this function. |
34 ASSERT_TRUE(root->render_surface()); | 34 ASSERT_TRUE(root->render_surface()); |
35 ASSERT_FALSE(render_surface_layer_list.size()); | 35 ASSERT_FALSE(render_surface_layer_list.size()); |
36 | 36 |
37 LayerTreeHostCommon::CalculateDrawProperties(root, | 37 LayerTreeHostCommon::CalculateDrawProperties(root, |
38 root->bounds(), | 38 root->bounds(), |
39 1.f, | 39 1.f, |
40 1.f, | 40 1.f, |
41 dummy_max_texture_size, | 41 dummy_max_texture_size, |
42 false, | 42 false, |
43 &render_surface_layer_list, | 43 &render_surface_layer_list); |
44 false); | |
45 } | 44 } |
46 | 45 |
47 void ClearDamageForAllSurfaces(LayerImpl* layer) { | 46 void ClearDamageForAllSurfaces(LayerImpl* layer) { |
48 if (layer->render_surface()) | 47 if (layer->render_surface()) |
49 layer->render_surface()->damage_tracker()->DidDrawDamagedArea(); | 48 layer->render_surface()->damage_tracker()->DidDrawDamagedArea(); |
50 | 49 |
51 // Recursively clear damage for any existing surface. | 50 // Recursively clear damage for any existing surface. |
52 for (size_t i = 0; i < layer->children().size(); ++i) | 51 for (size_t i = 0; i < layer->children().size(); ++i) |
53 ClearDamageForAllSurfaces(layer->children()[i]); | 52 ClearDamageForAllSurfaces(layer->children()[i]); |
54 } | 53 } |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // Damage should remain empty even after one frame, since there's yet no new | 1349 // Damage should remain empty even after one frame, since there's yet no new |
1351 // damage. | 1350 // damage. |
1352 EmulateDrawingOneFrame(root.get()); | 1351 EmulateDrawingOneFrame(root.get()); |
1353 root_damage_rect = | 1352 root_damage_rect = |
1354 root->render_surface()->damage_tracker()->current_damage_rect(); | 1353 root->render_surface()->damage_tracker()->current_damage_rect(); |
1355 EXPECT_TRUE(root_damage_rect.IsEmpty()); | 1354 EXPECT_TRUE(root_damage_rect.IsEmpty()); |
1356 } | 1355 } |
1357 | 1356 |
1358 } // namespace | 1357 } // namespace |
1359 } // namespace cc | 1358 } // namespace cc |
OLD | NEW |