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

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11704003: cc: Move more functionality from host to LayerTreeImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 af6082d5d674291520c12615206b4276dd5107f5..c8f05f28ed8bb5fc0e27207aca77fa5a77823dfe 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -123,7 +123,7 @@ public:
root->setContentBounds(gfx::Size(10, 10));
root->setDrawsContent(true);
root->drawProperties().visible_content_rect = gfx::Rect(0, 0, 10, 10);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
}
static void expectClearedScrollDeltasRecursive(LayerImpl* layer)
@@ -178,7 +178,7 @@ public:
contents->setPosition(gfx::PointF(0, 0));
contents->setAnchorPoint(gfx::PointF(0, 0));
root->addChild(contents.Pass());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
}
scoped_ptr<LayerImpl> createScrollableLayer(int id, const gfx::Size& size)
@@ -246,7 +246,7 @@ TEST_P(LayerTreeHostImplTest, notifyIfCanDrawChanged)
m_onCanDrawStateChangedCalled = false;
// Toggle the root layer to make sure it toggles canDraw
- m_hostImpl->setRootLayer(scoped_ptr<LayerImpl>());
+ m_hostImpl->activeTree()->SetRootLayer(scoped_ptr<LayerImpl>());
EXPECT_FALSE(m_hostImpl->canDraw());
EXPECT_TRUE(m_onCanDrawStateChangedCalled);
m_onCanDrawStateChangedCalled = false;
@@ -307,7 +307,7 @@ TEST_P(LayerTreeHostImplTest, scrollDeltaTreeButNoChanges)
root->children()[1]->addChild(LayerImpl::create(m_hostImpl->activeTree(), 4));
root->children()[1]->addChild(LayerImpl::create(m_hostImpl->activeTree(), 5));
root->children()[1]->children()[0]->addChild(LayerImpl::create(m_hostImpl->activeTree(), 6));
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
}
LayerImpl* root = m_hostImpl->rootLayer();
@@ -334,7 +334,7 @@ TEST_P(LayerTreeHostImplTest, scrollDeltaRepeatedScrolls)
root->setScrollable(true);
root->setMaxScrollOffset(gfx::Vector2d(100, 100));
root->scrollBy(scrollDelta);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
}
LayerImpl* root = m_hostImpl->rootLayer();
@@ -401,7 +401,7 @@ TEST_P(LayerTreeHostImplTest, replaceTreeWhileScrolling)
// We should not crash if the tree is replaced while we are scrolling.
EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(0, 0), InputHandlerClient::Wheel), InputHandlerClient::ScrollStarted);
- m_hostImpl->detachLayerTree();
+ m_hostImpl->activeTree()->DetachLayerTree();
setupScrollAndContentsLayers(gfx::Size(100, 100));
@@ -934,7 +934,7 @@ TEST_P(LayerTreeHostImplTest, didDrawNotCalledOnHiddenLayer)
{
// The root layer is always drawn, so run this test on a child layer that
// will be masked out by the root layer's bounds.
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->setMasksToBounds(true);
@@ -980,7 +980,7 @@ TEST_P(LayerTreeHostImplTest, willDrawNotCalledOnOccludedLayer)
gfx::Size bigSize(1000, 1000);
m_hostImpl->setViewportSize(bigSize, bigSize);
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 2));
@@ -1012,7 +1012,7 @@ TEST_P(LayerTreeHostImplTest, willDrawNotCalledOnOccludedLayer)
TEST_P(LayerTreeHostImplTest, didDrawCalledOnAllLayers)
{
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 2));
@@ -1068,7 +1068,7 @@ private:
TEST_P(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard)
{
// When the texture is not missing, we draw as usual.
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 1));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(MissingTextureAnimatingLayer::create(m_hostImpl->activeTree(), 2, false, false, true, m_hostImpl->resourceProvider()));
@@ -1079,7 +1079,7 @@ TEST_P(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard)
m_hostImpl->didDrawAllLayers(frame);
// When a texture is missing and we're not animating, we draw as usual with checkerboarding.
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 3));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 3));
root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(MissingTextureAnimatingLayer::create(m_hostImpl->activeTree(), 4, true, false, false, m_hostImpl->resourceProvider()));
@@ -1088,7 +1088,7 @@ TEST_P(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard)
m_hostImpl->didDrawAllLayers(frame);
// When a texture is missing and we're animating, we don't want to draw anything.
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 5));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 5));
root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(MissingTextureAnimatingLayer::create(m_hostImpl->activeTree(), 6, true, false, true, m_hostImpl->resourceProvider()));
@@ -1097,7 +1097,7 @@ TEST_P(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard)
m_hostImpl->didDrawAllLayers(frame);
// When the layer skips draw and we're animating, we still draw the frame.
- m_hostImpl->setRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 7));
+ m_hostImpl->activeTree()->SetRootLayer(DidDrawCheckLayer::create(m_hostImpl->activeTree(), 7));
root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(MissingTextureAnimatingLayer::create(m_hostImpl->activeTree(), 8, false, true, true, m_hostImpl->resourceProvider()));
@@ -1110,7 +1110,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootIgnored)
{
scoped_ptr<LayerImpl> root = LayerImpl::create(m_hostImpl->activeTree(), 1);
root->setScrollable(false);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
initializeRendererAndDrawFrame();
// Scroll event is ignored because layer is not scrollable.
@@ -1142,7 +1142,7 @@ TEST_P(LayerTreeHostImplTest, scrollNonCompositedRoot)
scrollLayer->setAnchorPoint(gfx::PointF(0, 0));
scrollLayer->addChild(contentLayer.Pass());
- m_hostImpl->setRootLayer(scrollLayer.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(scrollLayer.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1160,7 +1160,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildCallsCommitAndRedraw)
root->setBounds(surfaceSize);
root->setContentBounds(surfaceSize);
root->addChild(createScrollableLayer(2, surfaceSize));
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1176,7 +1176,7 @@ TEST_P(LayerTreeHostImplTest, scrollMissesChild)
gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = LayerImpl::create(m_hostImpl->activeTree(), 1);
root->addChild(createScrollableLayer(2, surfaceSize));
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1199,7 +1199,7 @@ TEST_P(LayerTreeHostImplTest, scrollMissesBackfacingChild)
child->setDoubleSided(false);
root->addChild(child.Pass());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
initializeRendererAndDrawFrame();
// Scroll event is ignored because the scrollable layer is not facing the viewer and there is
@@ -1219,7 +1219,7 @@ TEST_P(LayerTreeHostImplTest, scrollBlockedByContentLayer)
scoped_ptr<LayerImpl> scrollLayer = createScrollableLayer(2, surfaceSize);
scrollLayer->addChild(contentLayer.Pass());
- m_hostImpl->setRootLayer(scrollLayer.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(scrollLayer.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1232,7 +1232,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
gfx::Size surfaceSize(10, 10);
float pageScale = 2;
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1284,7 +1284,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
gfx::Size surfaceSize(10, 10);
float pageScale = 2;
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -1370,7 +1370,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
root->setScrollable(true);
int scrollLayerId = 2;
root->addChild(createScrollableLayer(scrollLayerId, surfaceSize));
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1419,7 +1419,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildBeyondLimit)
child->addChild(grandChild.Pass());
root->addChild(child.Pass());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
{
@@ -1451,7 +1451,7 @@ TEST_P(LayerTreeHostImplTest, scrollEventBubbling)
child->setScrollable(false);
root->addChild(child.Pass());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
{
@@ -1471,13 +1471,13 @@ TEST_P(LayerTreeHostImplTest, scrollEventBubbling)
TEST_P(LayerTreeHostImplTest, scrollBeforeRedraw)
{
gfx::Size surfaceSize(10, 10);
- m_hostImpl->setRootLayer(createScrollableLayer(1, surfaceSize));
+ m_hostImpl->activeTree()->SetRootLayer(createScrollableLayer(1, surfaceSize));
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
// Draw one frame and then immediately rebuild the layer tree to mimic a tree synchronization.
initializeRendererAndDrawFrame();
- m_hostImpl->detachLayerTree();
- m_hostImpl->setRootLayer(createScrollableLayer(2, surfaceSize));
+ m_hostImpl->activeTree()->DetachLayerTree();
+ m_hostImpl->activeTree()->SetRootLayer(createScrollableLayer(2, surfaceSize));
// Scrolling should still work even though we did not draw yet.
EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(5, 5), InputHandlerClient::Wheel), InputHandlerClient::ScrollStarted);
@@ -1706,7 +1706,7 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
root->setBounds(gfx::Size(10, 10));
root->setContentBounds(root->bounds());
root->setDrawsContent(false);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
}
LayerImpl* root = m_hostImpl->rootLayer();
@@ -1893,12 +1893,12 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
TEST_P(LayerTreeHostImplTest, viewportCovered)
{
m_hostImpl->initializeRenderer(createOutputSurface());
- m_hostImpl->setBackgroundColor(SK_ColorGRAY);
+ m_hostImpl->activeTree()->set_background_color(SK_ColorGRAY);
gfx::Size viewportSize(1000, 1000);
m_hostImpl->setViewportSize(viewportSize, viewportSize);
- m_hostImpl->setRootLayer(LayerImpl::create(m_hostImpl->activeTree(), 1));
+ m_hostImpl->activeTree()->SetRootLayer(LayerImpl::create(m_hostImpl->activeTree(), 1));
m_hostImpl->rootLayer()->addChild(BlendStateCheckLayer::create(m_hostImpl->activeTree(), 2, m_hostImpl->resourceProvider()));
BlendStateCheckLayer* child = static_cast<BlendStateCheckLayer*>(m_hostImpl->rootLayer()->children()[0]);
child->setExpectation(false, false);
@@ -2011,7 +2011,7 @@ TEST_P(LayerTreeHostImplTest, reshapeNotCalledUntilDraw)
root->setAnchorPoint(gfx::PointF(0, 0));
root->setBounds(gfx::Size(10, 10));
root->setDrawsContent(true);
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
EXPECT_FALSE(reshapeTracker->reshapeCalled());
LayerTreeHostImpl::FrameData frame;
@@ -2069,7 +2069,7 @@ TEST_P(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
root->setContentBounds(gfx::Size(500, 500));
root->setDrawsContent(true);
root->addChild(child.Pass());
- layerTreeHostImpl->setRootLayer(root.Pass());
+ layerTreeHostImpl->activeTree()->SetRootLayer(root.Pass());
LayerTreeHostImpl::FrameData frame;
@@ -2133,7 +2133,7 @@ TEST_P(LayerTreeHostImplTest, rootLayerDoesntCreateExtraSurface)
root->setOpacity(0.7f);
root->addChild(child.Pass());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
LayerTreeHostImpl::FrameData frame;
@@ -2410,7 +2410,7 @@ static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, Lay
child->addChild(grandChild.Pass());
root->addChild(child.Pass());
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
return myHostImpl.Pass();
}
@@ -2478,7 +2478,7 @@ private:
TEST_P(LayerTreeHostImplTest, outputSurfaceLostAndRestoredNotificationSentToAllLayers)
{
- m_hostImpl->setRootLayer(OutputSurfaceLostNotificationCheckLayer::create(m_hostImpl->activeTree(), 1));
+ m_hostImpl->activeTree()->SetRootLayer(OutputSurfaceLostNotificationCheckLayer::create(m_hostImpl->activeTree(), 1));
OutputSurfaceLostNotificationCheckLayer* root = static_cast<OutputSurfaceLostNotificationCheckLayer*>(m_hostImpl->rootLayer());
root->addChild(OutputSurfaceLostNotificationCheckLayer::create(m_hostImpl->activeTree(), 2));
@@ -2914,7 +2914,7 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostOutputSurface)
VideoFrame::ReadPixelsCB(), base::Closure()));
providerScaled.setFrame(&videoFrameScaled);
- m_hostImpl->setRootLayer(rootLayer.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(rootLayer.Pass());
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -3047,7 +3047,7 @@ TEST_P(LayerTreeHostImplTest, layersFreeTextures)
TrackingWebGraphicsContext3D* trackingWebGraphicsContext3D = static_cast<TrackingWebGraphicsContext3D*>(outputSurface->Context3D());
m_hostImpl->initializeRenderer(outputSurface.Pass());
- m_hostImpl->setRootLayer(rootLayer.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(rootLayer.Pass());
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -3058,7 +3058,7 @@ TEST_P(LayerTreeHostImplTest, layersFreeTextures)
EXPECT_GT(trackingWebGraphicsContext3D->numTextures(), 0u);
// Kill the layer tree.
- m_hostImpl->setRootLayer(LayerImpl::create(m_hostImpl->activeTree(), 100));
+ m_hostImpl->activeTree()->SetRootLayer(LayerImpl::create(m_hostImpl->activeTree(), 100));
// There should be no textures left in use after.
EXPECT_EQ(0u, trackingWebGraphicsContext3D->numTextures());
}
@@ -3077,10 +3077,10 @@ TEST_P(LayerTreeHostImplTest, hasTransparentBackground)
// Run test case
createLayerTreeHost(false, outputSurface.Pass());
setupRootLayerImpl(LayerImpl::create(m_hostImpl->activeTree(), 1));
- m_hostImpl->setBackgroundColor(SK_ColorWHITE);
+ m_hostImpl->activeTree()->set_background_color(SK_ColorWHITE);
// Verify one quad is drawn when transparent background set is not set.
- m_hostImpl->setHasTransparentBackground(false);
+ m_hostImpl->activeTree()->set_has_transparent_background(false);
EXPECT_CALL(*mockContext, useProgram(_))
.Times(1);
EXPECT_CALL(*mockContext, drawElements(_, _, _, _))
@@ -3092,7 +3092,7 @@ TEST_P(LayerTreeHostImplTest, hasTransparentBackground)
Mock::VerifyAndClearExpectations(&mockContext);
// Verify no quads are drawn when transparent background is set.
- m_hostImpl->setHasTransparentBackground(true);
+ m_hostImpl->activeTree()->set_has_transparent_background(true);
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
@@ -3190,7 +3190,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
addDrawingLayerTo(rootPtr, 2, gfx::Rect(300, 300, 300, 300), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
@@ -3301,7 +3301,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
addDrawingLayerTo(rootPtr, 2, gfx::Rect(0, 0, 800, 800), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
@@ -3413,7 +3413,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
addDrawingLayerTo(rootPtr, 2, gfx::Rect(0, 0, 400, 400), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
@@ -3494,7 +3494,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
addDrawingLayerTo(rootPtr, 2, gfx::Rect(0, 0, 400, 400), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
@@ -3578,7 +3578,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
addDrawingLayerTo(rootPtr, 2, gfx::Rect(300, 300, 300, 300), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
@@ -3715,7 +3715,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
child->addChild(grandChild.Pass());
root->addChild(child.PassAs<LayerImpl>());
- myHostImpl->setRootLayer(root.Pass());
+ myHostImpl->activeTree()->SetRootLayer(root.Pass());
myHostImpl->setViewportSize(rootRect.size(), rootRect.size());
EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPassId));
@@ -4454,7 +4454,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportForcesCommitRedraw(const float d
// For this test we want to force scrolls to only pan the pinchZoomViewport
// and not the document, we can verify commit/redraw are requested.
root->setMaxScrollOffset(gfx::Vector2d());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -4526,7 +4526,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportTest(const float deviceScaleFact
// For this test we want to force scrolls to move the pinchZoomViewport so
// we can see the scroll component on the implTransform.
root->setMaxScrollOffset(gfx::Vector2d());
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -4610,7 +4610,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device
// For this test we want to scrolls to move both the document and the
// pinchZoomViewport so we can see some scroll component on the implTransform.
root->setMaxScrollOffset(gfx::Vector2d(3, 4));
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -4733,7 +4733,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollBoundaryTest(const floa
// For this test we want to scrolls to move both the document and the
// pinchZoomViewport so we can see some scroll component on the implTransform.
root->setMaxScrollOffset(gfx::Vector2d(3, 4));
- m_hostImpl->setRootLayer(root.Pass());
+ m_hostImpl->activeTree()->SetRootLayer(root.Pass());
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();

Powered by Google App Engine
This is Rietveld 408576698