| Index: cc/layer_tree_host_common_unittest.cc
|
| diff --git a/cc/layer_tree_host_common_unittest.cc b/cc/layer_tree_host_common_unittest.cc
|
| index c2b7f9aa940ace4c5795146d9a254834e2662aa9..a39276978c29ff1dc184c5a35da5fa8732730887 100644
|
| --- a/cc/layer_tree_host_common_unittest.cc
|
| +++ b/cc/layer_tree_host_common_unittest.cc
|
| @@ -29,7 +29,7 @@ using WebKit::WebTransformationMatrix;
|
| namespace {
|
|
|
| template<typename LayerType>
|
| -void setLayerPropertiesForTestingInternal(LayerType* layer, const WebTransformationMatrix& transform, const WebTransformationMatrix& sublayerTransform, const FloatPoint& anchor, const FloatPoint& position, const IntSize& bounds, bool preserves3D)
|
| +void setLayerPropertiesForTestingInternal(LayerType* layer, const WebTransformationMatrix& transform, const WebTransformationMatrix& sublayerTransform, const gfx::PointF& anchor, const gfx::PointF& position, const gfx::Size& bounds, bool preserves3D)
|
| {
|
| layer->setTransform(transform);
|
| layer->setSublayerTransform(sublayerTransform);
|
| @@ -39,13 +39,13 @@ void setLayerPropertiesForTestingInternal(LayerType* layer, const WebTransformat
|
| layer->setPreserves3D(preserves3D);
|
| }
|
|
|
| -void setLayerPropertiesForTesting(Layer* layer, const WebTransformationMatrix& transform, const WebTransformationMatrix& sublayerTransform, const FloatPoint& anchor, const FloatPoint& position, const IntSize& bounds, bool preserves3D)
|
| +void setLayerPropertiesForTesting(Layer* layer, const WebTransformationMatrix& transform, const WebTransformationMatrix& sublayerTransform, const gfx::PointF& anchor, const gfx::PointF& position, const gfx::Size& bounds, bool preserves3D)
|
| {
|
| setLayerPropertiesForTestingInternal<Layer>(layer, transform, sublayerTransform, anchor, position, bounds, preserves3D);
|
| layer->setAutomaticallyComputeRasterScale(true);
|
| }
|
|
|
| -void setLayerPropertiesForTesting(LayerImpl* layer, const WebTransformationMatrix& transform, const WebTransformationMatrix& sublayerTransform, const FloatPoint& anchor, const FloatPoint& position, const IntSize& bounds, bool preserves3D)
|
| +void setLayerPropertiesForTesting(LayerImpl* layer, const WebTransformationMatrix& transform, const WebTransformationMatrix& sublayerTransform, const gfx::PointF& anchor, const gfx::PointF& position, const gfx::Size& bounds, bool preserves3D)
|
| {
|
| setLayerPropertiesForTestingInternal<LayerImpl>(layer, transform, sublayerTransform, anchor, position, bounds, preserves3D);
|
| layer->setContentBounds(bounds);
|
| @@ -56,10 +56,10 @@ void executeCalculateDrawTransformsAndVisibility(Layer* rootLayer, float deviceS
|
| WebTransformationMatrix identityMatrix;
|
| std::vector<scoped_refptr<Layer> > dummyRenderSurfaceLayerList;
|
| int dummyMaxTextureSize = 512;
|
| - IntSize deviceViewportSize = IntSize(rootLayer->bounds().width() * deviceScaleFactor, rootLayer->bounds().height() * deviceScaleFactor);
|
| + gfx::Size deviceViewportSize = gfx::Size(rootLayer->bounds().width() * deviceScaleFactor, rootLayer->bounds().height() * deviceScaleFactor);
|
|
|
| // We are probably not testing what is intended if the rootLayer bounds are empty.
|
| - DCHECK(!rootLayer->bounds().isEmpty());
|
| + DCHECK(!rootLayer->bounds().IsEmpty());
|
| LayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize, deviceScaleFactor, pageScaleFactor, dummyMaxTextureSize, dummyRenderSurfaceLayerList);
|
| }
|
|
|
| @@ -70,10 +70,10 @@ void executeCalculateDrawTransformsAndVisibility(LayerImpl* rootLayer, float dev
|
| WebTransformationMatrix identityMatrix;
|
| std::vector<LayerImpl*> dummyRenderSurfaceLayerList;
|
| int dummyMaxTextureSize = 512;
|
| - IntSize deviceViewportSize = IntSize(rootLayer->bounds().width() * deviceScaleFactor, rootLayer->bounds().height() * deviceScaleFactor);
|
| + gfx::Size deviceViewportSize = gfx::Size(rootLayer->bounds().width() * deviceScaleFactor, rootLayer->bounds().height() * deviceScaleFactor);
|
|
|
| // We are probably not testing what is intended if the rootLayer bounds are empty.
|
| - DCHECK(!rootLayer->bounds().isEmpty());
|
| + DCHECK(!rootLayer->bounds().IsEmpty());
|
| LayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize, deviceScaleFactor, pageScaleFactor, 0, dummyMaxTextureSize, dummyRenderSurfaceLayerList);
|
| }
|
|
|
| @@ -98,9 +98,9 @@ scoped_ptr<LayerImpl> createTreeForFixedPositionTests()
|
| scoped_ptr<LayerImpl> greatGrandChild = LayerImpl::create(4);
|
|
|
| WebTransformationMatrix IdentityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), IdentityMatrix, IdentityMatrix, anchor, position, bounds, false);
|
| setLayerPropertiesForTesting(child.get(), IdentityMatrix, IdentityMatrix, anchor, position, bounds, false);
|
| setLayerPropertiesForTesting(grandChild.get(), IdentityMatrix, IdentityMatrix, anchor, position, bounds, false);
|
| @@ -156,9 +156,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForNoOpLayer)
|
| child->addChild(grandChild);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(0, 0), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(0, 0), false);
|
|
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
|
|
| @@ -176,7 +176,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleLayer)
|
| // Case 1: setting the sublayer transform should not affect this layer's draw transform or screen-space transform.
|
| WebTransformationMatrix arbitraryTranslation;
|
| arbitraryTranslation.translate(10, 20);
|
| - setLayerPropertiesForTesting(layer.get(), identityMatrix, arbitraryTranslation, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(layer.get(), identityMatrix, arbitraryTranslation, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| WebTransformationMatrix expectedDrawTransform = identityMatrix;
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedDrawTransform, layer->drawTransform());
|
| @@ -185,13 +185,13 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleLayer)
|
| // Case 2: Setting the bounds of the layer should not affect either the draw transform or the screenspace transform.
|
| WebTransformationMatrix translationToCenter;
|
| translationToCenter.translate(5, 6);
|
| - setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 12), false);
|
| + setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform());
|
|
|
| // Case 3: The anchor point by itself (without a layer transform) should have no effect on the transforms.
|
| - setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
|
| + setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform());
|
| @@ -199,7 +199,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleLayer)
|
| // Case 4: A change in actual position affects both the draw transform and screen space transform.
|
| WebTransformationMatrix positionTransform;
|
| positionTransform.translate(0, 1.2);
|
| - setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2f), IntSize(10, 12), false);
|
| + setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 1.2f), gfx::Size(10, 12), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform, layer->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform, layer->screenSpaceTransform());
|
| @@ -208,7 +208,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleLayer)
|
| // using a scale transform, because scale and translation are not commutative.
|
| WebTransformationMatrix layerTransform;
|
| layerTransform.scale3d(2, 2, 1);
|
| - setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 12), false);
|
| + setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(layerTransform, layer->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(layerTransform, layer->screenSpaceTransform());
|
| @@ -217,7 +217,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleLayer)
|
| WebTransformationMatrix translationToAnchor;
|
| translationToAnchor.translate(5, 0);
|
| WebTransformationMatrix expectedResult = translationToAnchor * layerTransform * translationToAnchor.inverse();
|
| - setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 0), IntSize(10, 12), false);
|
| + setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, gfx::PointF(0.5, 0), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform());
|
| @@ -226,7 +226,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleLayer)
|
| // The current implementation of calculateDrawTransforms does this implicitly, but it is
|
| // still worth testing to detect accidental regressions.
|
| expectedResult = positionTransform * translationToAnchor * layerTransform * translationToAnchor.inverse();
|
| - setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 1.2f), IntSize(10, 12), false);
|
| + setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, gfx::PointF(0.5, 0), gfx::PointF(0, 1.2f), gfx::Size(10, 12), false);
|
| executeCalculateDrawTransformsAndVisibility(layer.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform());
|
| @@ -242,9 +242,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
|
| child->addChild(grandChild);
|
|
|
| // Case 1: parent's anchorPoint should not affect child or grandChild.
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(76, 78), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->screenSpaceTransform());
|
| @@ -254,9 +254,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
|
| // Case 2: parent's position affects child and grandChild.
|
| WebTransformationMatrix parentPositionTransform;
|
| parentPositionTransform.translate(0, 1.2);
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2f), IntSize(10, 12), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 1.2f), gfx::Size(10, 12), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(76, 78), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform, child->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform, child->screenSpaceTransform());
|
| @@ -269,9 +269,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
|
| WebTransformationMatrix parentTranslationToAnchor;
|
| parentTranslationToAnchor.translate(2.5, 3);
|
| WebTransformationMatrix parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse();
|
| - setLayerPropertiesForTesting(parent.get(), parentLayerTransform, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
|
| + setLayerPropertiesForTesting(parent.get(), parentLayerTransform, identityMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(76, 78), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
|
| @@ -290,9 +290,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
|
| parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse()
|
| * parentTranslationToCenter * parentSublayerMatrix * parentTranslationToCenter.inverse();
|
| WebTransformationMatrix flattenedCompositeTransform = remove3DComponentOfMatrix(parentCompositeTransform);
|
| - setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
|
| + setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(76, 78), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
|
| @@ -301,9 +301,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
|
|
|
| // Case 5: same as Case 4, except that child does preserve 3D, so the grandChild should receive the non-flattened composite transform.
|
| //
|
| - setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), true);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
|
| + setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), true);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(76, 78), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
|
| @@ -333,7 +333,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
|
| parentTranslationToCenter.translate(50, 60);
|
| WebTransformationMatrix parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse()
|
| * parentTranslationToCenter * parentSublayerMatrix * parentTranslationToCenter.inverse();
|
| - FloatPoint parentCompositeScale = MathUtil::computeTransform2dScaleComponents(parentCompositeTransform);
|
| + gfx::PointF parentCompositeScale = MathUtil::computeTransform2dScaleComponents(parentCompositeTransform);
|
| WebTransformationMatrix surfaceSublayerTransform;
|
| surfaceSublayerTransform.scaleNonUniform(parentCompositeScale.x(), parentCompositeScale.y());
|
| WebTransformationMatrix surfaceSublayerCompositeTransform = parentCompositeTransform * surfaceSublayerTransform.inverse();
|
| @@ -341,9 +341,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
|
| // Child's render surface should not exist yet.
|
| ASSERT_FALSE(child->renderSurface());
|
|
|
| - setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(100, 120), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(8, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(100, 120), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(8, 10), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
|
|
| // Render surface should have been created now.
|
| @@ -391,7 +391,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForReplica)
|
| childTranslationToCenter.translate(8, 9);
|
| WebTransformationMatrix replicaLayerTransform;
|
| replicaLayerTransform.scale3d(3, 3, 1);
|
| - FloatPoint parentCompositeScale = MathUtil::computeTransform2dScaleComponents(parentCompositeTransform);
|
| + gfx::PointF parentCompositeScale = MathUtil::computeTransform2dScaleComponents(parentCompositeTransform);
|
| WebTransformationMatrix surfaceSublayerTransform;
|
| surfaceSublayerTransform.scaleNonUniform(parentCompositeScale.x(), parentCompositeScale.y());
|
| WebTransformationMatrix replicaCompositeTransform = parentCompositeTransform * replicaLayerTransform * surfaceSublayerTransform.inverse();
|
| @@ -399,10 +399,10 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForReplica)
|
| // Child's render surface should not exist yet.
|
| ASSERT_FALSE(child->renderSurface());
|
|
|
| - setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(-0.5, -0.5), IntSize(1, 1), false);
|
| - setLayerPropertiesForTesting(childReplica.get(), replicaLayerTransform, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
|
| + setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, gfx::PointF(0.25, 0.25), gfx::PointF(0, 0), gfx::Size(10, 12), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(16, 18), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(-0.5, -0.5), gfx::Size(1, 1), false);
|
| + setLayerPropertiesForTesting(childReplica.get(), replicaLayerTransform, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(0, 0), false);
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
|
|
| // Render surface should have been created now.
|
| @@ -471,7 +471,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
|
| WebTransformationMatrix R = A * translationToAnchor * replicaLayerTransform * translationToAnchor.inverse();
|
| WebTransformationMatrix identityMatrix;
|
|
|
| - FloatPoint surface1ParentTransformScale = MathUtil::computeTransform2dScaleComponents(A * B);
|
| + gfx::PointF surface1ParentTransformScale = MathUtil::computeTransform2dScaleComponents(A * B);
|
| WebTransformationMatrix surface1SublayerTransform;
|
| surface1SublayerTransform.scaleNonUniform(surface1ParentTransformScale.x(), surface1ParentTransformScale.y());
|
|
|
| @@ -480,7 +480,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
|
| // S1 = transform to move from renderSurface1 pixels to the layer space of the owning layer
|
| WebTransformationMatrix S1 = surface1SublayerTransform.inverse();
|
|
|
| - FloatPoint surface2ParentTransformScale = MathUtil::computeTransform2dScaleComponents(SS1 * A * B);
|
| + gfx::PointF surface2ParentTransformScale = MathUtil::computeTransform2dScaleComponents(SS1 * A * B);
|
| WebTransformationMatrix surface2SublayerTransform;
|
| surface2SublayerTransform.scaleNonUniform(surface2ParentTransformScale.x(), surface2ParentTransformScale.y());
|
|
|
| @@ -489,17 +489,17 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
|
| // S2 = transform to move from renderSurface2 pixels to the layer space of the owning layer
|
| WebTransformationMatrix S2 = surface2SublayerTransform.inverse();
|
|
|
| - setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(replicaOfRS1.get(), replicaLayerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(), false);
|
| - setLayerPropertiesForTesting(replicaOfRS2.get(), replicaLayerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(), false);
|
| + setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(replicaOfRS1.get(), replicaLayerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(), false);
|
| + setLayerPropertiesForTesting(replicaOfRS2.get(), replicaLayerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(0, 0), gfx::Size(), false);
|
|
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
|
|
| @@ -605,9 +605,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForFlatteningLayer)
|
| rotationAboutYAxis.rotate3d(0, 30, 0);
|
|
|
| const WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child.get(), rotationAboutYAxis, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), rotationAboutYAxis, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child.get(), rotationAboutYAxis, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), rotationAboutYAxis, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
|
|
| root->addChild(child);
|
| child->addChild(grandChild);
|
| @@ -649,9 +649,9 @@ TEST(LayerTreeHostCommonTest, verifyTransformsForDegenerateIntermediateLayer)
|
|
|
| // The child height is zero, but has non-zero width that should be accounted for while computing drawTransforms.
|
| const WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 0), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 0), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
|
|
| root->addChild(child);
|
| child->addChild(grandChild);
|
| @@ -672,9 +672,9 @@ TEST(LayerTreeHostCommonTest, verifyRenderSurfaceListForRenderSurfaceWithClipped
|
| scoped_refptr<LayerWithForcedDrawsContent> child = make_scoped_refptr(new LayerWithForcedDrawsContent());
|
|
|
| const WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint(30, 30), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(30, 30), gfx::Size(10, 10), false);
|
|
|
| parent->addChild(renderSurface1);
|
| parent->setMasksToBounds(true);
|
| @@ -700,8 +700,8 @@ TEST(LayerTreeHostCommonTest, verifyRenderSurfaceListForTransparentChild)
|
| scoped_refptr<LayerWithForcedDrawsContent> child = make_scoped_refptr(new LayerWithForcedDrawsContent());
|
|
|
| const WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
|
|
| parent->addChild(renderSurface1);
|
| renderSurface1->addChild(child);
|
| @@ -718,7 +718,7 @@ TEST(LayerTreeHostCommonTest, verifyRenderSurfaceListForTransparentChild)
|
| EXPECT_EQ(0U, parent->renderSurface()->layerList().size());
|
| EXPECT_EQ(1U, renderSurfaceLayerList.size());
|
| EXPECT_EQ(parent->id(), renderSurfaceLayerList[0]->id());
|
| - EXPECT_EQ(IntRect(), parent->drawableContentRect());
|
| + EXPECT_EQ(gfx::Rect(), parent->drawableContentRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyForceRenderSurface)
|
| @@ -729,9 +729,9 @@ TEST(LayerTreeHostCommonTest, verifyForceRenderSurface)
|
| renderSurface1->setForceRenderSurface(true);
|
|
|
| const WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(), gfx::PointF(), gfx::Size(10, 10), false);
|
|
|
| parent->addChild(renderSurface1);
|
| renderSurface1->addChild(child);
|
| @@ -853,7 +853,7 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithD
|
| LayerImpl* greatGrandChild = grandChild->children()[0];
|
|
|
| child->setIsContainerForFixedPositionLayers(true);
|
| - grandChild->setPosition(FloatPoint(8, 6));
|
| + grandChild->setPosition(gfx::PointF(8, 6));
|
| greatGrandChild->setFixedToContainerLayer(true);
|
|
|
| // Case 1: scrollDelta of 0, 0
|
| @@ -901,7 +901,7 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithD
|
|
|
| child->setIsContainerForFixedPositionLayers(true);
|
| child->setTransform(rotationAboutZ);
|
| - grandChild->setPosition(FloatPoint(8, 6));
|
| + grandChild->setPosition(gfx::PointF(8, 6));
|
| grandChild->setTransform(rotationAboutZ);
|
| greatGrandChild->setFixedToContainerLayer(true); // greatGrandChild is positioned upside-down with respect to the renderTarget.
|
|
|
| @@ -963,7 +963,7 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithM
|
|
|
| child->setIsContainerForFixedPositionLayers(true);
|
| child->setTransform(rotationAboutZ);
|
| - grandChild->setPosition(FloatPoint(8, 6));
|
| + grandChild->setPosition(gfx::PointF(8, 6));
|
| grandChild->setTransform(rotationAboutZ);
|
| greatGrandChild->setFixedToContainerLayer(true); // greatGrandChild is positioned upside-down with respect to the renderTarget.
|
|
|
| @@ -1021,7 +1021,7 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithI
|
| LayerImpl* greatGrandChild = grandChild->children()[0];
|
|
|
| child->setIsContainerForFixedPositionLayers(true);
|
| - grandChild->setPosition(FloatPoint(8, 6));
|
| + grandChild->setPosition(gfx::PointF(8, 6));
|
| grandChild->setForceRenderSurface(true);
|
| greatGrandChild->setFixedToContainerLayer(true);
|
| greatGrandChild->setDrawsContent(true);
|
| @@ -1097,16 +1097,16 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithM
|
| {
|
| WebTransformationMatrix identity;
|
| scoped_ptr<LayerImpl> fixedPositionChild = LayerImpl::create(5);
|
| - setLayerPropertiesForTesting(fixedPositionChild.get(), identity, identity, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(fixedPositionChild.get(), identity, identity, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| greatGrandChild->addChild(fixedPositionChild.Pass());
|
| }
|
| LayerImpl* fixedPositionChild = greatGrandChild->children()[0];
|
|
|
| // Actually set up the scenario here.
|
| child->setIsContainerForFixedPositionLayers(true);
|
| - grandChild->setPosition(FloatPoint(8, 6));
|
| + grandChild->setPosition(gfx::PointF(8, 6));
|
| grandChild->setForceRenderSurface(true);
|
| - greatGrandChild->setPosition(FloatPoint(40, 60));
|
| + greatGrandChild->setPosition(gfx::PointF(40, 60));
|
| greatGrandChild->setForceRenderSurface(true);
|
| fixedPositionChild->setFixedToContainerLayer(true);
|
| fixedPositionChild->setDrawsContent(true);
|
| @@ -1351,12 +1351,12 @@ TEST(LayerTreeHostCommonTest, verifyClipRectCullsRenderSurfaces)
|
| child->addChild(leafNode1);
|
| greatGrandChild->addChild(leafNode2);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(45, 45), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(greatGrandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(leafNode1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), false);
|
| - setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(500, 500), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(20, 20), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(45, 45), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(greatGrandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(leafNode1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(500, 500), false);
|
| + setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(20, 20), false);
|
|
|
| child->setMasksToBounds(true);
|
| child->setOpacity(0.4f);
|
| @@ -1399,10 +1399,10 @@ TEST(LayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
|
| child->addChild(grandChild);
|
| grandChild->addChild(leafNode);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
|
| - setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(200, 200), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(leafNode.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(20, 20), false);
|
| + setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(200, 200), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(leafNode.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
|
|
| parent->setMasksToBounds(true);
|
| child->setOpacity(0.4f);
|
| @@ -1457,12 +1457,12 @@ TEST(LayerTreeHostCommonTest, verifyDrawableContentRectForLayers)
|
| child->addChild(grandChild3);
|
| child->addChild(grandChild4);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
|
| - setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(15, 15), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(15, 15), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild4.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(45, 45), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(500, 500), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(20, 20), false);
|
| + setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(15, 15), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(15, 15), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild4.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(45, 45), gfx::Size(10, 10), false);
|
|
|
| child->setMasksToBounds(true);
|
| grandChild3->setMasksToBounds(true);
|
| @@ -1478,10 +1478,10 @@ TEST(LayerTreeHostCommonTest, verifyDrawableContentRectForLayers)
|
| int dummyMaxTextureSize = 512;
|
| LayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, 1, dummyMaxTextureSize, renderSurfaceLayerList);
|
|
|
| - EXPECT_RECT_EQ(IntRect(IntPoint(5, 5), IntSize(10, 10)), grandChild1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->drawableContentRect());
|
| - EXPECT_TRUE(grandChild4->drawableContentRect().isEmpty());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(5, 5), gfx::Size(10, 10)), grandChild1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(15, 15), gfx::Size(5, 5)), grandChild3->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(15, 15), gfx::Size(5, 5)), grandChild3->drawableContentRect());
|
| + EXPECT_TRUE(grandChild4->drawableContentRect().IsEmpty());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
|
| @@ -1517,16 +1517,16 @@ TEST(LayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
|
| grandChild3->addChild(leafNode3);
|
| grandChild4->addChild(leafNode4);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
|
| - setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(15, 15), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(15, 15), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChild4.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(45, 45), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(leafNode1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(leafNode3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(leafNode4.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(500, 500), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(20, 20), false);
|
| + setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(15, 15), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(15, 15), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChild4.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(45, 45), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(leafNode1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(leafNode3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(leafNode4.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), false);
|
|
|
| child->setMasksToBounds(true);
|
| grandChild3->setMasksToBounds(true);
|
| @@ -1549,9 +1549,9 @@ TEST(LayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
|
| EXPECT_FALSE(grandChild4->renderSurface()); // Because grandChild4 is entirely clipped, it is expected to not have a renderSurface.
|
|
|
| // Surfaces are clipped by their parent, but un-affected by the owning layer's masksToBounds.
|
| - EXPECT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild1->renderSurface()->clipRect());
|
| - EXPECT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild2->renderSurface()->clipRect());
|
| - EXPECT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild3->renderSurface()->clipRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(0, 0), gfx::Size(20, 20)), grandChild1->renderSurface()->clipRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(0, 0), gfx::Size(20, 20)), grandChild2->renderSurface()->clipRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(0, 0), gfx::Size(20, 20)), grandChild3->renderSurface()->clipRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
|
| @@ -1596,15 +1596,15 @@ TEST(LayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
|
| addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController(), 10, 30, 0);
|
| addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController(), 10, 30, 0);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| - setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(2.5, 0), IntSize(10, 10), false);
|
| + setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
| + setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
|
|
|
| executeCalculateDrawTransformsAndVisibility(parent.get());
|
|
|
| @@ -1699,23 +1699,23 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectForIdentityTransform)
|
| {
|
| // Test the calculateVisibleRect() function works correctly for identity transforms.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // Case 1: Layer is contained within the surface.
|
| - IntRect layerContentRect = IntRect(IntPoint(10, 10), IntSize(30, 30));
|
| - IntRect expected = IntRect(IntPoint(10, 10), IntSize(30, 30));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(10, 10), gfx::Size(30, 30));
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(10, 10), gfx::Size(30, 30));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Layer is outside the surface rect.
|
| - layerContentRect = IntRect(IntPoint(120, 120), IntSize(30, 30));
|
| + layerContentRect = gfx::Rect(gfx::Point(120, 120), gfx::Size(30, 30));
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_TRUE(actual.isEmpty());
|
| + EXPECT_TRUE(actual.IsEmpty());
|
|
|
| // Case 3: Layer is partially overlapping the surface rect.
|
| - layerContentRect = IntRect(IntPoint(80, 80), IntSize(30, 30));
|
| - expected = IntRect(IntPoint(80, 80), IntSize(20, 20));
|
| + layerContentRect = gfx::Rect(gfx::Point(80, 80), gfx::Size(30, 30));
|
| + expected = gfx::Rect(gfx::Point(80, 80), gfx::Size(20, 20));
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
| @@ -1724,27 +1724,27 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectForTranslations)
|
| {
|
| // Test the calculateVisibleRect() function works correctly for scaling transforms.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(30, 30));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // Case 1: Layer is contained within the surface.
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.translate(10, 10);
|
| - IntRect expected = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(0, 0), gfx::Size(30, 30));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Layer is outside the surface rect.
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.translate(120, 120);
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_TRUE(actual.isEmpty());
|
| + EXPECT_TRUE(actual.IsEmpty());
|
|
|
| // Case 3: Layer is partially overlapping the surface rect.
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.translate(80, 80);
|
| - expected = IntRect(IntPoint(0, 0), IntSize(20, 20));
|
| + expected = gfx::Rect(gfx::Point(0, 0), gfx::Size(20, 20));
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
| @@ -1754,16 +1754,16 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| // Test the calculateVisibleRect() function works correctly for rotations about z-axis (i.e. 2D rotations).
|
| // Remember that calculateVisibleRect() should return the visible rect in the layer's space.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(30, 30));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // Case 1: Layer is contained within the surface.
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.translate(50, 50);
|
| layerToSurfaceTransform.rotate(45);
|
| - IntRect expected = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(0, 0), gfx::Size(30, 30));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Layer is outside the surface rect.
|
| @@ -1771,7 +1771,7 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| layerToSurfaceTransform.translate(-50, 0);
|
| layerToSurfaceTransform.rotate(45);
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_TRUE(actual.isEmpty());
|
| + EXPECT_TRUE(actual.IsEmpty());
|
|
|
| // Case 3: The layer is rotated about its top-left corner. In surface space, the layer
|
| // is oriented diagonally, with the left half outside of the renderSurface. In
|
| @@ -1780,7 +1780,7 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| // bottom-right corners of the layer are still visible.
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.rotate(45);
|
| - expected = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| + expected = gfx::Rect(gfx::Point(0, 0), gfx::Size(30, 30));
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
|
|
| @@ -1792,7 +1792,7 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.translate(0, -sqrt(2.0) * 15);
|
| layerToSurfaceTransform.rotate(45);
|
| - expected = IntRect(IntPoint(15, 0), IntSize(15, 30)); // right half of layer bounds.
|
| + expected = gfx::Rect(gfx::Point(15, 0), gfx::Size(15, 30)); // right half of layer bounds.
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
| @@ -1801,15 +1801,15 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicTransform)
|
| {
|
| // Test that the calculateVisibleRect() function works correctly for 3d transforms.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // Case 1: Orthographic projection of a layer rotated about y-axis by 45 degrees, should be fully contained in the renderSurface.
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.rotate3d(0, 45, 0);
|
| - IntRect expected = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Orthographic projection of a layer rotated about y-axis by 45 degrees, but
|
| @@ -1819,7 +1819,7 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicTransform)
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.translate(-halfWidthOfRotatedLayer, 0);
|
| layerToSurfaceTransform.rotate3d(0, 45, 0); // rotates about the left edge of the layer
|
| - expected = IntRect(IntPoint(50, 0), IntSize(50, 100)); // right half of the layer.
|
| + expected = gfx::Rect(gfx::Point(50, 0), gfx::Size(50, 100)); // right half of the layer.
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
| @@ -1829,8 +1829,8 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveTransform)
|
| // Test the calculateVisibleRect() function works correctly when the layer has a
|
| // perspective projection onto the target surface.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(-50, -50), IntSize(200, 200));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(-50, -50), gfx::Size(200, 200));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // Case 1: Even though the layer is twice as large as the surface, due to perspective
|
| @@ -1846,8 +1846,8 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveTransform)
|
| // This translate places the layer in front of the surface's projection plane.
|
| layerToSurfaceTransform.translate3d(0, 0, -27);
|
|
|
| - IntRect expected = IntRect(IntPoint(-50, -50), IntSize(200, 200));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(-50, -50), gfx::Size(200, 200));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: same projection as before, except that the layer is also translated to the
|
| @@ -1859,7 +1859,7 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveTransform)
|
| // visible), then we would need to translate by (-36 / 9) * -50 == -200 in the layer's units.
|
| //
|
| layerToSurfaceTransform.translate3d(-200, 0, 0);
|
| - expected = IntRect(IntPoint(50, -50), IntSize(100, 200)); // The right half of the layer's bounding rect.
|
| + expected = gfx::Rect(gfx::Point(50, -50), gfx::Size(100, 200)); // The right half of the layer's bounding rect.
|
| actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
| @@ -1871,8 +1871,8 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicIsNotClippedBehi
|
| // behind the surface in an orthographic world should not be clipped when they are
|
| // flattened to the surface.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // This sequence of transforms effectively rotates the layer about the y-axis at the
|
| @@ -1882,8 +1882,8 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicIsNotClippedBehi
|
| layerToSurfaceTransform.rotate3d(0, 45, 0);
|
| layerToSurfaceTransform.translate(-50, 0);
|
|
|
| - IntRect expected = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(0, 0), gfx::Size(100, 100));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| @@ -1895,8 +1895,8 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveWhenClippedByW)
|
| // but actually they are not. The visibleRect needs to be properly clipped by the
|
| // w = 0 plane in homogeneous coordinates before converting to cartesian coordinates.
|
|
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(-50, -50), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(-10, -1), IntSize(20, 2));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(-50, -50), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(-10, -1), gfx::Size(20, 2));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
|
|
| // The layer is positioned so that the right half of the layer should be in front of
|
| @@ -1911,12 +1911,12 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveWhenClippedByW)
|
| // Sanity check that this transform does indeed cause w < 0 when applying the
|
| // transform, otherwise this code is not testing the intended scenario.
|
| bool clipped = false;
|
| - MathUtil::mapQuad(layerToSurfaceTransform, FloatQuad(FloatRect(layerContentRect)), clipped);
|
| + MathUtil::mapQuad(layerToSurfaceTransform, FloatQuad(gfx::RectF(layerContentRect)), clipped);
|
| ASSERT_TRUE(clipped);
|
|
|
| int expectedXPosition = 0;
|
| int expectedWidth = 10;
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_EQ(expectedXPosition, actual.x());
|
| EXPECT_EQ(expectedWidth, actual.width());
|
| }
|
| @@ -1929,8 +1929,8 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectForPerspectiveUnprojection)
|
| // Un-projecting this new rect may require clipping again.
|
|
|
| // This sequence of transforms causes one corner of the layer to protrude across the w = 0 plane, and should be clipped.
|
| - IntRect targetSurfaceRect = IntRect(IntPoint(-50, -50), IntSize(100, 100));
|
| - IntRect layerContentRect = IntRect(IntPoint(-10, -10), IntSize(20, 20));
|
| + gfx::Rect targetSurfaceRect = gfx::Rect(gfx::Point(-50, -50), gfx::Size(100, 100));
|
| + gfx::Rect layerContentRect = gfx::Rect(gfx::Point(-10, -10), gfx::Size(20, 20));
|
| WebTransformationMatrix layerToSurfaceTransform;
|
| layerToSurfaceTransform.makeIdentity();
|
| layerToSurfaceTransform.applyPerspective(1);
|
| @@ -1941,15 +1941,15 @@ TEST(LayerTreeHostCommonTest, verifyVisibleRectForPerspectiveUnprojection)
|
| // Sanity check that un-projection does indeed cause w < 0, otherwise this code is not
|
| // testing the intended scenario.
|
| bool clipped = false;
|
| - FloatRect clippedRect = MathUtil::mapClippedRect(layerToSurfaceTransform, layerContentRect);
|
| + gfx::RectF clippedRect = MathUtil::mapClippedRect(layerToSurfaceTransform, layerContentRect);
|
| MathUtil::projectQuad(layerToSurfaceTransform.inverse(), FloatQuad(clippedRect), clipped);
|
| ASSERT_TRUE(clipped);
|
|
|
| // Only the corner of the layer is not visible on the surface because of being
|
| // clipped. But, the net result of rounding visible region to an axis-aligned rect is
|
| // that the entire layer should still be considered visible.
|
| - IntRect expected = IntRect(IntPoint(-10, -10), IntSize(20, 20));
|
| - IntRect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| + gfx::Rect expected = gfx::Rect(gfx::Point(-10, -10), gfx::Size(20, 20));
|
| + gfx::Rect actual = LayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| @@ -1964,28 +1964,28 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSimpleLayer
|
| root->addChild(child3);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(75, 75), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(125, 125), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(75, 75), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
|
|
|
| executeCalculateDrawTransformsAndVisibility(root.get());
|
|
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
|
|
| // layer visibleContentRects are clipped by their targetSurface
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 25, 25), child2->visibleContentRect());
|
| - EXPECT_TRUE(child3->visibleContentRect().isEmpty());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), child2->visibleContentRect());
|
| + EXPECT_TRUE(child3->visibleContentRect().IsEmpty());
|
|
|
| // layer drawableContentRects are not clipped.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawableContentRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersClippedByLayer)
|
| @@ -2001,33 +2001,33 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersClipp
|
| child->addChild(grandChild3);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(grandChild2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(75, 75), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(grandChild3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(125, 125), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(grandChild2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(75, 75), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(grandChild3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
|
|
|
| child->setMasksToBounds(true);
|
| executeCalculateDrawTransformsAndVisibility(root.get());
|
|
|
| ASSERT_FALSE(child->renderSurface());
|
|
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), child->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), child->visibleContentRect());
|
|
|
| // All grandchild visibleContentRects should be clipped by child.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), grandChild1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 25, 25), grandChild2->visibleContentRect());
|
| - EXPECT_TRUE(grandChild3->visibleContentRect().isEmpty());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), grandChild1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), grandChild2->visibleContentRect());
|
| + EXPECT_TRUE(grandChild3->visibleContentRect().IsEmpty());
|
|
|
| // All grandchild drawableContentRects should also be clipped by child.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 50, 50), grandChild1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(75, 75, 25, 25), grandChild2->drawableContentRect());
|
| - EXPECT_TRUE(grandChild3->drawableContentRect().isEmpty());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), grandChild1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(75, 75, 25, 25), grandChild2->drawableContentRect());
|
| + EXPECT_TRUE(grandChild3->drawableContentRect().IsEmpty());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInUnclippedRenderSurface)
|
| @@ -2043,35 +2043,35 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInUnc
|
| renderSurface1->addChild(child3);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(3, 4), false);
|
| - setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(75, 75), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(125, 125), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(3, 4), false);
|
| + setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(75, 75), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
|
|
|
| renderSurface1->setForceRenderSurface(true);
|
| executeCalculateDrawTransformsAndVisibility(root.get());
|
|
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
|
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
|
|
| // An unclipped surface grows its drawableContentRect to include all drawable regions of the subtree.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 170, 170), renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into the unclipped surface are also unclipped.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child2->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child3->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visibleContentRect());
|
|
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 50, 50), child1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawableContentRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInClippedRenderSurface)
|
| @@ -2087,11 +2087,11 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInCli
|
| renderSurface1->addChild(child3);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(3, 4), false);
|
| - setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(75, 75), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(125, 125), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(3, 4), false);
|
| + setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(75, 75), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
|
|
|
| root->setMasksToBounds(true);
|
| renderSurface1->setForceRenderSurface(true);
|
| @@ -2099,26 +2099,26 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInCli
|
|
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
|
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
|
|
| // A clipped surface grows its drawableContentRect to include all drawable regions of the subtree,
|
| // but also gets clamped by the ancestor's clip.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into the surface have their visibleContentRect clipped by the surface clipRect.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 25, 25), child2->visibleContentRect());
|
| - EXPECT_TRUE(child3->visibleContentRect().isEmpty());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), child2->visibleContentRect());
|
| + EXPECT_TRUE(child3->visibleContentRect().IsEmpty());
|
|
|
| // But the drawableContentRects are unclipped.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 50, 50), child1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawableContentRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHierarchy)
|
| @@ -2137,12 +2137,12 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHier
|
| renderSurface2->addChild(child3);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(3, 4), false);
|
| - setLayerPropertiesForTesting(renderSurface2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(7, 13), false);
|
| - setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(75, 75), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(125, 125), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(3, 4), false);
|
| + setLayerPropertiesForTesting(renderSurface2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(7, 13), false);
|
| + setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(75, 75), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
|
|
|
| root->setMasksToBounds(true);
|
| renderSurface1->setForceRenderSurface(true);
|
| @@ -2152,32 +2152,32 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHier
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
| ASSERT_TRUE(renderSurface2->renderSurface());
|
|
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface2->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), renderSurface2->visibleContentRect());
|
|
|
| // A clipped surface grows its drawableContentRect to include all drawable regions of the subtree,
|
| // but also gets clamped by the ancestor's clip.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // renderSurface1 lives in the "unclipped universe" of renderSurface1, and is only
|
| // implicitly clipped by renderSurface1's contentRect. So, renderSurface2 grows to
|
| // enclose all drawable content of its subtree.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface2->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 170, 170), renderSurface2->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into renderSurface2 think they are unclipped.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child2->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child3->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visibleContentRect());
|
|
|
| // drawableContentRects are also unclipped.
|
| - EXPECT_RECT_EQ(IntRect(5, 5, 50, 50), child1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawableContentRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransformOnUnclippedSurface)
|
| @@ -2194,29 +2194,29 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransformO
|
| WebTransformationMatrix identityMatrix;
|
| WebTransformationMatrix childRotation;
|
| childRotation.rotate(45);
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(3, 4), false);
|
| - setLayerPropertiesForTesting(child1.get(), childRotation, identityMatrix, FloatPoint(0.5, 0.5), FloatPoint(25, 25), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(3, 4), false);
|
| + setLayerPropertiesForTesting(child1.get(), childRotation, identityMatrix, gfx::PointF(0.5, 0.5), gfx::PointF(25, 25), gfx::Size(50, 50), false);
|
|
|
| renderSurface1->setForceRenderSurface(true);
|
| executeCalculateDrawTransformsAndVisibility(root.get());
|
|
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
|
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
|
|
| // The unclipped surface grows its drawableContentRect to include all drawable regions of the subtree.
|
| int diagonalRadius = ceil(sqrt(2.0) * 25);
|
| - IntRect expectedSurfaceDrawableContent = IntRect(50 - diagonalRadius, 50 - diagonalRadius, diagonalRadius * 2, diagonalRadius * 2);
|
| + gfx::Rect expectedSurfaceDrawableContent = gfx::Rect(50 - diagonalRadius, 50 - diagonalRadius, diagonalRadius * 2, diagonalRadius * 2);
|
| EXPECT_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into the unclipped surface are also unclipped.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visibleContentRect());
|
| EXPECT_RECT_EQ(expectedSurfaceDrawableContent, child1->drawableContentRect());
|
| }
|
|
|
| @@ -2234,9 +2234,9 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransformO
|
| WebTransformationMatrix identityMatrix;
|
| WebTransformationMatrix childRotation;
|
| childRotation.rotate(45);
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(3, 4), false);
|
| - setLayerPropertiesForTesting(child1.get(), childRotation, identityMatrix, FloatPoint(0.5, 0.5), FloatPoint(25, 25), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(3, 4), false);
|
| + setLayerPropertiesForTesting(child1.get(), childRotation, identityMatrix, gfx::PointF(0.5, 0.5), gfx::PointF(25, 25), gfx::Size(50, 50), false);
|
|
|
| root->setMasksToBounds(true);
|
| renderSurface1->setForceRenderSurface(true);
|
| @@ -2246,14 +2246,14 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransformO
|
|
|
| // The clipped surface clamps the drawableContentRect that encloses the rotated layer.
|
| int diagonalRadius = ceil(sqrt(2.0) * 25);
|
| - IntRect unclippedSurfaceContent = IntRect(50 - diagonalRadius, 50 - diagonalRadius, diagonalRadius * 2, diagonalRadius * 2);
|
| - IntRect expectedSurfaceDrawableContent = intersection(unclippedSurfaceContent, IntRect(0, 0, 50, 50));
|
| + gfx::Rect unclippedSurfaceContent = gfx::Rect(50 - diagonalRadius, 50 - diagonalRadius, diagonalRadius * 2, diagonalRadius * 2);
|
| + gfx::Rect expectedSurfaceDrawableContent = gfx::IntersectRects(unclippedSurfaceContent, gfx::Rect(0, 0, 50, 50));
|
| EXPECT_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // On the clipped surface, only a quarter of the child1 is visible, but when rotating
|
| // it back to child1's content space, the actual enclosing rect ends up covering the
|
| // full left half of child1.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 26, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 26, 50), child1->visibleContentRect());
|
|
|
| // The child's drawableContentRect is unclipped.
|
| EXPECT_RECT_EQ(unclippedSurfaceContent, child1->drawableContentRect());
|
| @@ -2276,12 +2276,12 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsInHighDPI)
|
| renderSurface2->addChild(child3);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(3, 4), false);
|
| - setLayerPropertiesForTesting(renderSurface2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(7, 13), false);
|
| - setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(5, 5), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(75, 75), IntSize(50, 50), false);
|
| - setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(125, 125), IntSize(50, 50), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(3, 4), false);
|
| + setLayerPropertiesForTesting(renderSurface2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(7, 13), false);
|
| + setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(5, 5), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(75, 75), gfx::Size(50, 50), false);
|
| + setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
|
|
|
| const double deviceScaleFactor = 2;
|
| root->setContentsScale(deviceScaleFactor);
|
| @@ -2300,28 +2300,28 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsInHighDPI)
|
| ASSERT_TRUE(renderSurface2->renderSurface());
|
|
|
| // DrawableContentRects for all layers and surfaces are scaled by deviceScaleFactor.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), root->renderSurface()->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), root->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(10, 10, 190, 190), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 200), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 200), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(10, 10, 190, 190), renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // renderSurface2 lives in the "unclipped universe" of renderSurface1, and
|
| // is only implicitly clipped by renderSurface1.
|
| - EXPECT_RECT_EQ(IntRect(10, 10, 350, 350), renderSurface2->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(10, 10, 350, 350), renderSurface2->renderSurface()->drawableContentRect());
|
|
|
| - EXPECT_RECT_EQ(IntRect(10, 10, 100, 100), child1->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(150, 150, 100, 100), child2->drawableContentRect());
|
| - EXPECT_RECT_EQ(IntRect(250, 250, 100, 100), child3->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(10, 10, 100, 100), child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(150, 150, 100, 100), child2->drawableContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(250, 250, 100, 100), child3->drawableContentRect());
|
|
|
| // The root layer does not actually draw content of its own.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visibleContentRect());
|
|
|
| // All layer visibleContentRects are expressed in content space of each
|
| // layer, so they are also scaled by the deviceScaleFactor.
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 6, 8), renderSurface1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 14, 26), renderSurface2->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), child1->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), child2->visibleContentRect());
|
| - EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), child3->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 6, 8), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 14, 26), renderSurface2->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), child2->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), child3->visibleContentRect());
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithoutPreserves3d)
|
| @@ -2371,15 +2371,15 @@ TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithoutPreserves3d)
|
|
|
| // Nothing preserves 3d. According to current W3C CSS Transforms spec, these layers
|
| // should blindly use their own local transforms to determine back-face culling.
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(frontFacingChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingChild.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(frontFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(frontFacingChildOfFrontFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingChildOfFrontFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(frontFacingChildOfBackFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingChildOfBackFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(frontFacingChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingChild.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(frontFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(frontFacingChildOfFrontFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingChildOfFrontFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(frontFacingChildOfBackFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingChildOfBackFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| std::vector<scoped_refptr<Layer> > renderSurfaceLayerList;
|
| int dummyMaxTextureSize = 512;
|
| @@ -2470,15 +2470,15 @@ TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3d)
|
| // should use the transform with respect to that context. This 3d rendering context
|
| // occurs when (a) parent's transform style is flat and (b) the layer's transform
|
| // style is preserve-3d.
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false); // parent transform style is flat.
|
| - setLayerPropertiesForTesting(frontFacingChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingChild.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(frontFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true); // surface transform style is preserve-3d.
|
| - setLayerPropertiesForTesting(backFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true); // surface transform style is preserve-3d.
|
| - setLayerPropertiesForTesting(frontFacingChildOfFrontFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingChildOfFrontFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(frontFacingChildOfBackFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(backFacingChildOfBackFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false); // parent transform style is flat.
|
| + setLayerPropertiesForTesting(frontFacingChild.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingChild.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(frontFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), true); // surface transform style is preserve-3d.
|
| + setLayerPropertiesForTesting(backFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), true); // surface transform style is preserve-3d.
|
| + setLayerPropertiesForTesting(frontFacingChildOfFrontFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingChildOfFrontFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(frontFacingChildOfBackFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(backFacingChildOfBackFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| std::vector<scoped_refptr<Layer> > renderSurfaceLayerList;
|
| int dummyMaxTextureSize = 512;
|
| @@ -2553,12 +2553,12 @@ TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithAnimatingTransforms)
|
| // This is just an animating layer, not a surface.
|
| addAnimatedTransformToController(*animatingChild->layerAnimationController(), 10, 30, 0);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(animatingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(childOfAnimatingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(animatingChild.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(animatingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(childOfAnimatingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(animatingChild.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| std::vector<scoped_refptr<Layer> > renderSurfaceLayerList;
|
| int dummyMaxTextureSize = 512;
|
| @@ -2585,13 +2585,13 @@ TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithAnimatingTransforms)
|
| EXPECT_EQ(animatingSurface->id(), renderSurfaceLayerList[1]->renderSurface()->layerList()[0]->id());
|
| EXPECT_EQ(childOfAnimatingSurface->id(), renderSurfaceLayerList[1]->renderSurface()->layerList()[1]->id());
|
|
|
| - EXPECT_FALSE(child2->visibleContentRect().isEmpty());
|
| + EXPECT_FALSE(child2->visibleContentRect().IsEmpty());
|
|
|
| // The animating layers should have a visibleContentRect that represents the area of the front face that is within the viewport.
|
| - EXPECT_EQ(animatingChild->visibleContentRect(), IntRect(IntPoint(), animatingChild->contentBounds()));
|
| - EXPECT_EQ(animatingSurface->visibleContentRect(), IntRect(IntPoint(), animatingSurface->contentBounds()));
|
| + EXPECT_EQ(animatingChild->visibleContentRect(), gfx::Rect(gfx::Point(), animatingChild->contentBounds()));
|
| + EXPECT_EQ(animatingSurface->visibleContentRect(), gfx::Rect(gfx::Point(), animatingSurface->contentBounds()));
|
| // And layers in the subtree of the animating layer should have valid visibleContentRects also.
|
| - EXPECT_EQ(childOfAnimatingSurface->visibleContentRect(), IntRect(IntPoint(), childOfAnimatingSurface->contentBounds()));
|
| + EXPECT_EQ(childOfAnimatingSurface->visibleContentRect(), gfx::Rect(gfx::Point(), childOfAnimatingSurface->contentBounds()));
|
| }
|
|
|
| TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlatteningSurface)
|
| @@ -2620,11 +2620,11 @@ TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlatteningS
|
| backfaceMatrix.rotate3d(0, 1, 0, 180);
|
| backfaceMatrix.translate(-50, -50);
|
|
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true); // parent transform style is preserve3d.
|
| - setLayerPropertiesForTesting(frontFacingSurface.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false); // surface transform style is flat.
|
| - setLayerPropertiesForTesting(backFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false); // surface transform style is flat.
|
| - setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| - setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), true); // parent transform style is preserve3d.
|
| + setLayerPropertiesForTesting(frontFacingSurface.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false); // surface transform style is flat.
|
| + setLayerPropertiesForTesting(backFacingSurface.get(), backfaceMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false); // surface transform style is flat.
|
| + setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
| + setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| std::vector<scoped_refptr<Layer> > renderSurfaceLayerList;
|
| int dummyMaxTextureSize = 512;
|
| @@ -2658,11 +2658,11 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForEmptyLayerList)
|
|
|
| std::vector<LayerImpl*> renderSurfaceLayerList;
|
|
|
| - IntPoint testPoint(0, 0);
|
| + gfx::Point testPoint(0, 0);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(10, 20);
|
| + testPoint = gfx::Point(10, 20);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
| }
|
| @@ -2674,9 +2674,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -2689,21 +2689,21 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
|
| ASSERT_EQ(1u, root->renderSurface()->layerList().size());
|
|
|
| // Hit testing for a point outside the layer should return a null pointer.
|
| - IntPoint testPoint(101, 101);
|
| + gfx::Point testPoint(101, 101);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(-1, -1);
|
| + testPoint = gfx::Point(-1, -1);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the root layer.
|
| - testPoint = IntPoint(1, 1);
|
| + testPoint = gfx::Point(1, 1);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
|
|
| - testPoint = IntPoint(99, 99);
|
| + testPoint = gfx::Point(99, 99);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
| @@ -2723,9 +2723,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
|
| ASSERT_FALSE(uninvertibleTransform.isInvertible());
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), uninvertibleTransform, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -2741,31 +2741,31 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
|
| // Hit testing any point should not hit the layer. If the invertible matrix is
|
| // accidentally ignored and treated like an identity, then the hit testing will
|
| // incorrectly hit the layer when it shouldn't.
|
| - IntPoint testPoint(1, 1);
|
| + gfx::Point testPoint(1, 1);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(10, 10);
|
| + testPoint = gfx::Point(10, 10);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(10, 30);
|
| + testPoint = gfx::Point(10, 30);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(50, 50);
|
| + testPoint = gfx::Point(50, 50);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(67, 48);
|
| + testPoint = gfx::Point(67, 48);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(99, 99);
|
| + testPoint = gfx::Point(99, 99);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(-1, -1);
|
| + testPoint = gfx::Point(-1, -1);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
| }
|
| @@ -2777,9 +2777,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(50, 50); // this layer is positioned, and hit testing should correctly know where the layer is located.
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(50, 50); // this layer is positioned, and hit testing should correctly know where the layer is located.
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -2792,22 +2792,22 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
|
| ASSERT_EQ(1u, root->renderSurface()->layerList().size());
|
|
|
| // Hit testing for a point outside the layer should return a null pointer.
|
| - IntPoint testPoint(49, 49);
|
| + gfx::Point testPoint(49, 49);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Even though the layer exists at (101, 101), it should not be visible there since the root renderSurface would clamp it.
|
| - testPoint = IntPoint(101, 101);
|
| + testPoint = gfx::Point(101, 101);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the root layer.
|
| - testPoint = IntPoint(51, 51);
|
| + testPoint = gfx::Point(51, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
|
|
| - testPoint = IntPoint(99, 99);
|
| + testPoint = gfx::Point(99, 99);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
| @@ -2824,9 +2824,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
|
| rotation45DegreesAboutCenter.translate(50, 50);
|
| rotation45DegreesAboutCenter.rotate3d(0, 0, 45);
|
| rotation45DegreesAboutCenter.translate(-50, -50);
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), rotation45DegreesAboutCenter, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -2840,26 +2840,26 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
|
|
|
| // Hit testing for points outside the layer.
|
| // These corners would have been inside the un-transformed layer, but they should not hit the correctly transformed layer.
|
| - IntPoint testPoint(99, 99);
|
| + gfx::Point testPoint(99, 99);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(1, 1);
|
| + testPoint = gfx::Point(1, 1);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the root layer.
|
| - testPoint = IntPoint(1, 50);
|
| + testPoint = gfx::Point(1, 50);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
|
|
| // Hit testing the corners that would overlap the unclipped layer, but are outside the clipped region.
|
| - testPoint = IntPoint(50, -1);
|
| + testPoint = gfx::Point(50, -1);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(-1, 50);
|
| + testPoint = gfx::Point(-1, 50);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_FALSE(resultLayer);
|
| }
|
| @@ -2880,9 +2880,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
|
| WebTransformationMatrix translationByZ;
|
| translationByZ.translate3d(0, 0, -1);
|
|
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), perspectiveProjectionAboutCenter * translationByZ, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -2896,21 +2896,21 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
|
|
|
| // Hit testing for points outside the layer.
|
| // These corners would have been inside the un-transformed layer, but they should not hit the correctly transformed layer.
|
| - IntPoint testPoint(24, 24);
|
| + gfx::Point testPoint(24, 24);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(76, 76);
|
| + testPoint = gfx::Point(76, 76);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the root layer.
|
| - testPoint = IntPoint(26, 26);
|
| + testPoint = gfx::Point(26, 26);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
|
|
| - testPoint = IntPoint(74, 74);
|
| + testPoint = gfx::Point(74, 74);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
| @@ -2933,18 +2933,18 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents)
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(1);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| + gfx::PointF anchor(0, 0);
|
|
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| {
|
| - FloatPoint position(25, 25);
|
| - IntSize bounds(50, 50);
|
| + gfx::PointF position(25, 25);
|
| + gfx::Size bounds(50, 50);
|
| scoped_ptr<LayerImpl> testLayer = LayerImpl::create(12345);
|
| setLayerPropertiesForTesting(testLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
|
|
| // override contentBounds
|
| - testLayer->setContentBounds(IntSize(100, 100));
|
| + testLayer->setContentBounds(gfx::Size(100, 100));
|
|
|
| testLayer->setDrawsContent(true);
|
| root->addChild(testLayer.Pass());
|
| @@ -2957,30 +2957,30 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents)
|
| // Sanity check the scenario we just created.
|
| // The visibleContentRect for testLayer is actually 100x100, even though its layout size is 50x50, positioned at 25x25.
|
| LayerImpl* testLayer = root->children()[0];
|
| - EXPECT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), testLayer->visibleContentRect());
|
| + EXPECT_RECT_EQ(gfx::Rect(gfx::Point(), gfx::Size(100, 100)), testLayer->visibleContentRect());
|
| ASSERT_EQ(1u, renderSurfaceLayerList.size());
|
| ASSERT_EQ(1u, root->renderSurface()->layerList().size());
|
|
|
| // Hit testing for a point outside the layer should return a null pointer (the root layer does not draw content, so it will not be hit tested either).
|
| - IntPoint testPoint(101, 101);
|
| + gfx::Point testPoint(101, 101);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(24, 24);
|
| + testPoint = gfx::Point(24, 24);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(76, 76);
|
| + testPoint = gfx::Point(76, 76);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the test layer.
|
| - testPoint = IntPoint(26, 26);
|
| + testPoint = gfx::Point(26, 26);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
|
|
| - testPoint = IntPoint(74, 74);
|
| + testPoint = gfx::Point(74, 74);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(12345, resultLayer->id());
|
| @@ -2993,21 +2993,21 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| + gfx::PointF anchor(0, 0);
|
|
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(1);
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| {
|
| scoped_ptr<LayerImpl> clippingLayer = LayerImpl::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);
|
| + gfx::PointF position(25, 25); // this layer is positioned, and hit testing should correctly know where the layer is located.
|
| + gfx::Size bounds(50, 50);
|
| setLayerPropertiesForTesting(clippingLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| clippingLayer->setMasksToBounds(true);
|
|
|
| scoped_ptr<LayerImpl> child = LayerImpl::create(456);
|
| - position = FloatPoint(-50, -50);
|
| - bounds = IntSize(300, 300);
|
| + position = gfx::PointF(-50, -50);
|
| + bounds = gfx::Size(300, 300);
|
| setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child->setDrawsContent(true);
|
| clippingLayer->addChild(child.Pass());
|
| @@ -3025,22 +3025,22 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
|
|
|
| // Hit testing for a point outside the layer should return a null pointer.
|
| // Despite the child layer being very large, it should be clipped to the root layer's bounds.
|
| - IntPoint testPoint(24, 24);
|
| + gfx::Point testPoint(24, 24);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Even though the layer exists at (101, 101), it should not be visible there since the clippingLayer would clamp it.
|
| - testPoint = IntPoint(76, 76);
|
| + testPoint = gfx::Point(76, 76);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the child layer.
|
| - testPoint = IntPoint(26, 26);
|
| + testPoint = gfx::Point(26, 26);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(456, resultLayer->id());
|
|
|
| - testPoint = IntPoint(74, 74);
|
| + testPoint = gfx::Point(74, 74);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(456, resultLayer->id());
|
| @@ -3063,9 +3063,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(123);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| root->setMasksToBounds(true);
|
|
|
| @@ -3074,16 +3074,16 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| scoped_ptr<LayerImpl> grandChild = LayerImpl::create(789);
|
| scoped_ptr<LayerImpl> rotatedLeaf = LayerImpl::create(2468);
|
|
|
| - position = FloatPoint(10, 10);
|
| - bounds = IntSize(80, 80);
|
| + position = gfx::PointF(10, 10);
|
| + bounds = gfx::Size(80, 80);
|
| setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child->setMasksToBounds(true);
|
|
|
| WebTransformationMatrix rotation45DegreesAboutCorner;
|
| rotation45DegreesAboutCorner.rotate3d(0, 0, 45);
|
|
|
| - position = FloatPoint(0, 0); // remember, positioned with respect to its parent which is already at 10, 10
|
| - bounds = IntSize(200, 200); // to ensure it covers at least sqrt(2) * 100.
|
| + position = gfx::PointF(0, 0); // remember, positioned with respect to its parent which is already at 10, 10
|
| + bounds = gfx::Size(200, 200); // to ensure it covers at least sqrt(2) * 100.
|
| setLayerPropertiesForTesting(grandChild.get(), rotation45DegreesAboutCorner, identityMatrix, anchor, position, bounds, false);
|
| grandChild->setMasksToBounds(true);
|
|
|
| @@ -3094,8 +3094,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| rotatedLeafTransform.translate(50, 50);
|
| rotatedLeafTransform.rotate3d(0, 0, 45);
|
| rotatedLeafTransform.translate(-50, -50);
|
| - position = FloatPoint(0, 0);
|
| - bounds = IntSize(100, 100);
|
| + position = gfx::PointF(0, 0);
|
| + bounds = gfx::Size(100, 100);
|
| setLayerPropertiesForTesting(rotatedLeaf.get(), rotatedLeafTransform, identityMatrix, anchor, position, bounds, false);
|
| rotatedLeaf->setDrawsContent(true);
|
|
|
| @@ -3117,12 +3117,12 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| ASSERT_EQ(2468, renderSurfaceLayerList[1]->renderSurface()->layerList()[0]->id());
|
|
|
| // (11, 89) is close to the the bottom left corner within the clip, but it is not inside the layer.
|
| - IntPoint testPoint(11, 89);
|
| + gfx::Point testPoint(11, 89);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Closer inwards from the bottom left will overlap the layer.
|
| - testPoint = IntPoint(25, 75);
|
| + testPoint = gfx::Point(25, 75);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(2468, resultLayer->id());
|
| @@ -3131,24 +3131,24 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
|
| // clipped away by the grandParent and should not get hit. If hit testing blindly uses
|
| // visibleContentRect without considering how parent may clip the layer, then hit
|
| // testing would accidentally think that the point successfully hits the layer.
|
| - testPoint = IntPoint(4, 50);
|
| + testPoint = gfx::Point(4, 50);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // (11, 50) is inside the layer and within the clipped area.
|
| - testPoint = IntPoint(11, 50);
|
| + testPoint = gfx::Point(11, 50);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(2468, resultLayer->id());
|
|
|
| // Around the middle, just to the right and up, would have hit the layer except that
|
| // that area should be clipped away by the parent.
|
| - testPoint = IntPoint(51, 51);
|
| + testPoint = gfx::Point(51, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Around the middle, just to the left and down, should successfully hit the layer.
|
| - testPoint = IntPoint(49, 51);
|
| + testPoint = gfx::Point(49, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(2468, resultLayer->id());
|
| @@ -3161,15 +3161,15 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
|
| DebugScopedSetImplThread thisScopeIsOnImplThread;
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| + gfx::PointF anchor(0, 0);
|
|
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(1);
|
| - setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
|
| + setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
|
|
| {
|
| scoped_ptr<LayerImpl> intermediateLayer = LayerImpl::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);
|
| + gfx::PointF position(10, 10); // this layer is positioned, and hit testing should correctly know where the layer is located.
|
| + gfx::Size bounds(50, 50);
|
| setLayerPropertiesForTesting(intermediateLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| // Sanity check the intermediate layer should not clip.
|
| ASSERT_FALSE(intermediateLayer->masksToBounds());
|
| @@ -3178,8 +3178,8 @@ TEST(LayerTreeHostCommonTest, 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.
|
| scoped_ptr<LayerImpl> child = LayerImpl::create(456);
|
| - position = FloatPoint(60, 60); // 70, 70 in screen space
|
| - bounds = IntSize(20, 20);
|
| + position = gfx::PointF(60, 60); // 70, 70 in screen space
|
| + bounds = gfx::Size(20, 20);
|
| setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child->setDrawsContent(true);
|
| intermediateLayer->addChild(child.Pass());
|
| @@ -3196,21 +3196,21 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
|
| ASSERT_EQ(456, root->renderSurface()->layerList()[0]->id());
|
|
|
| // Hit testing for a point outside the layer should return a null pointer.
|
| - IntPoint testPoint(69, 69);
|
| + gfx::Point testPoint(69, 69);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| - testPoint = IntPoint(91, 91);
|
| + testPoint = gfx::Point(91, 91);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| EXPECT_FALSE(resultLayer);
|
|
|
| // Hit testing for a point inside should return the child layer.
|
| - testPoint = IntPoint(71, 71);
|
| + testPoint = gfx::Point(71, 71);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(456, resultLayer->id());
|
|
|
| - testPoint = IntPoint(89, 89);
|
| + testPoint = gfx::Point(89, 89);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(456, resultLayer->id());
|
| @@ -3224,9 +3224,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(1);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -3240,20 +3240,20 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
|
| scoped_ptr<LayerImpl> child2 = LayerImpl::create(3);
|
| scoped_ptr<LayerImpl> grandChild1 = LayerImpl::create(4);
|
|
|
| - position = FloatPoint(10, 10);
|
| - bounds = IntSize(50, 50);
|
| + position = gfx::PointF(10, 10);
|
| + bounds = gfx::Size(50, 50);
|
| setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child1->setDrawsContent(true);
|
|
|
| - position = FloatPoint(50, 10);
|
| - bounds = IntSize(50, 50);
|
| + position = gfx::PointF(50, 10);
|
| + bounds = gfx::Size(50, 50);
|
| setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child2->setDrawsContent(true);
|
|
|
| // Remember that grandChild is positioned with respect to its parent (i.e. child1).
|
| // In screen space, the intended position is (10, 50), with size 100 x 50.
|
| - position = FloatPoint(0, 40);
|
| - bounds = IntSize(100, 50);
|
| + position = gfx::PointF(0, 40);
|
| + bounds = gfx::Size(100, 50);
|
| setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| grandChild1->setDrawsContent(true);
|
|
|
| @@ -3282,37 +3282,37 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
|
| ASSERT_EQ(3, root->renderSurface()->layerList()[3]->id()); // child2
|
|
|
| // Nothing overlaps the rootLayer at (1, 1), so hit testing there should find the root layer.
|
| - IntPoint testPoint = IntPoint(1, 1);
|
| + gfx::Point testPoint = gfx::Point(1, 1);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(1, resultLayer->id());
|
|
|
| // At (15, 15), child1 and root are the only layers. child1 is expected to be on top.
|
| - testPoint = IntPoint(15, 15);
|
| + testPoint = gfx::Point(15, 15);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(2, resultLayer->id());
|
|
|
| // At (51, 20), child1 and child2 overlap. child2 is expected to be on top.
|
| - testPoint = IntPoint(51, 20);
|
| + testPoint = gfx::Point(51, 20);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(3, resultLayer->id());
|
|
|
| // At (80, 51), child2 and grandChild1 overlap. child2 is expected to be on top.
|
| - testPoint = IntPoint(80, 51);
|
| + testPoint = gfx::Point(80, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(3, resultLayer->id());
|
|
|
| // At (51, 51), all layers overlap each other. child2 is expected to be on top of all other layers.
|
| - testPoint = IntPoint(51, 51);
|
| + testPoint = gfx::Point(51, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(3, resultLayer->id());
|
|
|
| // At (20, 51), child1 and grandChild1 overlap. grandChild1 is expected to be on top.
|
| - testPoint = IntPoint(20, 51);
|
| + testPoint = gfx::Point(20, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(4, resultLayer->id());
|
| @@ -3329,9 +3329,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(1);
|
|
|
| WebTransformationMatrix identityMatrix;
|
| - FloatPoint anchor(0, 0);
|
| - FloatPoint position(0, 0);
|
| - IntSize bounds(100, 100);
|
| + gfx::PointF anchor(0, 0);
|
| + gfx::PointF position(0, 0);
|
| + gfx::Size bounds(100, 100);
|
| setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| root->setDrawsContent(true);
|
|
|
| @@ -3345,22 +3345,22 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
|
| scoped_ptr<LayerImpl> child2 = LayerImpl::create(3);
|
| scoped_ptr<LayerImpl> grandChild1 = LayerImpl::create(4);
|
|
|
| - position = FloatPoint(10, 10);
|
| - bounds = IntSize(50, 50);
|
| + position = gfx::PointF(10, 10);
|
| + bounds = gfx::Size(50, 50);
|
| setLayerPropertiesForTesting(child1.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child1->setDrawsContent(true);
|
| child1->setForceRenderSurface(true);
|
|
|
| - position = FloatPoint(50, 10);
|
| - bounds = IntSize(50, 50);
|
| + position = gfx::PointF(50, 10);
|
| + bounds = gfx::Size(50, 50);
|
| setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| child2->setDrawsContent(true);
|
| child2->setForceRenderSurface(true);
|
|
|
| // Remember that grandChild is positioned with respect to its parent (i.e. child1).
|
| // In screen space, the intended position is (10, 50), with size 100 x 50.
|
| - position = FloatPoint(0, 40);
|
| - bounds = IntSize(100, 50);
|
| + position = gfx::PointF(0, 40);
|
| + bounds = gfx::Size(100, 50);
|
| setLayerPropertiesForTesting(grandChild1.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
|
| grandChild1->setDrawsContent(true);
|
| grandChild1->setForceRenderSurface(true);
|
| @@ -3396,37 +3396,37 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
|
| ASSERT_EQ(3, renderSurfaceLayerList[3]->id()); // child2
|
|
|
| // Nothing overlaps the rootLayer at (1, 1), so hit testing there should find the root layer.
|
| - IntPoint testPoint = IntPoint(1, 1);
|
| + gfx::Point testPoint = gfx::Point(1, 1);
|
| LayerImpl* resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(1, resultLayer->id());
|
|
|
| // At (15, 15), child1 and root are the only layers. child1 is expected to be on top.
|
| - testPoint = IntPoint(15, 15);
|
| + testPoint = gfx::Point(15, 15);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(2, resultLayer->id());
|
|
|
| // At (51, 20), child1 and child2 overlap. child2 is expected to be on top.
|
| - testPoint = IntPoint(51, 20);
|
| + testPoint = gfx::Point(51, 20);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(3, resultLayer->id());
|
|
|
| // At (80, 51), child2 and grandChild1 overlap. child2 is expected to be on top.
|
| - testPoint = IntPoint(80, 51);
|
| + testPoint = gfx::Point(80, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(3, resultLayer->id());
|
|
|
| // At (51, 51), all layers overlap each other. child2 is expected to be on top of all other layers.
|
| - testPoint = IntPoint(51, 51);
|
| + testPoint = gfx::Point(51, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(3, resultLayer->id());
|
|
|
| // At (20, 51), child1 and grandChild1 overlap. grandChild1 is expected to be on top.
|
| - testPoint = IntPoint(20, 51);
|
| + testPoint = gfx::Point(20, 51);
|
| resultLayer = LayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
|
| ASSERT_TRUE(resultLayer);
|
| EXPECT_EQ(4, resultLayer->id());
|
| @@ -3458,13 +3458,13 @@ TEST(LayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
|
| WebTransformationMatrix identityMatrix;
|
|
|
| scoped_refptr<ContentLayer> parent = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
|
|
| scoped_refptr<ContentLayer> child = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(2, 2), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<NoScaleContentLayer> childNoScale = createNoScaleDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(childNoScale.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(childNoScale.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(2, 2), gfx::Size(10, 10), true);
|
|
|
| parent->addChild(child);
|
| parent->addChild(childNoScale);
|
| @@ -3489,13 +3489,13 @@ TEST(LayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentTransform, parent->drawTransform());
|
|
|
| // Verify results of transformed parent rects
|
| - FloatRect parentContentBounds(FloatPoint(), FloatSize(parent->contentBounds()));
|
| + gfx::RectF parentContentBounds(gfx::PointF(), gfx::SizeF(parent->contentBounds()));
|
|
|
| - FloatRect parentDrawRect = MathUtil::mapClippedRect(parent->drawTransform(), parentContentBounds);
|
| - FloatRect parentScreenSpaceRect = MathUtil::mapClippedRect(parent->screenSpaceTransform(), parentContentBounds);
|
| + gfx::RectF parentDrawRect = MathUtil::mapClippedRect(parent->drawTransform(), parentContentBounds);
|
| + gfx::RectF parentScreenSpaceRect = MathUtil::mapClippedRect(parent->screenSpaceTransform(), parentContentBounds);
|
|
|
| - FloatRect expectedParentDrawRect(FloatPoint(), parent->bounds());
|
| - expectedParentDrawRect.scale(deviceScaleFactor);
|
| + gfx::RectF expectedParentDrawRect(gfx::PointF(), parent->bounds());
|
| + expectedParentDrawRect.Scale(deviceScaleFactor);
|
| EXPECT_FLOAT_RECT_EQ(expectedParentDrawRect, parentDrawRect);
|
| EXPECT_FLOAT_RECT_EQ(expectedParentDrawRect, parentScreenSpaceRect);
|
|
|
| @@ -3506,14 +3506,14 @@ TEST(LayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->screenSpaceTransform());
|
|
|
| // Verify results of transformed child rects
|
| - FloatRect childContentBounds(FloatPoint(), FloatSize(child->contentBounds()));
|
| + gfx::RectF childContentBounds(gfx::PointF(), gfx::SizeF(child->contentBounds()));
|
|
|
| - FloatRect childDrawRect = MathUtil::mapClippedRect(child->drawTransform(), childContentBounds);
|
| - FloatRect childScreenSpaceRect = MathUtil::mapClippedRect(child->screenSpaceTransform(), childContentBounds);
|
| + gfx::RectF childDrawRect = MathUtil::mapClippedRect(child->drawTransform(), childContentBounds);
|
| + gfx::RectF childScreenSpaceRect = MathUtil::mapClippedRect(child->screenSpaceTransform(), childContentBounds);
|
|
|
| - FloatRect expectedChildDrawRect(FloatPoint(), child->bounds());
|
| - expectedChildDrawRect.move(child->position().x(), child->position().y());
|
| - expectedChildDrawRect.scale(deviceScaleFactor);
|
| + gfx::RectF expectedChildDrawRect(gfx::PointF(), child->bounds());
|
| + expectedChildDrawRect.Offset(child->position().x(), child->position().y());
|
| + expectedChildDrawRect.Scale(deviceScaleFactor);
|
| EXPECT_FLOAT_RECT_EQ(expectedChildDrawRect, childDrawRect);
|
| EXPECT_FLOAT_RECT_EQ(expectedChildDrawRect, childScreenSpaceRect);
|
|
|
| @@ -3542,16 +3542,16 @@ TEST(LayerTreeHostCommonTest, verifyContentsScale)
|
| float fixedRasterScale = 2.5;
|
|
|
| scoped_refptr<ContentLayer> parent = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(parent.get(), parentScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true);
|
| + setLayerPropertiesForTesting(parent.get(), parentScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
|
|
| scoped_refptr<ContentLayer> childScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(childScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(childScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(2, 2), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<NoScaleContentLayer> childNoScale = createNoScaleDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(childNoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(12, 12), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(childNoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(12, 12), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<ContentLayer> childNoAutoScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(childNoAutoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(22, 22), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(childNoAutoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(22, 22), gfx::Size(10, 10), true);
|
| childNoAutoScale->setAutomaticallyComputeRasterScale(false);
|
| childNoAutoScale->setRasterScale(fixedRasterScale);
|
|
|
| @@ -3637,36 +3637,36 @@ TEST(LayerTreeHostCommonTest, verifyContentsScaleForSurfaces)
|
| float fixedRasterScale = 4;
|
|
|
| scoped_refptr<ContentLayer> parent = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(parent.get(), parentScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true);
|
| + setLayerPropertiesForTesting(parent.get(), parentScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
|
|
| scoped_refptr<ContentLayer> surfaceScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(2, 2), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<ContentLayer> surfaceScaleChildScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceScaleChildScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceScaleChildScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<NoScaleContentLayer> surfaceScaleChildNoScale = createNoScaleDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceScaleChildNoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceScaleChildNoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<NoScaleContentLayer> surfaceNoScale = createNoScaleDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceNoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(12, 12), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceNoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(12, 12), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<ContentLayer> surfaceNoScaleChildScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceNoScaleChildScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceNoScaleChildScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<NoScaleContentLayer> surfaceNoScaleChildNoScale = createNoScaleDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceNoScaleChildNoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceNoScaleChildNoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<ContentLayer> surfaceNoAutoScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceNoAutoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(22, 22), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceNoAutoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(22, 22), gfx::Size(10, 10), true);
|
| surfaceNoAutoScale->setAutomaticallyComputeRasterScale(false);
|
| surfaceNoAutoScale->setRasterScale(fixedRasterScale);
|
|
|
| scoped_refptr<ContentLayer> surfaceNoAutoScaleChildScale = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceNoAutoScaleChildScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceNoAutoScaleChildScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| scoped_refptr<NoScaleContentLayer> surfaceNoAutoScaleChildNoScale = createNoScaleDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(surfaceNoAutoScaleChildNoScale.get(), childScaleMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(surfaceNoAutoScaleChildNoScale.get(), childScaleMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| // FIXME: Remove this when pageScaleFactor is applied in the compositor.
|
| // Page scale should not apply to the parent.
|
| @@ -3772,20 +3772,20 @@ TEST(LayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
|
| WebTransformationMatrix identityMatrix;
|
|
|
| scoped_refptr<ContentLayer> parent = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(30, 30), true);
|
| + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(30, 30), true);
|
|
|
| scoped_refptr<ContentLayer> child = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(2, 2), gfx::Size(10, 10), true);
|
|
|
| WebTransformationMatrix replicaTransform;
|
| replicaTransform.scaleNonUniform(1, -1);
|
| scoped_refptr<ContentLayer> replica = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(replica.get(), replicaTransform, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(replica.get(), replicaTransform, identityMatrix, gfx::PointF(0, 0), gfx::PointF(2, 2), gfx::Size(10, 10), true);
|
|
|
| // This layer should end up in the same surface as child, with the same draw
|
| // and screen space transforms.
|
| scoped_refptr<ContentLayer> duplicateChildNonOwner = createDrawableContentLayer(&delegate);
|
| - setLayerPropertiesForTesting(duplicateChildNonOwner.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
|
| + setLayerPropertiesForTesting(duplicateChildNonOwner.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 10), true);
|
|
|
| parent->addChild(child);
|
| child->addChild(duplicateChildNonOwner);
|
|
|