| 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/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 // leftover from the previous case. | 1202 // leftover from the previous case. |
| 1203 ClearDamageForAllSurfaces(root.get()); | 1203 ClearDamageForAllSurfaces(root.get()); |
| 1204 EmulateDrawingOneFrame(root.get()); | 1204 EmulateDrawingOneFrame(root.get()); |
| 1205 child_damage_rect = | 1205 child_damage_rect = |
| 1206 child->render_surface()->damage_tracker()->current_damage_rect(); | 1206 child->render_surface()->damage_tracker()->current_damage_rect(); |
| 1207 EXPECT_TRUE(child_damage_rect.IsEmpty()); | 1207 EXPECT_TRUE(child_damage_rect.IsEmpty()); |
| 1208 | 1208 |
| 1209 // Then test mask removal. | 1209 // Then test mask removal. |
| 1210 ClearDamageForAllSurfaces(root.get()); | 1210 ClearDamageForAllSurfaces(root.get()); |
| 1211 child->SetMaskLayer(nullptr); | 1211 child->SetMaskLayer(nullptr); |
| 1212 child->NoteLayerPropertyChanged(); |
| 1212 ASSERT_TRUE(child->LayerPropertyChanged()); | 1213 ASSERT_TRUE(child->LayerPropertyChanged()); |
| 1213 EmulateDrawingOneFrame(root.get()); | 1214 EmulateDrawingOneFrame(root.get()); |
| 1214 | 1215 |
| 1215 // Sanity check that a render surface still exists. | 1216 // Sanity check that a render surface still exists. |
| 1216 ASSERT_TRUE(child->render_surface()); | 1217 ASSERT_TRUE(child->render_surface()); |
| 1217 | 1218 |
| 1218 child_damage_rect = | 1219 child_damage_rect = |
| 1219 child->render_surface()->damage_tracker()->current_damage_rect(); | 1220 child->render_surface()->damage_tracker()->current_damage_rect(); |
| 1220 EXPECT_EQ(gfx::Rect(30, 30).ToString(), child_damage_rect.ToString()); | 1221 EXPECT_EQ(gfx::Rect(30, 30).ToString(), child_damage_rect.ToString()); |
| 1221 } | 1222 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 gfx::Rect root_damage_rect = | 1470 gfx::Rect root_damage_rect = |
| 1470 root->render_surface()->damage_tracker()->current_damage_rect(); | 1471 root->render_surface()->damage_tracker()->current_damage_rect(); |
| 1471 gfx::Rect damage_we_care_about = gfx::Rect(i, i); | 1472 gfx::Rect damage_we_care_about = gfx::Rect(i, i); |
| 1472 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); | 1473 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); |
| 1473 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); | 1474 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); |
| 1474 } | 1475 } |
| 1475 } | 1476 } |
| 1476 | 1477 |
| 1477 } // namespace | 1478 } // namespace |
| 1478 } // namespace cc | 1479 } // namespace cc |
| OLD | NEW |