| Index: cc/CCLayerTreeHostTest.cpp
|
| diff --git a/cc/CCLayerTreeHostTest.cpp b/cc/CCLayerTreeHostTest.cpp
|
| index 489de8654b389ffca1b97df1dbb1e87facd97d6e..086c932d69da9804c3fe5da989e440117051b5f4 100644
|
| --- a/cc/CCLayerTreeHostTest.cpp
|
| +++ b/cc/CCLayerTreeHostTest.cpp
|
| @@ -1259,11 +1259,22 @@ public:
|
| void notifySyncRequired() { }
|
| };
|
|
|
| +class NoScaleContentLayerChromium : public ContentLayerChromium {
|
| +public:
|
| + static PassRefPtr<NoScaleContentLayerChromium> create(ContentLayerChromiumClient* client) { return adoptRef(new NoScaleContentLayerChromium(client)); }
|
| +
|
| + virtual bool needsContentsScale() const OVERRIDE { return false; }
|
| +
|
| +private:
|
| + explicit NoScaleContentLayerChromium(ContentLayerChromiumClient* client)
|
| + : ContentLayerChromium(client) { }
|
| +};
|
| +
|
| class CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : public CCLayerTreeHostTest {
|
| public:
|
|
|
| CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers()
|
| - : m_rootLayer(ContentLayerChromium::create(&m_client))
|
| + : m_rootLayer(NoScaleContentLayerChromium::create(&m_client))
|
| , m_childLayer(ContentLayerChromium::create(&m_client))
|
| {
|
| }
|
| @@ -1325,6 +1336,11 @@ public:
|
| // The root render surface is the size of the viewport.
|
| EXPECT_RECT_EQ(IntRect(0, 0, 60, 60), root->renderSurface()->contentRect());
|
|
|
| + // The content bounds of the child should be scaled.
|
| + IntSize childBoundsScaled = child->bounds();
|
| + childBoundsScaled.scale(1.5);
|
| + EXPECT_EQ(childBoundsScaled, child->contentBounds());
|
| +
|
| WebTransformationMatrix scaleTransform;
|
| scaleTransform.scale(impl->deviceScaleFactor());
|
|
|
| @@ -1335,11 +1351,10 @@ public:
|
| EXPECT_EQ(rootDrawTransform, root->drawTransform());
|
| EXPECT_EQ(rootScreenSpaceTransform, root->screenSpaceTransform());
|
|
|
| - // The child is at position 2,2, so translate by 2,2 before applying the scale by 2x.
|
| - WebTransformationMatrix childScreenSpaceTransform = scaleTransform;
|
| - childScreenSpaceTransform.translate(2, 2);
|
| - WebTransformationMatrix childDrawTransform = scaleTransform;
|
| - childDrawTransform.translate(2, 2);
|
| + // The child is at position 2,2, which is transformed to 3,3 after the scale
|
| + WebTransformationMatrix childScreenSpaceTransform;
|
| + childScreenSpaceTransform.translate(3, 3);
|
| + WebTransformationMatrix childDrawTransform = childScreenSpaceTransform;
|
|
|
| EXPECT_EQ(childDrawTransform, child->drawTransform());
|
| EXPECT_EQ(childScreenSpaceTransform, child->screenSpaceTransform());
|
| @@ -1355,7 +1370,7 @@ public:
|
|
|
| private:
|
| MockContentLayerChromiumClient m_client;
|
| - RefPtr<ContentLayerChromium> m_rootLayer;
|
| + RefPtr<NoScaleContentLayerChromium> m_rootLayer;
|
| RefPtr<ContentLayerChromium> m_childLayer;
|
| };
|
|
|
| @@ -2334,8 +2349,8 @@ public:
|
| virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* hostImpl) OVERRIDE
|
| {
|
| CCRenderer* renderer = hostImpl->renderer();
|
| - unsigned surface1RenderPassId = hostImpl->rootLayer()->children()[0]->id();
|
| - unsigned surface2RenderPassId = hostImpl->rootLayer()->children()[0]->children()[0]->id();
|
| + CCRenderPass::Id surface1RenderPassId = hostImpl->rootLayer()->children()[0]->renderSurface()->renderPassId();
|
| + CCRenderPass::Id surface2RenderPassId = hostImpl->rootLayer()->children()[0]->children()[0]->renderSurface()->renderPassId();
|
|
|
| switch (hostImpl->sourceFrameNumber()) {
|
| case 0:
|
|
|