| Index: cc/trees/damage_tracker_unittest.cc
|
| diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc
|
| index abb0369a874d73a4a27f87880195c8be68ca5f7e..4dd597d0a9d06fbab1c01d241858d8f7081f764e 100644
|
| --- a/cc/trees/damage_tracker_unittest.cc
|
| +++ b/cc/trees/damage_tracker_unittest.cc
|
| @@ -48,7 +48,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].get());
|
| + ClearDamageForAllSurfaces(layer->children()[i]);
|
| }
|
|
|
| void EmulateDrawingOneFrame(LayerImpl* root) {
|
| @@ -88,7 +88,7 @@ class DamageTrackerTest : public testing::Test {
|
| &task_graph_runner_) {}
|
|
|
| LayerImpl* CreateTestTreeWithOneSurface() {
|
| - host_impl_.active_tree()->DetachLayerTree();
|
| + host_impl_.active_tree()->ClearLayers();
|
| scoped_ptr<LayerImpl> root =
|
| LayerImpl::Create(host_impl_.active_tree(), 1);
|
| scoped_ptr<LayerImpl> child =
|
| @@ -113,7 +113,7 @@ class DamageTrackerTest : public testing::Test {
|
| // child1. Additionally, the root has a second child layer, and child1 has
|
| // two children of its own.
|
|
|
| - host_impl_.active_tree()->DetachLayerTree();
|
| + host_impl_.active_tree()->ClearLayers();
|
| scoped_ptr<LayerImpl> root =
|
| LayerImpl::Create(host_impl_.active_tree(), 1);
|
| scoped_ptr<LayerImpl> child1 =
|
| @@ -210,8 +210,8 @@ TEST_F(DamageTrackerTest, SanityCheckTestTreeWithTwoSurfaces) {
|
|
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
|
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* child2 = root->children()[1].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* child2 = root->children()[1];
|
| gfx::Rect child_damage_rect =
|
| child1->render_surface()->damage_tracker()->current_damage_rect();
|
| gfx::Rect root_damage_rect =
|
| @@ -231,7 +231,7 @@ TEST_F(DamageTrackerTest, SanityCheckTestTreeWithTwoSurfaces) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForUpdateRects) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| // CASE 1: Setting the update rect should cause the corresponding damage to
|
| // the surface.
|
| @@ -274,7 +274,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForUpdateRects) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForLayerDamageRects) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| // CASE 1: Adding the layer damage rect should cause the corresponding damage
|
| // to the surface.
|
| @@ -330,7 +330,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForLayerDamageRects) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForLayerUpdateAndDamageRects) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| // CASE 1: Adding the layer damage rect and update rect should cause the
|
| // corresponding damage to the surface.
|
| @@ -375,7 +375,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForLayerUpdateAndDamageRects) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForPropertyChanges) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| // CASE 1: The layer's property changed flag takes priority over update rect.
|
| //
|
| @@ -427,7 +427,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForTransformedLayer) {
|
| // transformed layer.
|
|
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
| child->SetForceRenderSurface(true);
|
|
|
| gfx::Transform rotation;
|
| @@ -480,7 +480,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForPerspectiveClippedLayer) {
|
| //
|
|
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| gfx::Transform transform;
|
| transform.Translate3d(500.0, 500.0, 0.0);
|
| @@ -521,8 +521,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForPerspectiveClippedLayer) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForBlurredSurface) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* surface = root->children()[0].get();
|
| - LayerImpl* child = surface->children()[0].get();
|
| + LayerImpl* surface = root->children()[0];
|
| + LayerImpl* child = surface->children()[0];
|
|
|
| FilterOperations filters;
|
| filters.Append(FilterOperation::CreateBlurFilter(5.f));
|
| @@ -557,7 +557,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForBlurredSurface) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForImageFilter) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
| gfx::Rect root_damage_rect, child_damage_rect;
|
|
|
| // Allow us to set damage on child too.
|
| @@ -612,8 +612,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForImageFilter) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForBackgroundBlurredChild) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* child2 = root->children()[1].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* child2 = root->children()[1];
|
|
|
| // Allow us to set damage on child1 too.
|
| child1->SetDrawsContent(true);
|
| @@ -746,7 +746,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForBackgroundBlurredChild) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingLayer) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
|
|
| // CASE 1: Adding a new layer should cause the appropriate damage.
|
| //
|
| @@ -832,7 +832,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
|
|
| // In this test we don't want the above tree manipulation to be considered
|
| // part of the same frame.
|
| @@ -845,7 +845,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) {
|
| child2->SetDrawsContent(true);
|
| root->AddChild(std::move(child2));
|
| }
|
| - LayerImpl* child2 = root->children()[1].get();
|
| + LayerImpl* child2 = root->children()[1];
|
| root->layer_tree_impl()->property_trees()->needs_rebuild = true;
|
| EmulateDrawingOneFrame(root);
|
|
|
| @@ -865,9 +865,9 @@ TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForNestedSurfaces) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* child2 = root->children()[1].get();
|
| - LayerImpl* grand_child1 = root->children()[0]->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* child2 = root->children()[1];
|
| + LayerImpl* grand_child1 = root->children()[0]->children()[0];
|
| child2->SetForceRenderSurface(true);
|
| grand_child1->SetForceRenderSurface(true);
|
| root->layer_tree_impl()->property_trees()->needs_rebuild = true;
|
| @@ -915,8 +915,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromDescendantLayer) {
|
| // entire surface should be marked dirty.
|
|
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* grand_child1 = root->children()[0]->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* grand_child1 = root->children()[0]->children()[0];
|
| gfx::Rect child_damage_rect;
|
| gfx::Rect root_damage_rect;
|
|
|
| @@ -954,9 +954,9 @@ TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromAncestorLayer) {
|
| // transforming it, while the root surface would be damaged appropriately.
|
|
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* grand_child1 = child1->children()[0].get();
|
| - LayerImpl* grand_child2 = child1->children()[1].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* grand_child1 = child1->children()[0];
|
| + LayerImpl* grand_child2 = child1->children()[1];
|
| gfx::Rect child_damage_rect;
|
| gfx::Rect root_damage_rect;
|
|
|
| @@ -986,7 +986,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromAncestorLayer) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingRenderSurfaces) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| gfx::Rect child_damage_rect;
|
| gfx::Rect root_damage_rect;
|
|
|
| @@ -1042,7 +1042,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingRenderSurfaces) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyNoDamageWhenNothingChanged) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| gfx::Rect child_damage_rect;
|
| gfx::Rect root_damage_rect;
|
|
|
| @@ -1074,7 +1074,7 @@ TEST_F(DamageTrackerTest, VerifyNoDamageWhenNothingChanged) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyNoDamageForUpdateRectThatDoesNotDrawContent) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| gfx::Rect child_damage_rect;
|
| gfx::Rect root_damage_rect;
|
|
|
| @@ -1094,9 +1094,9 @@ TEST_F(DamageTrackerTest, VerifyNoDamageForUpdateRectThatDoesNotDrawContent) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForReplica) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* grand_child1 = child1->children()[0].get();
|
| - LayerImpl* grand_child2 = child1->children()[1].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* grand_child1 = child1->children()[0];
|
| + LayerImpl* grand_child2 = child1->children()[1];
|
|
|
| // 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.
|
| @@ -1203,7 +1203,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplica) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForMask) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| // In the current implementation of the damage tracker, changes to mask
|
| // layers should damage the entire corresponding surface.
|
| @@ -1296,8 +1296,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* grand_child1 = child1->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* grand_child1 = child1->children()[0];
|
|
|
| // 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.
|
| @@ -1368,8 +1368,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) {
|
|
|
| TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithTwoSurfaces();
|
| - LayerImpl* child1 = root->children()[0].get();
|
| - LayerImpl* grand_child1 = child1->children()[0].get();
|
| + LayerImpl* child1 = root->children()[0];
|
| + LayerImpl* grand_child1 = child1->children()[0];
|
|
|
| // Verify that the correct replica_origin_transform is used for the
|
| // replica_mask.
|
| @@ -1429,7 +1429,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) {
|
|
|
| TEST_F(DamageTrackerTest, DamageWhenAddedExternally) {
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| // Case 1: This test ensures that when the tracker is given damage, that
|
| // it is included with any other partial damage.
|
| @@ -1490,7 +1490,7 @@ TEST_F(DamageTrackerTest, VerifyDamageAccumulatesUntilReset) {
|
| // If damage is not cleared, it should accumulate.
|
|
|
| LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| ClearDamageForAllSurfaces(root);
|
| child->SetUpdateRect(gfx::Rect(10.f, 11.f, 1.f, 2.f));
|
| @@ -1537,7 +1537,7 @@ TEST_F(DamageTrackerTest, HugeDamageRect) {
|
|
|
| for (int i = 0; i < kRange; ++i) {
|
| LayerImpl* root = CreateTestTreeWithOneSurface();
|
| - LayerImpl* child = root->children()[0].get();
|
| + LayerImpl* child = root->children()[0];
|
|
|
| gfx::Transform transform;
|
| transform.Translate(-kBigNumber, -kBigNumber);
|
|
|