| Index: cc/CCLayerTreeHostCommonTest.cpp
|
| diff --git a/cc/CCLayerTreeHostCommonTest.cpp b/cc/CCLayerTreeHostCommonTest.cpp
|
| index 2fb4fe823c53587d472e3a68ff33e13db94cdbe9..af74b1fed513b421d04bb68c99e7859ab6aff162 100644
|
| --- a/cc/CCLayerTreeHostCommonTest.cpp
|
| +++ b/cc/CCLayerTreeHostCommonTest.cpp
|
| @@ -90,12 +90,12 @@ WebTransformationMatrix remove3DComponentOfMatrix(const WebTransformationMatrix&
|
| return ret;
|
| }
|
|
|
| -PassOwnPtr<CCLayerImpl> createTreeForFixedPositionTests()
|
| +scoped_ptr<CCLayerImpl> createTreeForFixedPositionTests()
|
| {
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| - OwnPtr<CCLayerImpl> child = CCLayerImpl::create(2);
|
| - OwnPtr<CCLayerImpl> grandChild = CCLayerImpl::create(3);
|
| - OwnPtr<CCLayerImpl> greatGrandChild = CCLayerImpl::create(4);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> child = CCLayerImpl::create(2);
|
| + scoped_ptr<CCLayerImpl> grandChild = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> greatGrandChild = CCLayerImpl::create(4);
|
|
|
| WebTransformationMatrix IdentityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -106,11 +106,11 @@ PassOwnPtr<CCLayerImpl> createTreeForFixedPositionTests()
|
| setLayerPropertiesForTesting(grandChild.get(), IdentityMatrix, IdentityMatrix, anchor, position, bounds, false);
|
| setLayerPropertiesForTesting(greatGrandChild.get(), IdentityMatrix, IdentityMatrix, anchor, position, bounds, false);
|
|
|
| - grandChild->addChild(greatGrandChild.release());
|
| - child->addChild(grandChild.release());
|
| - root->addChild(child.release());
|
| + grandChild->addChild(greatGrandChild.Pass());
|
| + child->addChild(grandChild.Pass());
|
| + root->addChild(child.Pass());
|
|
|
| - return root.release();
|
| + return root.Pass();
|
| }
|
|
|
| class LayerChromiumWithForcedDrawsContent : public LayerChromium {
|
| @@ -737,7 +737,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // is the direct parent of the fixed-position layer.
|
|
|
| DebugScopedSetImplThread scopedImplThread;
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
|
|
| @@ -778,7 +778,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // order.
|
|
|
| DebugScopedSetImplThread scopedImplThread;
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
|
|
| @@ -821,7 +821,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // is NOT the direct parent of the fixed-position layer.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
| CCLayerImpl* greatGrandChild = grandChild->children()[0];
|
| @@ -865,7 +865,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // transforms that have to be processed in the correct order.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
| CCLayerImpl* greatGrandChild = grandChild->children()[0];
|
| @@ -927,7 +927,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // transforms that have to be processed in the correct order.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
| CCLayerImpl* greatGrandChild = grandChild->children()[0];
|
| @@ -989,7 +989,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // scrollDelta.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
| CCLayerImpl* greatGrandChild = grandChild->children()[0];
|
| @@ -1062,7 +1062,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // surfaces is accumulated properly in the final matrix transform.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
| CCLayerImpl* greatGrandChild = grandChild->children()[0];
|
| @@ -1070,9 +1070,9 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // Add one more layer to the test tree for this scenario.
|
| {
|
| WebTransformationMatrix identity;
|
| - OwnPtr<CCLayerImpl> fixedPositionChild = CCLayerImpl::create(5);
|
| + scoped_ptr<CCLayerImpl> fixedPositionChild = CCLayerImpl::create(5);
|
| setLayerPropertiesForTesting(fixedPositionChild.get(), identity, identity, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - greatGrandChild->addChild(fixedPositionChild.release());
|
| + greatGrandChild->addChild(fixedPositionChild.Pass());
|
| }
|
| CCLayerImpl* fixedPositionChild = greatGrandChild->children()[0];
|
|
|
| @@ -1173,7 +1173,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
|
| // is completely irrelevant; it should not affect the scroll compensation.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
|
|
| @@ -1220,7 +1220,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerTha
|
| // should not accidentally be fixed to itself.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
|
|
| @@ -1257,7 +1257,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerTha
|
| // be fixed to the viewport -- not the rootLayer, which may have transforms of its own.
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| + scoped_ptr<CCLayerImpl> root = createTreeForFixedPositionTests();
|
| CCLayerImpl* child = root->children()[0];
|
| CCLayerImpl* grandChild = child->children()[0];
|
|
|
| @@ -2645,7 +2645,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
|
| {
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -2687,7 +2687,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
|
| {
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
|
|
| WebTransformationMatrix uninvertibleTransform;
|
| uninvertibleTransform.setM11(0);
|
| @@ -2748,7 +2748,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
|
| {
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -2791,7 +2791,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
|
| {
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| WebTransformationMatrix rotation45DegreesAboutCenter;
|
| @@ -2842,7 +2842,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
|
| {
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(12345);
|
|
|
| WebTransformationMatrix identityMatrix;
|
|
|
| @@ -2904,7 +2904,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents
|
| //
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -2914,14 +2914,14 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents
|
| {
|
| FloatPoint position(25, 25);
|
| IntSize bounds(50, 50);
|
| - OwnPtr<CCLayerImpl> testLayer = CCLayerImpl::create(12345);
|
| + scoped_ptr<CCLayerImpl> testLayer = CCLayerImpl::create(12345);
|
| setLayerPropertiesForTesting(testLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
|
|
| // override contentBounds
|
| testLayer->setContentBounds(IntSize(100, 100));
|
|
|
| testLayer->setDrawsContent(true);
|
| - root->addChild(testLayer.release());
|
| + root->addChild(testLayer.Pass());
|
| }
|
|
|
| std::vector<CCLayerImpl*> renderSurfaceLayerList;
|
| @@ -2969,23 +2969,23 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
|
|
|
| {
|
| - OwnPtr<CCLayerImpl> clippingLayer = CCLayerImpl::create(123);
|
| + scoped_ptr<CCLayerImpl> clippingLayer = CCLayerImpl::create(123);
|
| FloatPoint position(25, 25); // this layer is positioned, and hit testing should correctly know where the layer is located.
|
| IntSize bounds(50, 50);
|
| setLayerPropertiesForTesting(clippingLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| clippingLayer->setMasksToBounds(true);
|
|
|
| - OwnPtr<CCLayerImpl> child = CCLayerImpl::create(456);
|
| + scoped_ptr<CCLayerImpl> child = CCLayerImpl::create(456);
|
| position = FloatPoint(-50, -50);
|
| bounds = IntSize(300, 300);
|
| setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child->setDrawsContent(true);
|
| - clippingLayer->addChild(child.release());
|
| - root->addChild(clippingLayer.release());
|
| + clippingLayer->addChild(child.Pass());
|
| + root->addChild(clippingLayer.Pass());
|
| }
|
|
|
| std::vector<CCLayerImpl*> renderSurfaceLayerList;
|
| @@ -3034,7 +3034,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| //
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(123);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(123);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -3044,9 +3044,9 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| root->setMasksToBounds(true);
|
|
|
| {
|
| - OwnPtr<CCLayerImpl> child = CCLayerImpl::create(456);
|
| - OwnPtr<CCLayerImpl> grandChild = CCLayerImpl::create(789);
|
| - OwnPtr<CCLayerImpl> rotatedLeaf = CCLayerImpl::create(2468);
|
| + scoped_ptr<CCLayerImpl> child = CCLayerImpl::create(456);
|
| + scoped_ptr<CCLayerImpl> grandChild = CCLayerImpl::create(789);
|
| + scoped_ptr<CCLayerImpl> rotatedLeaf = CCLayerImpl::create(2468);
|
|
|
| position = FloatPoint(10, 10);
|
| bounds = IntSize(80, 80);
|
| @@ -3073,9 +3073,9 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| setLayerPropertiesForTesting(rotatedLeaf.get(), rotatedLeafTransform, identityMatrix, anchor, position, bounds, false);
|
| rotatedLeaf->setDrawsContent(true);
|
|
|
| - grandChild->addChild(rotatedLeaf.release());
|
| - child->addChild(grandChild.release());
|
| - root->addChild(child.release());
|
| + grandChild->addChild(rotatedLeaf.Pass());
|
| + child->addChild(grandChild.Pass());
|
| + root->addChild(child.Pass());
|
| }
|
|
|
| std::vector<CCLayerImpl*> renderSurfaceLayerList;
|
| @@ -3137,11 +3137,11 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
|
|
|
| {
|
| - OwnPtr<CCLayerImpl> intermediateLayer = CCLayerImpl::create(123);
|
| + scoped_ptr<CCLayerImpl> intermediateLayer = CCLayerImpl::create(123);
|
| FloatPoint position(10, 10); // this layer is positioned, and hit testing should correctly know where the layer is located.
|
| IntSize bounds(50, 50);
|
| setLayerPropertiesForTesting(intermediateLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| @@ -3151,13 +3151,13 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
|
|
|
| // The child of the intermediateLayer is translated so that it does not overlap intermediateLayer at all.
|
| // If child is incorrectly clipped, we would not be able to hit it successfully.
|
| - OwnPtr<CCLayerImpl> child = CCLayerImpl::create(456);
|
| + scoped_ptr<CCLayerImpl> child = CCLayerImpl::create(456);
|
| position = FloatPoint(60, 60); // 70, 70 in screen space
|
| bounds = IntSize(20, 20);
|
| setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child->setDrawsContent(true);
|
| - intermediateLayer->addChild(child.release());
|
| - root->addChild(intermediateLayer.release());
|
| + intermediateLayer->addChild(child.Pass());
|
| + root->addChild(intermediateLayer.Pass());
|
| }
|
|
|
| std::vector<CCLayerImpl*> renderSurfaceLayerList;
|
| @@ -3195,7 +3195,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
|
| {
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -3210,9 +3210,9 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
|
| // The expected stacking order is:
|
| // (front) child2, (second) grandChild, (third) child1, and (back) the root layer behind all other layers.
|
|
|
| - OwnPtr<CCLayerImpl> child1 = CCLayerImpl::create(2);
|
| - OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| - OwnPtr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);
|
| + scoped_ptr<CCLayerImpl> child1 = CCLayerImpl::create(2);
|
| + scoped_ptr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);
|
|
|
| position = FloatPoint(10, 10);
|
| bounds = IntSize(50, 50);
|
| @@ -3231,9 +3231,9 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
|
| setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| grandChild1->setDrawsContent(true);
|
|
|
| - child1->addChild(grandChild1.release());
|
| - root->addChild(child1.release());
|
| - root->addChild(child2.release());
|
| + child1->addChild(grandChild1.Pass());
|
| + root->addChild(child1.Pass());
|
| + root->addChild(child2.Pass());
|
| }
|
|
|
| CCLayerImpl* child1 = root->children()[0];
|
| @@ -3300,7 +3300,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
|
| //
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| - OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
|
| + scoped_ptr<CCLayerImpl> root = CCLayerImpl::create(1);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| FloatPoint anchor(0, 0);
|
| @@ -3315,9 +3315,9 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
|
| // The expected stacking order is:
|
| // (front) child2, (second) grandChild, (third) child1, and (back) the root layer behind all other layers.
|
|
|
| - OwnPtr<CCLayerImpl> child1 = CCLayerImpl::create(2);
|
| - OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| - OwnPtr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);
|
| + scoped_ptr<CCLayerImpl> child1 = CCLayerImpl::create(2);
|
| + scoped_ptr<CCLayerImpl> child2 = CCLayerImpl::create(3);
|
| + scoped_ptr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);
|
|
|
| position = FloatPoint(10, 10);
|
| bounds = IntSize(50, 50);
|
| @@ -3339,9 +3339,9 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
|
| grandChild1->setDrawsContent(true);
|
| grandChild1->setForceRenderSurface(true);
|
|
|
| - child1->addChild(grandChild1.release());
|
| - root->addChild(child1.release());
|
| - root->addChild(child2.release());
|
| + child1->addChild(grandChild1.Pass());
|
| + root->addChild(child1.Pass());
|
| + root->addChild(child2.Pass());
|
| }
|
|
|
| CCLayerImpl* child1 = root->children()[0];
|
|
|