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

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11017044: Remove root layer specialness in calculateDrawTransforms (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: removed bogus comment Created 8 years, 2 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/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 106a702ef52ee53cd0125a18cb5000c380ed2d78..0c585d79e60aa355743fd2d4e9883d02d850409c 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -1787,19 +1787,20 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
IntSize viewportSize(1000, 1000);
m_hostImpl->setViewportSize(viewportSize, viewportSize);
- m_hostImpl->setRootLayer(BlendStateCheckLayer::create(1, m_hostImpl->resourceProvider()));
- BlendStateCheckLayer* root = static_cast<BlendStateCheckLayer*>(m_hostImpl->rootLayer());
- root->setExpectation(false, true);
- root->setContentsOpaque(true);
+ m_hostImpl->setRootLayer(LayerImpl::create(1));
+ m_hostImpl->rootLayer()->addChild(BlendStateCheckLayer::create(2, m_hostImpl->resourceProvider()));
+ BlendStateCheckLayer* child = static_cast<BlendStateCheckLayer*>(m_hostImpl->rootLayer()->children()[0]);
+ child->setExpectation(false, false);
+ child->setContentsOpaque(true);
// No gutter rects
{
IntRect layerRect(0, 0, 1000, 1000);
- root->setPosition(layerRect.location());
- root->setBounds(layerRect.size());
- root->setContentBounds(layerRect.size());
- root->setQuadRect(IntRect(IntPoint(), layerRect.size()));
- root->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
+ child->setPosition(layerRect.location());
+ child->setBounds(layerRect.size());
+ child->setContentBounds(layerRect.size());
+ child->setQuadRect(IntRect(IntPoint(), layerRect.size()));
+ child->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -1811,18 +1812,18 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
EXPECT_EQ(0u, numGutterQuads);
EXPECT_EQ(1u, frame.renderPasses[0]->quadList().size());
- verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(-layerRect.location(), viewportSize));
+ verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(IntPoint::zero(), viewportSize));
m_hostImpl->didDrawAllLayers(frame);
}
// Empty visible content area (fullscreen gutter rect)
{
IntRect layerRect(0, 0, 0, 0);
- root->setPosition(layerRect.location());
- root->setBounds(layerRect.size());
- root->setContentBounds(layerRect.size());
- root->setQuadRect(IntRect(IntPoint(), layerRect.size()));
- root->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
+ child->setPosition(layerRect.location());
+ child->setBounds(layerRect.size());
+ child->setContentBounds(layerRect.size());
+ child->setQuadRect(IntRect(IntPoint(), layerRect.size()));
+ child->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -1835,18 +1836,18 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
EXPECT_EQ(1u, numGutterQuads);
EXPECT_EQ(1u, frame.renderPasses[0]->quadList().size());
- verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(-layerRect.location(), viewportSize));
+ verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(IntPoint::zero(), viewportSize));
m_hostImpl->didDrawAllLayers(frame);
}
// Content area in middle of clip rect (four surrounding gutter rects)
{
IntRect layerRect(500, 500, 200, 200);
- root->setPosition(layerRect.location());
- root->setBounds(layerRect.size());
- root->setContentBounds(layerRect.size());
- root->setQuadRect(IntRect(IntPoint(), layerRect.size()));
- root->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
+ child->setPosition(layerRect.location());
+ child->setBounds(layerRect.size());
+ child->setContentBounds(layerRect.size());
+ child->setQuadRect(IntRect(IntPoint(), layerRect.size()));
+ child->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -1858,7 +1859,7 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
EXPECT_EQ(4u, numGutterQuads);
EXPECT_EQ(5u, frame.renderPasses[0]->quadList().size());
- verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(-layerRect.location(), viewportSize));
+ verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(IntPoint::zero(), viewportSize));
m_hostImpl->didDrawAllLayers(frame);
}

Powered by Google App Engine
This is Rietveld 408576698