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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCDamageTracker.h" | 7 #include "CCDamageTracker.h" |
8 | 8 |
9 #include "CCGeometryTestUtils.h" | 9 #include "CCGeometryTestUtils.h" |
10 #include "CCLayerImpl.h" | 10 #include "CCLayerImpl.h" |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 TEST_F(CCDamageTrackerTest, verifyDamageForEmptyLayerList) | 1089 TEST_F(CCDamageTrackerTest, verifyDamageForEmptyLayerList) |
1090 { | 1090 { |
1091 // Though it should never happen, its a good idea to verify that the damage
tracker | 1091 // Though it should never happen, its a good idea to verify that the damage
tracker |
1092 // does not crash when it receives an empty layerList. | 1092 // does not crash when it receives an empty layerList. |
1093 | 1093 |
1094 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); | 1094 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); |
1095 root->createRenderSurface(); | 1095 root->createRenderSurface(); |
1096 | 1096 |
1097 ASSERT_TRUE(root == root->renderTarget()); | 1097 ASSERT_TRUE(root == root->renderTarget()); |
1098 CCRenderSurface* targetSurface = root->renderSurface(); | 1098 CCRenderSurface* targetSurface = root->renderSurface(); |
1099 targetSurface->clearLayerList(); | 1099 targetSurface->clearLayerLists(); |
1100 targetSurface->damageTracker()->updateDamageTrackingState(targetSurface->lay
erList(), targetSurface->owningLayerId(), false, IntRect(), 0, WebFilterOperatio
ns()); | 1100 targetSurface->damageTracker()->updateDamageTrackingState(targetSurface->lay
erList(), targetSurface->owningLayerId(), false, IntRect(), 0, WebFilterOperatio
ns()); |
1101 | 1101 |
1102 FloatRect damageRect = targetSurface->damageTracker()->currentDamageRect(); | 1102 FloatRect damageRect = targetSurface->damageTracker()->currentDamageRect(); |
1103 EXPECT_TRUE(damageRect.isEmpty()); | 1103 EXPECT_TRUE(damageRect.isEmpty()); |
1104 } | 1104 } |
1105 | 1105 |
1106 TEST_F(CCDamageTrackerTest, verifyDamageAccumulatesUntilReset) | 1106 TEST_F(CCDamageTrackerTest, verifyDamageAccumulatesUntilReset) |
1107 { | 1107 { |
1108 // If damage is not cleared, it should accumulate. | 1108 // If damage is not cleared, it should accumulate. |
1109 | 1109 |
(...skipping 19 matching lines...) Expand all Loading... |
1129 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; | 1129 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; |
1130 EXPECT_TRUE(rootDamageRect.isEmpty()); | 1130 EXPECT_TRUE(rootDamageRect.isEmpty()); |
1131 | 1131 |
1132 // Damage should remain empty even after one frame, since there's yet no new
damage | 1132 // Damage should remain empty even after one frame, since there's yet no new
damage |
1133 emulateDrawingOneFrame(root.get()); | 1133 emulateDrawingOneFrame(root.get()); |
1134 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; | 1134 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; |
1135 EXPECT_TRUE(rootDamageRect.isEmpty()); | 1135 EXPECT_TRUE(rootDamageRect.isEmpty()); |
1136 } | 1136 } |
1137 | 1137 |
1138 } // namespace | 1138 } // namespace |
OLD | NEW |