Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2064)

Unified Diff: cc/CCLayerTreeHostCommonTest.cpp

Issue 10989028: cc: Remove WebCore dependecies from CCRenderPass and CCDrawQuad classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/CCLayerTreeHostCommonTest.cpp
diff --git a/cc/CCLayerTreeHostCommonTest.cpp b/cc/CCLayerTreeHostCommonTest.cpp
index f073976beca4d499e0fcdccbfa4556dc55518f2b..d8fb210a80b9668ecd48bd5e023fa9efb9ea444d 100644
--- a/cc/CCLayerTreeHostCommonTest.cpp
+++ b/cc/CCLayerTreeHostCommonTest.cpp
@@ -1948,7 +1948,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSimpleLay
executeCalculateDrawTransformsAndVisibility(root.get());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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.
@@ -1989,7 +1989,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersCli
ASSERT_FALSE(child->renderSurface());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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.
@@ -2031,7 +2031,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInU
ASSERT_TRUE(renderSurface1->renderSurface());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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.
@@ -2039,7 +2039,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInU
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_RECT_EQ(IntRect(5, 5, 170, 170), renderSurface1->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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());
@@ -2076,8 +2076,8 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInC
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_FLOAT_RECT_EQ(FloatRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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());
@@ -2085,7 +2085,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForLayersInC
// 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_FLOAT_RECT_EQ(FloatRect(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());
@@ -2129,7 +2129,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHi
ASSERT_TRUE(renderSurface1->renderSurface());
ASSERT_TRUE(renderSurface2->renderSurface());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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.
@@ -2139,12 +2139,12 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsForSurfaceHi
// 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_FLOAT_RECT_EQ(FloatRect(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_FLOAT_RECT_EQ(FloatRect(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());
@@ -2180,7 +2180,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransfor
ASSERT_TRUE(renderSurface1->renderSurface());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), root->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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.
@@ -2190,7 +2190,7 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransfor
// 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_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
+ EXPECT_FLOAT_RECT_EQ(FloatRect(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());
@@ -2224,8 +2224,8 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsWithTransfor
// 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));
- EXPECT_RECT_EQ(expectedSurfaceDrawableContent, renderSurface1->renderSurface()->drawableContentRect());
+ FloatRect expectedSurfaceDrawableContent = intersection(unclippedSurfaceContent, FloatRect(0, 0, 50, 50));
+ EXPECT_FLOAT_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
@@ -2277,13 +2277,13 @@ TEST(CCLayerTreeHostCommonTest, 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_FLOAT_RECT_EQ(FloatRect(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_FLOAT_RECT_EQ(FloatRect(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_FLOAT_RECT_EQ(FloatRect(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());
« no previous file with comments | « cc/CCIOSurfaceDrawQuad.cpp ('k') | cc/CCLayerTreeHostImpl.cpp » ('j') | cc/scoped_ptr_hash_map.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698