summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
commit815f1ed417bd26fbe2abbdf20ac5d3423b30796c (patch)
tree923c9a9e2834ccab60f5caecfb8f0ac410c1dd9e /Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
parentb4ad5d9d2b96baacd0180ead50de5195ca78af2d (diff)
downloadqtwebkit-815f1ed417bd26fbe2abbdf20ac5d3423b30796c.tar.gz
Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308)
New snapshot with better configure tests
Diffstat (limited to 'Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
index 9433d89da..9aa412090 100644
--- a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
@@ -311,11 +311,9 @@ TEST_F(CCDamageTrackerTest, verifyDamageForTransformedLayer)
WebTransformationMatrix rotation;
rotation.rotate(45);
- // Note carefully, the anchor is actually part of layer->position(). By setting anchor
- // to (0.5, 0.5), the layer's position (100, 100) now refers to the center of the
- // layer, not the corner. This means the layer has actually changed position.
clearDamageForAllSurfaces(root.get());
child->setAnchorPoint(FloatPoint(0.5, 0.5));
+ child->setPosition(FloatPoint(85, 85));
emulateDrawingOneFrame(root.get());
// Sanity check that the layer actually moved to (85, 85), damaging its old location and new location.
@@ -331,8 +329,8 @@ TEST_F(CCDamageTrackerTest, verifyDamageForTransformedLayer)
// Since the child layer is square, rotation by 45 degrees about the center should
// increase the size of the expected rect by sqrt(2), centered around (100, 100). The
// old exposed region should be fully contained in the new region.
- double expectedWidth = 30.0 * sqrt(2.0);
- double expectedPosition = 100.0 - 0.5 * expectedWidth;
+ double expectedWidth = 30 * sqrt(2.0);
+ double expectedPosition = 100 - 0.5 * expectedWidth;
FloatRect expectedRect(expectedPosition, expectedPosition, expectedWidth, expectedWidth);
rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect();
EXPECT_FLOAT_RECT_EQ(expectedRect, rootDamageRect);
@@ -828,7 +826,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
grandChild1Replica->setPosition(FloatPoint::zero());
grandChild1Replica->setAnchorPoint(FloatPoint::zero());
WebTransformationMatrix reflection;
- reflection.scale3d(-1.0, 1.0, 1.0);
+ reflection.scale3d(-1, 1, 1);
grandChild1Replica->setTransform(reflection);
grandChild1->setReplicaLayer(grandChild1Replica.release());
}
@@ -848,7 +846,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
// areas to be damaged on the target.
clearDamageForAllSurfaces(root.get());
IntRect oldContentRect = child1->renderSurface()->contentRect();
- grandChild1->setPosition(FloatPoint(195.0, 205.0));
+ grandChild1->setPosition(FloatPoint(195, 205));
emulateDrawingOneFrame(root.get());
ASSERT_EQ(oldContentRect.width(), child1->renderSurface()->contentRect().width());
ASSERT_EQ(oldContentRect.height(), child1->renderSurface()->contentRect().height());
@@ -904,7 +902,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
child->setOpacity(0.5);
{
OwnPtr<CCLayerImpl> grandChild = CCLayerImpl::create(4);
- grandChild->setPosition(FloatPoint(2.0, 2.0));
+ grandChild->setPosition(FloatPoint(2, 2));
grandChild->setAnchorPoint(FloatPoint::zero());
grandChild->setBounds(IntSize(2, 2));
grandChild->setDrawsContent(true);
@@ -979,7 +977,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
grandChild1Replica->setPosition(FloatPoint::zero());
grandChild1Replica->setAnchorPoint(FloatPoint::zero());
WebTransformationMatrix reflection;
- reflection.scale3d(-1.0, 1.0, 1.0);
+ reflection.scale3d(-1, 1, 1);
grandChild1Replica->setTransform(reflection);
grandChild1->setReplicaLayer(grandChild1Replica.release());
}
@@ -1030,20 +1028,17 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
CCLayerImpl* child1 = root->children()[0].get();
CCLayerImpl* grandChild1 = child1->children()[0].get();
- // Verify that the correct replicaOriginTransform is used for the replicaMask; the
- // incorrect old code incorrectly accounted for the anchor for the replica. A
- // non-zero anchor point should not affect the replica reflection.
-
+ // Verify that the correct replicaOriginTransform is used for the replicaMask;
clearDamageForAllSurfaces(root.get());
- grandChild1->setAnchorPoint(FloatPoint(1.0, 0.0)); // This is the anchor being tested.
+ grandChild1->setAnchorPoint(FloatPoint(1, 0)); // This is not exactly the anchor being tested, but by convention its expected to be the same as the replica's anchor point.
{
OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6);
grandChild1Replica->setPosition(FloatPoint::zero());
- grandChild1Replica->setAnchorPoint(FloatPoint::zero()); // note, this is not the anchor being tested.
+ grandChild1Replica->setAnchorPoint(FloatPoint(1, 0)); // This is the anchor being tested.
WebTransformationMatrix reflection;
- reflection.scale3d(-1.0, 1.0, 1.0);
+ reflection.scale3d(-1, 1, 1);
grandChild1Replica->setTransform(reflection);
grandChild1->setReplicaLayer(grandChild1Replica.release());
}
@@ -1071,7 +1066,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
emulateDrawingOneFrame(root.get());
FloatRect childDamageRect = child1->renderSurface()->damageTracker()->currentDamageRect();
- EXPECT_FLOAT_RECT_EQ(FloatRect(194, 200, 6, 8), childDamageRect);
+ EXPECT_FLOAT_RECT_EQ(FloatRect(206, 200, 6, 8), childDamageRect);
}
TEST_F(CCDamageTrackerTest, verifyDamageWhenForcedFullDamage)