| Index: cc/CCDamageTrackerTest.cpp
|
| diff --git a/cc/CCDamageTrackerTest.cpp b/cc/CCDamageTrackerTest.cpp
|
| index a59ccc19979c8abe270488f3f50d84a67218464f..7a431f474920ee629d58d40e4d30b8150ca45401 100644
|
| --- a/cc/CCDamageTrackerTest.cpp
|
| +++ b/cc/CCDamageTrackerTest.cpp
|
| @@ -67,10 +67,10 @@ void emulateDrawingOneFrame(CCLayerImpl* root)
|
| root->resetAllChangeTrackingForSubtree();
|
| }
|
|
|
| -PassOwnPtr<CCLayerImpl> createTestTreeWithOneSurface()
|
| +scoped_ptr<CCLayerImpl> createTestTreeWithOneSurface()
|
| {
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| - OwnPtr<CCLayerImpl> child = CCLayerImpl::create(2);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> child = CCLayerImpl::create(2);
|
|
|
| root->setPosition(FloatPoint::zero());
|
| root->setAnchorPoint(FloatPoint::zero());
|
| @@ -85,22 +85,22 @@ PassOwnPtr<CCLayerImpl> createTestTreeWithOneSurface()
|
| child->setBounds(IntSize(30, 30));
|
| child->setContentBounds(IntSize(30, 30));
|
| child->setDrawsContent(true);
|
| - root->addChild(child.release());
|
| + root->addChild(child.Pass());
|
|
|
| - return root.release();
|
| + return root.Pass();
|
| }
|
|
|
| -PassOwnPtr<CCLayerImpl> createTestTreeWithTwoSurfaces()
|
| +scoped_ptr<CCLayerImpl> createTestTreeWithTwoSurfaces()
|
| {
|
| // This test tree has two render surfaces: one for the root, and one for
|
| // child1. Additionally, the root has a second child layer, and child1 has two
|
| // children of its own.
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| - OwnPtr<CCLayerImpl> child1 = CCLayerImpl::create(2);
|
| - OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| - OwnPtr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);
|
| - OwnPtr<CCLayerImpl> grandChild2 = CCLayerImpl::create(5);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> child1 = CCLayerImpl::create(2);
|
| + scoped_ptr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);
|
| + scoped_ptr<CCLayerImpl> grandChild2 = CCLayerImpl::create(5);
|
|
|
| root->setPosition(FloatPoint::zero());
|
| root->setAnchorPoint(FloatPoint::zero());
|
| @@ -135,34 +135,34 @@ PassOwnPtr<CCLayerImpl> createTestTreeWithTwoSurfaces()
|
| grandChild2->setContentBounds(IntSize(6, 8));
|
| grandChild2->setDrawsContent(true);
|
|
|
| - child1->addChild(grandChild1.release());
|
| - child1->addChild(grandChild2.release());
|
| - root->addChild(child1.release());
|
| - root->addChild(child2.release());
|
| + child1->addChild(grandChild1.Pass());
|
| + child1->addChild(grandChild2.Pass());
|
| + root->addChild(child1.Pass());
|
| + root->addChild(child2.Pass());
|
|
|
| - return root.release();
|
| + return root.Pass();
|
| }
|
|
|
| -PassOwnPtr<CCLayerImpl> createAndSetUpTestTreeWithOneSurface()
|
| +scoped_ptr<CCLayerImpl> createAndSetUpTestTreeWithOneSurface()
|
| {
|
| - OwnPtr<CCLayerImpl> root = createTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createTestTreeWithOneSurface();
|
|
|
| // Setup includes going past the first frame which always damages everything, so
|
| // that we can actually perform specific tests.
|
| emulateDrawingOneFrame(root.get());
|
|
|
| - return root.release();
|
| + return root.Pass();
|
| }
|
|
|
| -PassOwnPtr<CCLayerImpl> createAndSetUpTestTreeWithTwoSurfaces()
|
| +scoped_ptr<CCLayerImpl> createAndSetUpTestTreeWithTwoSurfaces()
|
| {
|
| - OwnPtr<CCLayerImpl> root = createTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createTestTreeWithTwoSurfaces();
|
|
|
| // Setup includes going past the first frame which always damages everything, so
|
| // that we can actually perform specific tests.
|
| emulateDrawingOneFrame(root.get());
|
|
|
| - return root.release();
|
| + return root.Pass();
|
| }
|
|
|
| class CCDamageTrackerTest : public testing::Test {
|
| @@ -176,7 +176,7 @@ TEST_F(CCDamageTrackerTest, sanityCheckTestTreeWithOneSurface)
|
| // Sanity check that the simple test tree will actually produce the expected render
|
| // surfaces and layer lists.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
|
|
| EXPECT_EQ(2u, root->renderSurface()->layerList().size());
|
| EXPECT_EQ(1, root->renderSurface()->layerList()[0]->id());
|
| @@ -191,7 +191,7 @@ TEST_F(CCDamageTrackerTest, sanityCheckTestTreeWithTwoSurfaces)
|
| // Sanity check that the complex test tree will actually produce the expected render
|
| // surfaces and layer lists.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
|
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* child2 = root->children()[1];
|
| @@ -210,7 +210,7 @@ TEST_F(CCDamageTrackerTest, sanityCheckTestTreeWithTwoSurfaces)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForUpdateRects)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| // CASE 1: Setting the update rect should cause the corresponding damage to the surface.
|
| @@ -244,7 +244,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForUpdateRects)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForPropertyChanges)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| // CASE 1: The layer's property changed flag takes priority over update rect.
|
| @@ -288,7 +288,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForTransformedLayer)
|
| // If a layer is transformed, the damage rect should still enclose the entire
|
| // transformed layer.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| WebTransformationMatrix rotation;
|
| @@ -331,7 +331,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForPerspectiveClippedLayer)
|
| // and positioned so that the right-most bound rect will be approximately 501 units in root surface space.
|
| //
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| WebTransformationMatrix transform;
|
| @@ -368,7 +368,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForPerspectiveClippedLayer)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForBlurredSurface)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| WebFilterOperations filters;
|
| @@ -396,7 +396,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForBlurredSurface)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForBackgroundBlurredChild)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* child2 = root->children()[1];
|
|
|
| @@ -499,20 +499,20 @@ TEST_F(CCDamageTrackerTest, verifyDamageForBackgroundBlurredChild)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingLayer)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child1 = root->children()[0];
|
|
|
| // CASE 1: Adding a new layer should cause the appropriate damage.
|
| //
|
| clearDamageForAllSurfaces(root.get());
|
| {
|
| - OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| child2->setPosition(FloatPoint(400, 380));
|
| child2->setAnchorPoint(FloatPoint::zero());
|
| child2->setBounds(IntSize(6, 8));
|
| child2->setContentBounds(IntSize(6, 8));
|
| child2->setDrawsContent(true);
|
| - root->addChild(child2.release());
|
| + root->addChild(child2.Pass());
|
| }
|
| emulateDrawingOneFrame(root.get());
|
|
|
| @@ -542,11 +542,11 @@ TEST_F(CCDamageTrackerTest, verifyDamageForNewUnchangedLayer)
|
| // If child2 is added to the layer tree, but it doesn't have any explicit damage of
|
| // its own, it should still indeed damage the target surface.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
|
|
| clearDamageForAllSurfaces(root.get());
|
| {
|
| - OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| child2->setPosition(FloatPoint(400, 380));
|
| child2->setAnchorPoint(FloatPoint::zero());
|
| child2->setBounds(IntSize(6, 8));
|
| @@ -557,7 +557,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForNewUnchangedLayer)
|
| // means the test no longer actually covers the intended scenario.
|
| ASSERT_FALSE(child2->layerPropertyChanged());
|
| ASSERT_TRUE(child2->updateRect().isEmpty());
|
| - root->addChild(child2.release());
|
| + root->addChild(child2.Pass());
|
| }
|
| emulateDrawingOneFrame(root.get());
|
|
|
| @@ -570,19 +570,19 @@ TEST_F(CCDamageTrackerTest, verifyDamageForNewUnchangedLayer)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child1 = root->children()[0];
|
|
|
| // In this test we don't want the above tree manipulation to be considered part of the same frame.
|
| clearDamageForAllSurfaces(root.get());
|
| {
|
| - OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| child2->setPosition(FloatPoint(400, 380));
|
| child2->setAnchorPoint(FloatPoint::zero());
|
| child2->setBounds(IntSize(6, 8));
|
| child2->setContentBounds(IntSize(6, 8));
|
| child2->setDrawsContent(true);
|
| - root->addChild(child2.release());
|
| + root->addChild(child2.Pass());
|
| }
|
| CCLayerImpl* child2 = root->children()[1];
|
| emulateDrawingOneFrame(root.get());
|
| @@ -600,7 +600,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForNestedSurfaces)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* child2 = root->children()[1];
|
| CCLayerImpl* grandChild1 = root->children()[0]->children()[0];
|
| @@ -639,7 +639,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForSurfaceChangeFromDescendantLayer)
|
| // This is a tricky case, since only the first grandChild changes, but the entire
|
| // surface should be marked dirty.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* grandChild1 = root->children()[0]->children()[0];
|
| FloatRect childDamageRect;
|
| @@ -672,7 +672,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForSurfaceChangeFromAncestorLayer)
|
| // should be completely unchanged, since we are only transforming it, while the
|
| // root surface would be damaged appropriately.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| FloatRect childDamageRect;
|
| FloatRect rootDamageRect;
|
| @@ -694,7 +694,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForSurfaceChangeFromAncestorLayer)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingRenderSurfaces)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| FloatRect childDamageRect;
|
| FloatRect rootDamageRect;
|
| @@ -738,7 +738,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingRenderSurfaces)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyNoDamageWhenNothingChanged)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| FloatRect childDamageRect;
|
| FloatRect rootDamageRect;
|
| @@ -764,7 +764,7 @@ TEST_F(CCDamageTrackerTest, verifyNoDamageWhenNothingChanged)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyNoDamageForUpdateRectThatDoesNotDrawContent)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| FloatRect childDamageRect;
|
| FloatRect rootDamageRect;
|
| @@ -782,7 +782,7 @@ TEST_F(CCDamageTrackerTest, verifyNoDamageForUpdateRectThatDoesNotDrawContent)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* grandChild1 = child1->children()[0];
|
| CCLayerImpl* grandChild2 = child1->children()[1];
|
| @@ -795,13 +795,13 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
|
| // contentBounds of the surface.
|
| grandChild2->setPosition(FloatPoint(180, 180));
|
| {
|
| - OwnPtr<CCLayerImpl> grandChild3 = CCLayerImpl::create(6);
|
| + scoped_ptr<CCLayerImpl> grandChild3 = CCLayerImpl::create(6);
|
| grandChild3->setPosition(FloatPoint(240, 240));
|
| grandChild3->setAnchorPoint(FloatPoint::zero());
|
| grandChild3->setBounds(IntSize(10, 10));
|
| grandChild3->setContentBounds(IntSize(10, 10));
|
| grandChild3->setDrawsContent(true);
|
| - child1->addChild(grandChild3.release());
|
| + child1->addChild(grandChild3.Pass());
|
| }
|
| child1->setOpacity(0.5);
|
| emulateDrawingOneFrame(root.get());
|
| @@ -810,13 +810,13 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
|
| //
|
| clearDamageForAllSurfaces(root.get());
|
| {
|
| - OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(7);
|
| + scoped_ptr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(7);
|
| grandChild1Replica->setPosition(FloatPoint::zero());
|
| grandChild1Replica->setAnchorPoint(FloatPoint::zero());
|
| WebTransformationMatrix reflection;
|
| reflection.scale3d(-1, 1, 1);
|
| grandChild1Replica->setTransform(reflection);
|
| - grandChild1->setReplicaLayer(grandChild1Replica.release());
|
| + grandChild1->setReplicaLayer(grandChild1Replica.Pass());
|
| }
|
| emulateDrawingOneFrame(root.get());
|
|
|
| @@ -853,7 +853,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
|
| // CASE 3: removing the reflection should cause the entire region including reflection
|
| // to damage the target surface.
|
| clearDamageForAllSurfaces(root.get());
|
| - grandChild1->setReplicaLayer(nullptr);
|
| + grandChild1->setReplicaLayer(scoped_ptr<CCLayerImpl>());
|
| emulateDrawingOneFrame(root.get());
|
| ASSERT_EQ(oldContentRect.width(), child1->renderSurface()->contentRect().width());
|
| ASSERT_EQ(oldContentRect.height(), child1->renderSurface()->contentRect().height());
|
| @@ -868,7 +868,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForMask)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| // In the current implementation of the damage tracker, changes to mask layers should
|
| @@ -878,25 +878,25 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
|
|
|
| // Set up the mask layer.
|
| {
|
| - OwnPtr<CCLayerImpl> maskLayer = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> maskLayer = CCLayerImpl::create(3);
|
| maskLayer->setPosition(child->position());
|
| maskLayer->setAnchorPoint(FloatPoint::zero());
|
| maskLayer->setBounds(child->bounds());
|
| maskLayer->setContentBounds(child->bounds());
|
| - child->setMaskLayer(maskLayer.release());
|
| + child->setMaskLayer(maskLayer.Pass());
|
| }
|
| CCLayerImpl* maskLayer = child->maskLayer();
|
|
|
| // Add opacity and a grandChild so that the render surface persists even after we remove the mask.
|
| child->setOpacity(0.5);
|
| {
|
| - OwnPtr<CCLayerImpl> grandChild = CCLayerImpl::create(4);
|
| + scoped_ptr<CCLayerImpl> grandChild = CCLayerImpl::create(4);
|
| grandChild->setPosition(FloatPoint(2, 2));
|
| grandChild->setAnchorPoint(FloatPoint::zero());
|
| grandChild->setBounds(IntSize(2, 2));
|
| grandChild->setContentBounds(IntSize(2, 2));
|
| grandChild->setDrawsContent(true);
|
| - child->addChild(grandChild.release());
|
| + child->addChild(grandChild.Pass());
|
| }
|
| emulateDrawingOneFrame(root.get());
|
|
|
| @@ -939,7 +939,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
|
|
|
| // Then test mask removal.
|
| clearDamageForAllSurfaces(root.get());
|
| - child->setMaskLayer(nullptr);
|
| + child->setMaskLayer(scoped_ptr<CCLayerImpl>());
|
| ASSERT_TRUE(child->layerPropertyChanged());
|
| emulateDrawingOneFrame(root.get());
|
|
|
| @@ -952,7 +952,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* grandChild1 = child1->children()[0];
|
|
|
| @@ -963,24 +963,24 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
|
|
|
| // Create a reflection about the left edge of grandChild1.
|
| {
|
| - OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6);
|
| + scoped_ptr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6);
|
| grandChild1Replica->setPosition(FloatPoint::zero());
|
| grandChild1Replica->setAnchorPoint(FloatPoint::zero());
|
| WebTransformationMatrix reflection;
|
| reflection.scale3d(-1, 1, 1);
|
| grandChild1Replica->setTransform(reflection);
|
| - grandChild1->setReplicaLayer(grandChild1Replica.release());
|
| + grandChild1->setReplicaLayer(grandChild1Replica.Pass());
|
| }
|
| CCLayerImpl* grandChild1Replica = grandChild1->replicaLayer();
|
|
|
| // Set up the mask layer on the replica layer
|
| {
|
| - OwnPtr<CCLayerImpl> replicaMaskLayer = CCLayerImpl::create(7);
|
| + scoped_ptr<CCLayerImpl> replicaMaskLayer = CCLayerImpl::create(7);
|
| replicaMaskLayer->setPosition(FloatPoint::zero());
|
| replicaMaskLayer->setAnchorPoint(FloatPoint::zero());
|
| replicaMaskLayer->setBounds(grandChild1->bounds());
|
| replicaMaskLayer->setContentBounds(grandChild1->bounds());
|
| - grandChild1Replica->setMaskLayer(replicaMaskLayer.release());
|
| + grandChild1Replica->setMaskLayer(replicaMaskLayer.Pass());
|
| }
|
| CCLayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer();
|
|
|
| @@ -1003,7 +1003,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
|
| // CASE 2: removing the replica mask damages only the reflected region on the target surface.
|
| //
|
| clearDamageForAllSurfaces(root.get());
|
| - grandChild1Replica->setMaskLayer(nullptr);
|
| + grandChild1Replica->setMaskLayer(scoped_ptr<CCLayerImpl>());
|
| emulateDrawingOneFrame(root.get());
|
|
|
| grandChildDamageRect = grandChild1->renderSurface()->damageTracker()->currentDamageRect();
|
| @@ -1015,7 +1015,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
|
| CCLayerImpl* child1 = root->children()[0];
|
| CCLayerImpl* grandChild1 = child1->children()[0];
|
|
|
| @@ -1025,24 +1025,24 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
|
| grandChild1->setAnchorPoint(FloatPoint(1, 0)); // This is not exactly the anchor being tested, but by convention its expected to be the same as the replica's anchor point.
|
|
|
| {
|
| - OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6);
|
| + scoped_ptr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6);
|
| grandChild1Replica->setPosition(FloatPoint::zero());
|
| grandChild1Replica->setAnchorPoint(FloatPoint(1, 0)); // This is the anchor being tested.
|
| WebTransformationMatrix reflection;
|
| reflection.scale3d(-1, 1, 1);
|
| grandChild1Replica->setTransform(reflection);
|
| - grandChild1->setReplicaLayer(grandChild1Replica.release());
|
| + grandChild1->setReplicaLayer(grandChild1Replica.Pass());
|
| }
|
| CCLayerImpl* grandChild1Replica = grandChild1->replicaLayer();
|
|
|
| // Set up the mask layer on the replica layer
|
| {
|
| - OwnPtr<CCLayerImpl> replicaMaskLayer = CCLayerImpl::create(7);
|
| + scoped_ptr<CCLayerImpl> replicaMaskLayer = CCLayerImpl::create(7);
|
| replicaMaskLayer->setPosition(FloatPoint::zero());
|
| replicaMaskLayer->setAnchorPoint(FloatPoint::zero()); // note, this is not the anchor being tested.
|
| replicaMaskLayer->setBounds(grandChild1->bounds());
|
| replicaMaskLayer->setContentBounds(grandChild1->bounds());
|
| - grandChild1Replica->setMaskLayer(replicaMaskLayer.release());
|
| + grandChild1Replica->setMaskLayer(replicaMaskLayer.Pass());
|
| }
|
| CCLayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer();
|
|
|
| @@ -1063,7 +1063,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
|
|
|
| TEST_F(CCDamageTrackerTest, verifyDamageWhenForcedFullDamage)
|
| {
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| // Case 1: This test ensures that when the tracker is forced to have full damage, that
|
| @@ -1091,7 +1091,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForEmptyLayerList)
|
| // Though it should never happen, its a good idea to verify that the damage tracker
|
| // does not crash when it receives an empty layerList.
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| root->createRenderSurface();
|
|
|
| ASSERT_TRUE(root == root->renderTarget());
|
| @@ -1107,7 +1107,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageAccumulatesUntilReset)
|
| {
|
| // If damage is not cleared, it should accumulate.
|
|
|
| - OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| + scoped_ptr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
|
| CCLayerImpl* child = root->children()[0];
|
|
|
| clearDamageForAllSurfaces(root.get());
|
|
|