Index: cc/trees/damage_tracker_unittest.cc |
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc |
index 949baa2fe94275bfbacba1744487a652e7b970ff..d456b6a933c445f6ad8a82228fd627d40bd77c7a 100644 |
--- a/cc/trees/damage_tracker_unittest.cc |
+++ b/cc/trees/damage_tracker_unittest.cc |
@@ -44,7 +44,7 @@ void ClearDamageForAllSurfaces(LayerImpl* layer) { |
// Recursively clear damage for any existing surface. |
for (size_t i = 0; i < layer->children().size(); ++i) |
- ClearDamageForAllSurfaces(layer->children()[i]); |
+ ClearDamageForAllSurfaces(layer->children()[i].get()); |
} |
void EmulateDrawingOneFrame(LayerImpl* root) { |
@@ -202,8 +202,8 @@ TEST_F(DamageTrackerTest, SanityCheckTestTreeWithTwoSurfaces) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* child2 = root->children()[1]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* child2 = root->children()[1].get(); |
gfx::Rect child_damage_rect = |
child1->render_surface()->damage_tracker()->current_damage_rect(); |
gfx::Rect root_damage_rect = |
@@ -223,7 +223,7 @@ TEST_F(DamageTrackerTest, SanityCheckTestTreeWithTwoSurfaces) { |
TEST_F(DamageTrackerTest, VerifyDamageForUpdateRects) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
// CASE 1: Setting the update rect should cause the corresponding damage to |
// the surface. |
@@ -263,7 +263,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForUpdateRects) { |
TEST_F(DamageTrackerTest, VerifyDamageForLayerDamageRects) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
// CASE 1: Adding the layer damage rect should cause the corresponding damage |
// to the surface. |
@@ -315,7 +315,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForLayerDamageRects) { |
TEST_F(DamageTrackerTest, VerifyDamageForLayerUpdateAndDamageRects) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
// CASE 1: Adding the layer damage rect and update rect should cause the |
// corresponding damage to the surface. |
@@ -357,7 +357,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForLayerUpdateAndDamageRects) { |
TEST_F(DamageTrackerTest, VerifyDamageForPropertyChanges) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
// CASE 1: The layer's property changed flag takes priority over update rect. |
// |
@@ -406,7 +406,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForTransformedLayer) { |
// transformed layer. |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
gfx::Transform rotation; |
rotation.Rotate(45.0); |
@@ -456,7 +456,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForPerspectiveClippedLayer) { |
// |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
gfx::Transform transform; |
transform.Translate3d(500.0, 500.0, 0.0); |
@@ -493,8 +493,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForPerspectiveClippedLayer) { |
TEST_F(DamageTrackerTest, VerifyDamageForBlurredSurface) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* surface = root->children()[0]; |
- LayerImpl* child = surface->children()[0]; |
+ LayerImpl* surface = root->children()[0].get(); |
+ LayerImpl* child = surface->children()[0].get(); |
FilterOperations filters; |
filters.Append(FilterOperation::CreateBlurFilter(5.f)); |
@@ -527,7 +527,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForBlurredSurface) { |
TEST_F(DamageTrackerTest, VerifyDamageForImageFilter) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
gfx::Rect root_damage_rect, child_damage_rect; |
// Allow us to set damage on child too. |
@@ -580,8 +580,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForImageFilter) { |
TEST_F(DamageTrackerTest, VerifyDamageForBackgroundBlurredChild) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* child2 = root->children()[1]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* child2 = root->children()[1].get(); |
// Allow us to set damage on child1 too. |
child1->SetDrawsContent(true); |
@@ -707,7 +707,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForBackgroundBlurredChild) { |
TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingLayer) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child1 = root->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
// CASE 1: Adding a new layer should cause the appropriate damage. |
// |
@@ -787,7 +787,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) { |
TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child1 = root->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
// In this test we don't want the above tree manipulation to be considered |
// part of the same frame. |
@@ -800,7 +800,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) { |
child2->SetDrawsContent(true); |
root->AddChild(child2.Pass()); |
} |
- LayerImpl* child2 = root->children()[1]; |
+ LayerImpl* child2 = root->children()[1].get(); |
EmulateDrawingOneFrame(root.get()); |
// Damaging two layers simultaneously should cause combined damage. |
@@ -818,9 +818,9 @@ TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) { |
TEST_F(DamageTrackerTest, VerifyDamageForNestedSurfaces) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* child2 = root->children()[1]; |
- LayerImpl* grand_child1 = root->children()[0]->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* child2 = root->children()[1].get(); |
+ LayerImpl* grand_child1 = root->children()[0]->children()[0].get(); |
gfx::Rect child_damage_rect; |
gfx::Rect root_damage_rect; |
@@ -864,8 +864,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromDescendantLayer) { |
// entire surface should be marked dirty. |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* grand_child1 = root->children()[0]->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* grand_child1 = root->children()[0]->children()[0].get(); |
gfx::Rect child_damage_rect; |
gfx::Rect root_damage_rect; |
@@ -902,7 +902,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromAncestorLayer) { |
// transforming it, while the root surface would be damaged appropriately. |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
gfx::Rect child_damage_rect; |
gfx::Rect root_damage_rect; |
@@ -928,7 +928,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromAncestorLayer) { |
TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingRenderSurfaces) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
gfx::Rect child_damage_rect; |
gfx::Rect root_damage_rect; |
@@ -981,7 +981,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingRenderSurfaces) { |
TEST_F(DamageTrackerTest, VerifyNoDamageWhenNothingChanged) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
gfx::Rect child_damage_rect; |
gfx::Rect root_damage_rect; |
@@ -1011,7 +1011,7 @@ TEST_F(DamageTrackerTest, VerifyNoDamageWhenNothingChanged) { |
TEST_F(DamageTrackerTest, VerifyNoDamageForUpdateRectThatDoesNotDrawContent) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
gfx::Rect child_damage_rect; |
gfx::Rect root_damage_rect; |
@@ -1030,9 +1030,9 @@ TEST_F(DamageTrackerTest, VerifyNoDamageForUpdateRectThatDoesNotDrawContent) { |
TEST_F(DamageTrackerTest, VerifyDamageForReplica) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* grand_child1 = child1->children()[0]; |
- LayerImpl* grand_child2 = child1->children()[1]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* grand_child1 = child1->children()[0].get(); |
+ LayerImpl* grand_child2 = child1->children()[1].get(); |
// Damage on a surface that has a reflection should cause the target surface |
// to receive the surface's damage and the surface's reflected damage. |
@@ -1134,7 +1134,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplica) { |
TEST_F(DamageTrackerTest, VerifyDamageForMask) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
// In the current implementation of the damage tracker, changes to mask |
// layers should damage the entire corresponding surface. |
@@ -1220,8 +1220,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) { |
TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* grand_child1 = child1->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* grand_child1 = child1->children()[0].get(); |
// Changes to a replica's mask should not damage the original surface, |
// because it is not masked. But it does damage the ancestor target surface. |
@@ -1289,8 +1289,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) { |
TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithTwoSurfaces(); |
- LayerImpl* child1 = root->children()[0]; |
- LayerImpl* grand_child1 = child1->children()[0]; |
+ LayerImpl* child1 = root->children()[0].get(); |
+ LayerImpl* grand_child1 = child1->children()[0].get(); |
// Verify that the correct replica_origin_transform is used for the |
// replica_mask. |
@@ -1348,7 +1348,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) { |
TEST_F(DamageTrackerTest, DamageWhenAddedExternally) { |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
// Case 1: This test ensures that when the tracker is given damage, that |
// it is included with any other partial damage. |
@@ -1405,7 +1405,7 @@ TEST_F(DamageTrackerTest, VerifyDamageAccumulatesUntilReset) { |
// If damage is not cleared, it should accumulate. |
scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
ClearDamageForAllSurfaces(root.get()); |
child->SetUpdateRect(gfx::Rect(10.f, 11.f, 1.f, 2.f)); |
@@ -1449,7 +1449,7 @@ TEST_F(DamageTrackerTest, HugeDamageRect) { |
for (int i = 0; i < kRange; ++i) { |
scoped_ptr<LayerImpl> root = CreateTestTreeWithOneSurface(); |
- LayerImpl* child = root->children()[0]; |
+ LayerImpl* child = root->children()[0].get(); |
gfx::Transform transform; |
transform.Translate(-kBigNumber, -kBigNumber); |