Index: cc/layer_tree_host_impl_unittest.cc |
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc |
index 484a0783de605863b43f483121b71b537a4b8955..ba4523a37a0796cddb88144d56304587b84342b9 100644 |
--- a/cc/layer_tree_host_impl_unittest.cc |
+++ b/cc/layer_tree_host_impl_unittest.cc |
@@ -1255,22 +1255,22 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread) |
// the moment we avoid that because skia does exact bit-wise equality |
// checking that does not consider -0 == +0. |
// http://code.google.com/p/chromium/issues/detail?id=162747 |
- EXPECT_EQ(1.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(0, 0)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(0, 1)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(0, 2)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(0, 3)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(1, 0)); |
- EXPECT_EQ(1.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(1, 1)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(1, 2)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(1, 3)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(2, 0)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(2, 1)); |
- EXPECT_EQ(1.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(2, 2)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(2, 3)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(3, 0)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(3, 1)); |
- EXPECT_EQ(0.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(3, 2)); |
- EXPECT_EQ(1.0, m_hostImpl->rootLayer()->implTransform().matrix().getDouble(3, 3)); |
+ EXPECT_EQ(1.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(0, 0)); |
enne (OOO)
2012/12/13 16:42:26
Don't we have some matrix equal macro that you can
wjmaclean
2012/12/13 16:57:05
You can just compare two matrices, if you can get
enne (OOO)
2012/12/13 17:00:54
Then the macro should be fixed to be resilient to
|
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(0, 1)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(0, 2)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(0, 3)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(1, 0)); |
+ EXPECT_EQ(1.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(1, 1)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(1, 2)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(1, 3)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(2, 0)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(2, 1)); |
+ EXPECT_EQ(1.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(2, 2)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(2, 3)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(3, 0)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(3, 1)); |
+ EXPECT_EQ(0.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(3, 2)); |
+ EXPECT_EQ(1.0, m_hostImpl->rootScrollLayer()->implTransform().matrix().getDouble(3, 3)); |
} |
TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread) |
@@ -1306,7 +1306,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread) |
// The page scale delta should match the new scale on the impl side. |
gfx::Transform expectedScale; |
expectedScale.Scale(pageScale, pageScale); |
- EXPECT_EQ(m_hostImpl->rootLayer()->implTransform(), expectedScale); |
+ EXPECT_EQ(m_hostImpl->rootScrollLayer()->implTransform(), expectedScale); |
} |
TEST_P(LayerTreeHostImplTest, pageScaleDeltaAppliedToRootScrollLayerOnly) |
@@ -4562,7 +4562,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportForcesCommitRedraw(const float d |
expectedImplTransform.Scale(pageScale, pageScale); |
// Verify the pinch zoom took place. |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// The implTransform ignores the scroll if !pageScalePinchZoomEnabled, |
// so no point in continuing without it. |
@@ -4633,7 +4633,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportTest(const float deviceScaleFact |
gfx::Transform expectedImplTransform; |
expectedImplTransform.Scale(pageScale, pageScale); |
- EXPECT_EQ(m_hostImpl->rootLayer()->implTransform(), expectedImplTransform); |
+ EXPECT_EQ(m_hostImpl->rootScrollLayer()->implTransform(), expectedImplTransform); |
// The implTransform ignores the scroll if !pageScalePinchZoomEnabled, |
// so no point in continuing without it. |
@@ -4650,7 +4650,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportTest(const float deviceScaleFact |
gfx::Vector2dF expectedTranslation = gfx::ScaleVector2d(scrollDelta, m_hostImpl->deviceScaleFactor()); |
expectedImplTransform.Translate(-expectedTranslation.x(), -expectedTranslation.y()); |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// No change expected. |
EXPECT_EQ(expectedMaxScroll, m_hostImpl->rootLayer()->maxScrollOffset()); |
// None of the scroll delta should have been used for document scroll. |
@@ -4667,7 +4667,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportTest(const float deviceScaleFact |
expectedTranslation = gfx::ScaleVector2d(scrollDelta, m_hostImpl->deviceScaleFactor()); |
expectedImplTransform.Translate(-expectedTranslation.x(), -expectedTranslation.y()); |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// No change expected. |
EXPECT_EQ(expectedMaxScroll, m_hostImpl->rootLayer()->maxScrollOffset()); |
// None of the scroll delta should have been used for document scroll. |
@@ -4713,7 +4713,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device |
gfx::Transform expectedImplTransform; |
expectedImplTransform.Scale(pageScale, pageScale); |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// The implTransform ignores the scroll if !pageScalePinchZoomEnabled, |
// so no point in continuing without it. |
@@ -4736,7 +4736,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device |
EXPECT_EQ(expectedMaxScroll, m_hostImpl->rootLayer()->maxScrollOffset()); |
// Verify we did not change the implTransform this time. |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// Further scrolling should move the pinchZoomViewport only. |
scrollDelta = gfx::Vector2d(2, 0); |
@@ -4749,7 +4749,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device |
gfx::Vector2dF expectedTranslation = gfx::ScaleVector2d(expectedPanDelta, m_hostImpl->deviceScaleFactor()); |
expectedImplTransform.Translate(-expectedTranslation.x(), -expectedTranslation.y()); |
- EXPECT_EQ(m_hostImpl->rootLayer()->implTransform(), expectedImplTransform); |
+ EXPECT_EQ(m_hostImpl->rootScrollLayer()->implTransform(), expectedImplTransform); |
// The scroll delta on the main thread should not have been affected by this. |
scrollInfo = m_hostImpl->processScrollDeltas(); |
@@ -4771,7 +4771,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device |
EXPECT_EQ(expectedMaxScroll, m_hostImpl->rootLayer()->maxScrollOffset()); |
// Verify we did not change the implTransform this time. |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// pinchZoomViewport scroll only. |
scrollDelta = gfx::Vector2d(0, 1); |
@@ -4784,7 +4784,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device |
expectedTranslation = gfx::ScaleVector2d(expectedPanDelta, m_hostImpl->deviceScaleFactor()); |
expectedImplTransform.Translate(-expectedTranslation.x(), -expectedTranslation.y()); |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// The scroll delta on the main thread should not have been affected by this. |
scrollInfo = m_hostImpl->processScrollDeltas(); |
@@ -4832,7 +4832,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollBoundaryTest(const floa |
gfx::Transform expectedImplTransform; |
expectedImplTransform.Scale(pageScale, pageScale); |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
// The implTransform ignores the scroll if !pageScalePinchZoomEnabled, |
// so no point in continuing without it. |
@@ -4858,7 +4858,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollBoundaryTest(const floa |
gfx::Vector2dF expectedTranslation = gfx::ScaleVector2d(expectedPanDelta, m_hostImpl->deviceScaleFactor()); |
expectedImplTransform.Translate(-expectedTranslation.x(), -expectedTranslation.y()); |
- EXPECT_EQ(m_hostImpl->rootLayer()->implTransform(), expectedImplTransform); |
+ EXPECT_EQ(m_hostImpl->rootScrollLayer()->implTransform(), expectedImplTransform); |
// Perform same test sequence in y-direction also. |
scrollDelta = gfx::Vector2d(0, 5); |
@@ -4877,7 +4877,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollBoundaryTest(const floa |
expectedTranslation = gfx::ScaleVector2d(expectedPanDelta, m_hostImpl->deviceScaleFactor()); |
expectedImplTransform.Translate(-expectedTranslation.x(), -expectedTranslation.y()); |
- EXPECT_EQ(expectedImplTransform, m_hostImpl->rootLayer()->implTransform()); |
+ EXPECT_EQ(expectedImplTransform, m_hostImpl->rootScrollLayer()->implTransform()); |
} |
TEST_P(LayerTreeHostImplTest, pinchZoomPanViewportAndScrollBoundaryWithDeviceScaleFactor) |