| Index: cc/CCLayerTreeHostCommonTest.cpp
|
| diff --git a/cc/CCLayerTreeHostCommonTest.cpp b/cc/CCLayerTreeHostCommonTest.cpp
|
| index 34c9940a2cb1ac33bb5326ac2ae0dc36655c3719..02df09fd07ef66c713d5410859c6113dfdd4ea0b 100644
|
| --- a/cc/CCLayerTreeHostCommonTest.cpp
|
| +++ b/cc/CCLayerTreeHostCommonTest.cpp
|
| @@ -7,10 +7,10 @@
|
| #include "CCLayerTreeHostCommon.h"
|
|
|
| #include "CCAnimationTestCommon.h"
|
| +#include "CCGeometryTestUtils.h"
|
| #include "CCLayerAnimationController.h"
|
| #include "CCLayerImpl.h"
|
| #include "CCLayerSorter.h"
|
| -#include "CCLayerTreeTestCommon.h"
|
| #include "CCMathUtil.h"
|
| #include "CCProxy.h"
|
| #include "CCSingleThreadProxy.h"
|
| @@ -27,27 +27,6 @@ using namespace WebCore;
|
| using namespace WebKitTests;
|
| using WebKit::WebTransformationMatrix;
|
|
|
| -void WebKitTests::ExpectTransformationMatrixEq(WebTransformationMatrix expected,
|
| - WebTransformationMatrix actual)
|
| -{
|
| - EXPECT_FLOAT_EQ((expected).m11(), (actual).m11());
|
| - EXPECT_FLOAT_EQ((expected).m12(), (actual).m12());
|
| - EXPECT_FLOAT_EQ((expected).m13(), (actual).m13());
|
| - EXPECT_FLOAT_EQ((expected).m14(), (actual).m14());
|
| - EXPECT_FLOAT_EQ((expected).m21(), (actual).m21());
|
| - EXPECT_FLOAT_EQ((expected).m22(), (actual).m22());
|
| - EXPECT_FLOAT_EQ((expected).m23(), (actual).m23());
|
| - EXPECT_FLOAT_EQ((expected).m24(), (actual).m24());
|
| - EXPECT_FLOAT_EQ((expected).m31(), (actual).m31());
|
| - EXPECT_FLOAT_EQ((expected).m32(), (actual).m32());
|
| - EXPECT_FLOAT_EQ((expected).m33(), (actual).m33());
|
| - EXPECT_FLOAT_EQ((expected).m34(), (actual).m34());
|
| - EXPECT_FLOAT_EQ((expected).m41(), (actual).m41());
|
| - EXPECT_FLOAT_EQ((expected).m42(), (actual).m42());
|
| - EXPECT_FLOAT_EQ((expected).m43(), (actual).m43());
|
| - EXPECT_FLOAT_EQ((expected).m44(), (actual).m44());
|
| -}
|
| -
|
| namespace {
|
|
|
| template<typename LayerType>
|
| @@ -1459,9 +1438,9 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableContentRectForLayers)
|
| CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
|
| CCLayerTreeHostCommon::calculateVisibleRects(renderSurfaceLayerList);
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(IntPoint(5, 5), IntSize(10, 10)), grandChild1->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->drawableContentRect());
|
| + 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());
|
| }
|
|
|
| @@ -1531,9 +1510,9 @@ TEST(CCLayerTreeHostCommonTest, 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_INT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild1->renderSurface()->clipRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild2->renderSurface()->clipRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild3->renderSurface()->clipRect());
|
| + 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());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
|
| @@ -1688,7 +1667,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectForIdentityTransform)
|
| IntRect layerContentRect = IntRect(IntPoint(10, 10), IntSize(30, 30));
|
| IntRect expected = IntRect(IntPoint(10, 10), IntSize(30, 30));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Layer is outside the surface rect.
|
| layerContentRect = IntRect(IntPoint(120, 120), IntSize(30, 30));
|
| @@ -1699,7 +1678,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectForIdentityTransform)
|
| layerContentRect = IntRect(IntPoint(80, 80), IntSize(30, 30));
|
| expected = IntRect(IntPoint(80, 80), IntSize(20, 20));
|
| actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyVisibleRectForTranslations)
|
| @@ -1715,7 +1694,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectForTranslations)
|
| layerToSurfaceTransform.translate(10, 10);
|
| IntRect expected = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Layer is outside the surface rect.
|
| layerToSurfaceTransform.makeIdentity();
|
| @@ -1728,7 +1707,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectForTranslations)
|
| layerToSurfaceTransform.translate(80, 80);
|
| expected = IntRect(IntPoint(0, 0), IntSize(20, 20));
|
| actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| @@ -1746,7 +1725,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| layerToSurfaceTransform.rotate(45);
|
| IntRect expected = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Layer is outside the surface rect.
|
| layerToSurfaceTransform.makeIdentity();
|
| @@ -1764,7 +1743,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| layerToSurfaceTransform.rotate(45);
|
| expected = IntRect(IntPoint(0, 0), IntSize(30, 30));
|
| actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 4: The layer is rotated about its top-left corner, and translated upwards. In
|
| // surface space, the layer is oriented diagonally, with only the top corner
|
| @@ -1776,7 +1755,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor2DRotations)
|
| layerToSurfaceTransform.rotate(45);
|
| expected = IntRect(IntPoint(15, 0), IntSize(15, 30)); // right half of layer bounds.
|
| actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicTransform)
|
| @@ -1792,7 +1771,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicTransform)
|
| layerToSurfaceTransform.rotate3d(0, 45, 0);
|
| IntRect expected = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: Orthographic projection of a layer rotated about y-axis by 45 degrees, but
|
| // shifted to the side so only the right-half the layer would be visible on
|
| @@ -1803,7 +1782,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicTransform)
|
| 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.
|
| actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveTransform)
|
| @@ -1830,7 +1809,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveTransform)
|
|
|
| IntRect expected = IntRect(IntPoint(-50, -50), IntSize(200, 200));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
|
|
| // Case 2: same projection as before, except that the layer is also translated to the
|
| // side, so that only the right half of the layer should be visible.
|
| @@ -1843,7 +1822,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveTransform)
|
| layerToSurfaceTransform.translate3d(-200, 0, 0);
|
| expected = IntRect(IntPoint(50, -50), IntSize(100, 200)); // The right half of the layer's bounding rect.
|
| actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicIsNotClippedBehindSurface)
|
| @@ -1866,7 +1845,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicIsNotClippedBe
|
|
|
| IntRect expected = IntRect(IntPoint(0, 0), IntSize(100, 100));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveWhenClippedByW)
|
| @@ -1932,7 +1911,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectForPerspectiveUnprojection)
|
| // that the entire layer should still be considered visible.
|
| IntRect expected = IntRect(IntPoint(-10, -10), IntSize(20, 20));
|
| IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
|
| - EXPECT_INT_RECT_EQ(expected, actual);
|
| + EXPECT_RECT_EQ(expected, actual);
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSimpleLayers)
|
| @@ -1953,21 +1932,21 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSimpleLay
|
|
|
| executeCalculateDrawTransformsAndVisibility(root.get());
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
|
|
| // layer visibleContentRects are clipped by their targetSurface
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 25, 25), child2->visibleContentRect());
|
| + 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());
|
|
|
| // layer drawableContentRects are not clipped.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child1->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + 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());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersClippedByLayer)
|
| @@ -1994,21 +1973,21 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersCli
|
|
|
| ASSERT_FALSE(child->renderSurface());
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), child->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), child->visibleContentRect());
|
|
|
| // All grandchild visibleContentRects should be clipped by child.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), grandChild1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 25, 25), grandChild2->visibleContentRect());
|
| + 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());
|
|
|
| // All grandchild drawableContentRects should also be clipped by child.
|
| - EXPECT_INT_RECT_EQ(IntRect(5, 5, 50, 50), grandChild1->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(75, 75, 25, 25), grandChild2->drawableContentRect());
|
| + 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());
|
| }
|
|
|
| @@ -2036,24 +2015,24 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInU
|
|
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
|
|
| // An unclipped surface grows its drawableContentRect to include all drawable regions of the subtree.
|
| - EXPECT_INT_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into the unclipped surface are also unclipped.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child2->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child3->visibleContentRect());
|
| + 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_INT_RECT_EQ(IntRect(5, 5, 50, 50), child1->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + 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());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInClippedRenderSurface)
|
| @@ -2081,26 +2060,26 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInC
|
|
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(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_INT_RECT_EQ(IntRect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into the surface have their visibleContentRect clipped by the surface clipRect.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 25, 25), child2->visibleContentRect());
|
| + 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());
|
|
|
| // But the drawableContentRects are unclipped.
|
| - EXPECT_INT_RECT_EQ(IntRect(5, 5, 50, 50), child1->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + 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());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHierarchy)
|
| @@ -2134,32 +2113,32 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHi
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
| ASSERT_TRUE(renderSurface2->renderSurface());
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface2->visibleContentRect());
|
| + 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());
|
|
|
| // A clipped surface grows its drawableContentRect to include all drawable regions of the subtree,
|
| // but also gets clamped by the ancestor's clip.
|
| - EXPECT_INT_RECT_EQ(IntRect(5, 5, 95, 95), renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(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_INT_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface2->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface2->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into renderSurface2 think they are unclipped.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child2->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child3->visibleContentRect());
|
| + 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());
|
|
|
| // drawableContentRects are also unclipped.
|
| - EXPECT_INT_RECT_EQ(IntRect(5, 5, 50, 50), child1->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(75, 75, 50, 50), child2->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(125, 125, 50, 50), child3->drawableContentRect());
|
| + 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());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransformOnUnclippedSurface)
|
| @@ -2185,21 +2164,21 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransfor
|
|
|
| ASSERT_TRUE(renderSurface1->renderSurface());
|
|
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->drawableContentRect());
|
|
|
| // Layers that do not draw content should have empty visibleContentRects.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 0, 0), renderSurface1->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), root->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(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);
|
| - EXPECT_INT_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
|
| + EXPECT_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
|
|
|
| // All layers that draw content into the unclipped surface are also unclipped.
|
| - EXPECT_INT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| - EXPECT_INT_RECT_EQ(expectedSurfaceDrawableContent, child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(expectedSurfaceDrawableContent, child1->drawableContentRect());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransformOnClippedSurface)
|
| @@ -2230,15 +2209,15 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransfor
|
| 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));
|
| - EXPECT_INT_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
|
| + 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_INT_RECT_EQ(IntRect(0, 0, 26, 50), child1->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(0, 0, 26, 50), child1->visibleContentRect());
|
|
|
| // The child's drawableContentRect is unclipped.
|
| - EXPECT_INT_RECT_EQ(unclippedSurfaceContent, child1->drawableContentRect());
|
| + EXPECT_RECT_EQ(unclippedSurfaceContent, child1->drawableContentRect());
|
| }
|
|
|
| TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithoutPreserves3d)
|
| @@ -2881,7 +2860,7 @@ TEST(CCLayerTreeHostCommonTest, 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.
|
| CCLayerImpl* testLayer = root->children()[0].get();
|
| - EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), testLayer->visibleContentRect());
|
| + EXPECT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), testLayer->visibleContentRect());
|
| ASSERT_EQ(1u, renderSurfaceLayerList.size());
|
| ASSERT_EQ(1u, root->renderSurface()->layerList().size());
|
|
|
| @@ -3502,7 +3481,7 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
|
| WebTransformationMatrix expectedDuplicateChildDrawTransform = child->drawTransform();
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(child->drawTransform(), duplicateChildNonOwner->drawTransform());
|
| EXPECT_TRANSFORMATION_MATRIX_EQ(child->screenSpaceTransform(), duplicateChildNonOwner->screenSpaceTransform());
|
| - EXPECT_INT_RECT_EQ(child->drawableContentRect(), duplicateChildNonOwner->drawableContentRect());
|
| + EXPECT_RECT_EQ(child->drawableContentRect(), duplicateChildNonOwner->drawableContentRect());
|
| EXPECT_EQ(child->contentBounds(), duplicateChildNonOwner->contentBounds());
|
|
|
| WebTransformationMatrix expectedRenderSurfaceDrawTransform;
|
|
|