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/damage_tracker.h" | 5 #include "cc/damage_tracker.h" |
6 | 6 |
7 #include "cc/layer_impl.h" | 7 #include "cc/layer_impl.h" |
8 #include "cc/layer_tree_host_common.h" | 8 #include "cc/layer_tree_host_common.h" |
9 #include "cc/math_util.h" | 9 #include "cc/math_util.h" |
10 #include "cc/single_thread_proxy.h" | 10 #include "cc/single_thread_proxy.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 void executeCalculateDrawProperties(LayerImpl* root, std::vector<LayerImpl*>& re
nderSurfaceLayerList) | 26 void executeCalculateDrawProperties(LayerImpl* root, std::vector<LayerImpl*>& re
nderSurfaceLayerList) |
27 { | 27 { |
28 int dummyMaxTextureSize = 512; | 28 int dummyMaxTextureSize = 512; |
29 | 29 |
30 // Sanity check: The test itself should create the root layer's render surfa
ce, so | 30 // Sanity check: The test itself should create the root layer's render surfa
ce, so |
31 // that the surface (and its damage tracker) can persist acros
s multiple | 31 // that the surface (and its damage tracker) can persist acros
s multiple |
32 // calls to this function. | 32 // calls to this function. |
33 ASSERT_TRUE(root->renderSurface()); | 33 ASSERT_TRUE(root->renderSurface()); |
34 ASSERT_FALSE(renderSurfaceLayerList.size()); | 34 ASSERT_FALSE(renderSurfaceLayerList.size()); |
35 | 35 |
36 LayerTreeHostCommon::calculateDrawProperties(root, root->bounds(), 1, 1, dum
myMaxTextureSize, renderSurfaceLayerList); | 36 LayerTreeHostCommon::calculateDrawProperties(root, root->bounds(), 1, 1, dum
myMaxTextureSize, false, renderSurfaceLayerList); |
37 } | 37 } |
38 | 38 |
39 void clearDamageForAllSurfaces(LayerImpl* layer) | 39 void clearDamageForAllSurfaces(LayerImpl* layer) |
40 { | 40 { |
41 if (layer->renderSurface()) | 41 if (layer->renderSurface()) |
42 layer->renderSurface()->damageTracker()->didDrawDamagedArea(); | 42 layer->renderSurface()->damageTracker()->didDrawDamagedArea(); |
43 | 43 |
44 // Recursively clear damage for any existing surface. | 44 // Recursively clear damage for any existing surface. |
45 for (size_t i = 0; i < layer->children().size(); ++i) | 45 for (size_t i = 0; i < layer->children().size(); ++i) |
46 clearDamageForAllSurfaces(layer->children()[i]); | 46 clearDamageForAllSurfaces(layer->children()[i]); |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 EXPECT_TRUE(rootDamageRect.IsEmpty()); | 1163 EXPECT_TRUE(rootDamageRect.IsEmpty()); |
1164 | 1164 |
1165 // Damage should remain empty even after one frame, since there's yet no new
damage | 1165 // Damage should remain empty even after one frame, since there's yet no new
damage |
1166 emulateDrawingOneFrame(root.get()); | 1166 emulateDrawingOneFrame(root.get()); |
1167 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; | 1167 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; |
1168 EXPECT_TRUE(rootDamageRect.IsEmpty()); | 1168 EXPECT_TRUE(rootDamageRect.IsEmpty()); |
1169 } | 1169 } |
1170 | 1170 |
1171 } // namespace | 1171 } // namespace |
1172 } // namespace cc | 1172 } // namespace cc |
OLD | NEW |