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

Unified Diff: cc/CCLayerTreeHostTest.cpp

Issue 10917153: Update cc snapshot to r127918 (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
« no previous file with comments | « cc/CCLayerTreeHostImplTest.cpp ('k') | cc/CCPrioritizedTextureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « cc/CCLayerTreeHostImplTest.cpp ('k') | cc/CCPrioritizedTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698