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

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11439026: Revert 171403 (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
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl_unittest.cc
===================================================================
--- cc/layer_tree_host_impl_unittest.cc (revision 171405)
+++ cc/layer_tree_host_impl_unittest.cc (working copy)
@@ -82,7 +82,7 @@
settings.pageScalePinchZoomEnabled = GetParam();
m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
- m_hostImpl->initializeRenderer(createOutputSurface());
+ m_hostImpl->initializeRenderer(createContext());
m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
}
@@ -90,7 +90,7 @@
{
}
- virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE { }
+ virtual void didLoseContextOnImplThread() OVERRIDE { }
virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { }
virtual void onVSyncParametersChanged(base::TimeTicks, base::TimeDelta) OVERRIDE { }
virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { m_onCanDrawStateChangedCalled = true; }
@@ -103,7 +103,7 @@
void setReduceMemoryResult(bool reduceMemoryResult) { m_reduceMemoryResult = reduceMemoryResult; }
- scoped_ptr<LayerTreeHostImpl> createLayerTreeHost(bool partialSwap, scoped_ptr<OutputSurface> outputSurface, scoped_ptr<LayerImpl> root)
+ scoped_ptr<LayerTreeHostImpl> createLayerTreeHost(bool partialSwap, scoped_ptr<GraphicsContext> graphicsContext, scoped_ptr<LayerImpl> root)
{
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
@@ -111,7 +111,7 @@
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(graphicsContext.Pass());
myHostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
root->setAnchorPoint(gfx::PointF(0, 0));
@@ -192,7 +192,7 @@
void initializeRendererAndDrawFrame()
{
- m_hostImpl->initializeRenderer(createOutputSurface());
+ m_hostImpl->initializeRenderer(createContext());
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
@@ -205,9 +205,9 @@
void pinchZoomPanViewportAndScrollBoundaryTest(const float deviceScaleFactor);
protected:
- scoped_ptr<OutputSurface> createOutputSurface()
+ scoped_ptr<GraphicsContext> createContext()
{
- return FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3D)).PassAs<OutputSurface>();
+ return FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3D)).PassAs<GraphicsContext>();
}
FakeProxy m_proxy;
@@ -376,7 +376,7 @@
m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Initialization will fail here.
- m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<OutputSurface>());
+ m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<GraphicsContext>());
m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
setupScrollAndContentsLayers(gfx::Size(100, 100));
@@ -1885,7 +1885,7 @@
TEST_P(LayerTreeHostImplTest, viewportCovered)
{
- m_hostImpl->initializeRenderer(createOutputSurface());
+ m_hostImpl->initializeRenderer(createContext());
m_hostImpl->setBackgroundColor(SK_ColorGRAY);
gfx::Size viewportSize(1000, 1000);
@@ -1997,7 +1997,7 @@
// viewport size is never set.
TEST_P(LayerTreeHostImplTest, reshapeNotCalledUntilDraw)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new ReshapeTrackerContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new ReshapeTrackerContext)).PassAs<GraphicsContext>();
ReshapeTrackerContext* reshapeTracker = static_cast<ReshapeTrackerContext*>(outputSurface->context3D());
m_hostImpl->initializeRenderer(outputSurface.Pass());
@@ -2040,7 +2040,7 @@
// where it should request to swap only the subBuffer that is damaged.
TEST_P(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapTrackerContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapTrackerContext)).PassAs<GraphicsContext>();
PartialSwapTrackerContext* partialSwapTracker = static_cast<PartialSwapTrackerContext*>(outputSurface->context3D());
// This test creates its own LayerTreeHostImpl, so
@@ -2255,12 +2255,12 @@
TEST_P(LayerTreeHostImplTest, noPartialSwap)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebGraphicsContext3D>(new MockContext)).PassAs<OutputSurface>();
- MockContext* mockContext = static_cast<MockContext*>(outputSurface->context3D());
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebGraphicsContext3D>(new MockContext)).PassAs<GraphicsContext>();
+ MockContext* mockContext = static_cast<MockContext*>(context->context3D());
MockContextHarness harness(mockContext);
// Run test case
- scoped_ptr<LayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, outputSurface.Pass(), FakeLayerWithQuads::create(1));
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context.Pass(), FakeLayerWithQuads::create(1));
// without partial swap, and no clipping, no scissor is set.
harness.mustDrawSolidQuad();
@@ -2288,11 +2288,11 @@
TEST_P(LayerTreeHostImplTest, partialSwap)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new MockContext)).PassAs<OutputSurface>();
- MockContext* mockContext = static_cast<MockContext*>(outputSurface->context3D());
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new MockContext)).PassAs<GraphicsContext>();
+ MockContext* mockContext = static_cast<MockContext*>(context->context3D());
MockContextHarness harness(mockContext);
- scoped_ptr<LayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, outputSurface.Pass(), FakeLayerWithQuads::create(1));
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, context.Pass(), FakeLayerWithQuads::create(1));
// The first frame is not a partially-swapped one.
harness.mustSetScissor(0, 0, 10, 10);
@@ -2344,12 +2344,12 @@
static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
LayerTreeSettings settings;
settings.partialSwapEnabled = partialSwap;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, client, proxy);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
/*
@@ -2450,48 +2450,48 @@
}
}
-// Make sure that output surface lost notifications are propagated through the tree.
-class OutputSurfaceLostNotificationCheckLayer : public LayerImpl {
+// Make sure that context lost notifications are propagated through the tree.
+class ContextLostNotificationCheckLayer : public LayerImpl {
public:
- static scoped_ptr<LayerImpl> create(int id) { return scoped_ptr<LayerImpl>(new OutputSurfaceLostNotificationCheckLayer(id)); }
+ static scoped_ptr<LayerImpl> create(int id) { return scoped_ptr<LayerImpl>(new ContextLostNotificationCheckLayer(id)); }
- virtual void didLoseOutputSurface() OVERRIDE
+ virtual void didLoseContext() OVERRIDE
{
- m_didLoseOutputSurfaceCalled = true;
+ m_didLoseContextCalled = true;
}
- bool didLoseOutputSurfaceCalled() const { return m_didLoseOutputSurfaceCalled; }
+ bool didLoseContextCalled() const { return m_didLoseContextCalled; }
private:
- explicit OutputSurfaceLostNotificationCheckLayer(int id)
+ explicit ContextLostNotificationCheckLayer(int id)
: LayerImpl(id)
- , m_didLoseOutputSurfaceCalled(false)
+ , m_didLoseContextCalled(false)
{
}
- bool m_didLoseOutputSurfaceCalled;
+ bool m_didLoseContextCalled;
};
-TEST_P(LayerTreeHostImplTest, outputSurfaceLostAndRestoredNotificationSentToAllLayers)
+TEST_P(LayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayers)
{
- m_hostImpl->setRootLayer(OutputSurfaceLostNotificationCheckLayer::create(1));
- OutputSurfaceLostNotificationCheckLayer* root = static_cast<OutputSurfaceLostNotificationCheckLayer*>(m_hostImpl->rootLayer());
+ m_hostImpl->setRootLayer(ContextLostNotificationCheckLayer::create(1));
+ ContextLostNotificationCheckLayer* root = static_cast<ContextLostNotificationCheckLayer*>(m_hostImpl->rootLayer());
- root->addChild(OutputSurfaceLostNotificationCheckLayer::create(1));
- OutputSurfaceLostNotificationCheckLayer* layer1 = static_cast<OutputSurfaceLostNotificationCheckLayer*>(root->children()[0]);
+ root->addChild(ContextLostNotificationCheckLayer::create(1));
+ ContextLostNotificationCheckLayer* layer1 = static_cast<ContextLostNotificationCheckLayer*>(root->children()[0]);
- layer1->addChild(OutputSurfaceLostNotificationCheckLayer::create(2));
- OutputSurfaceLostNotificationCheckLayer* layer2 = static_cast<OutputSurfaceLostNotificationCheckLayer*>(layer1->children()[0]);
+ layer1->addChild(ContextLostNotificationCheckLayer::create(2));
+ ContextLostNotificationCheckLayer* layer2 = static_cast<ContextLostNotificationCheckLayer*>(layer1->children()[0]);
- EXPECT_FALSE(root->didLoseOutputSurfaceCalled());
- EXPECT_FALSE(layer1->didLoseOutputSurfaceCalled());
- EXPECT_FALSE(layer2->didLoseOutputSurfaceCalled());
+ EXPECT_FALSE(root->didLoseContextCalled());
+ EXPECT_FALSE(layer1->didLoseContextCalled());
+ EXPECT_FALSE(layer2->didLoseContextCalled());
- m_hostImpl->initializeRenderer(createOutputSurface());
+ m_hostImpl->initializeRenderer(createContext());
- EXPECT_TRUE(root->didLoseOutputSurfaceCalled());
- EXPECT_TRUE(layer1->didLoseOutputSurfaceCalled());
- EXPECT_TRUE(layer2->didLoseOutputSurfaceCalled());
+ EXPECT_TRUE(root->didLoseContextCalled());
+ EXPECT_TRUE(layer1->didLoseContextCalled());
+ EXPECT_TRUE(layer2->didLoseContextCalled());
}
TEST_P(LayerTreeHostImplTest, finishAllRenderingAfterContextLost)
@@ -2500,7 +2500,7 @@
m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
- m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<OutputSurface>());
+ m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<GraphicsContext>());
m_hostImpl->finishAllRendering();
}
@@ -2518,14 +2518,14 @@
unsigned m_succeedCount;
};
-TEST_P(LayerTreeHostImplTest, context3DLostDuringInitialize)
+TEST_P(LayerTreeHostImplTest, contextLostDuringInitialize)
{
LayerTreeSettings settings;
m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Initialize into a known successful state.
- EXPECT_TRUE(m_hostImpl->initializeRenderer(createOutputSurface()));
- EXPECT_TRUE(m_hostImpl->outputSurface());
+ EXPECT_TRUE(m_hostImpl->initializeRenderer(createContext()));
+ EXPECT_TRUE(m_hostImpl->context());
EXPECT_TRUE(m_hostImpl->renderer());
EXPECT_TRUE(m_hostImpl->resourceProvider());
@@ -2538,15 +2538,15 @@
for (unsigned i = 0; i < kMakeCurrentSuccessesNeededForSuccessfulInitialization; ++i) {
// The context will get lost during initialization, we shouldn't crash. We
// should also be in a consistent state.
- EXPECT_FALSE(m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFailsEventually(i))).PassAs<OutputSurface>()));
- EXPECT_EQ(0, m_hostImpl->outputSurface());
+ EXPECT_FALSE(m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFailsEventually(i))).PassAs<GraphicsContext>()));
+ EXPECT_EQ(0, m_hostImpl->context());
EXPECT_EQ(0, m_hostImpl->renderer());
EXPECT_EQ(0, m_hostImpl->resourceProvider());
- EXPECT_TRUE(m_hostImpl->initializeRenderer(createOutputSurface()));
+ EXPECT_TRUE(m_hostImpl->initializeRenderer(createContext()));
}
- EXPECT_TRUE(m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFailsEventually(kMakeCurrentSuccessesNeededForSuccessfulInitialization))).PassAs<OutputSurface>()));
- EXPECT_TRUE(m_hostImpl->outputSurface());
+ EXPECT_TRUE(m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFailsEventually(kMakeCurrentSuccessesNeededForSuccessfulInitialization))).PassAs<GraphicsContext>()));
+ EXPECT_TRUE(m_hostImpl->context());
EXPECT_TRUE(m_hostImpl->renderer());
EXPECT_TRUE(m_hostImpl->resourceProvider());
}
@@ -2783,7 +2783,7 @@
return pass.PassAs<RenderPass>();
}
-TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostOutputSurface)
+TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
{
int layerId = 1;
@@ -2899,7 +2899,7 @@
rootLayer->addChild(delegatedRendererLayer.PassAs<LayerImpl>());
// Use a context that supports IOSurfaces
- m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DWithIOSurface)).PassAs<OutputSurface>());
+ m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DWithIOSurface)).PassAs<GraphicsContext>());
FakeVideoFrame hwVideoFrame(
VideoFrame::WrapNativeTexture(
@@ -2927,9 +2927,9 @@
unsigned numResources = m_hostImpl->resourceProvider()->numResources();
- // Lose the WebGraphicsContext3D, replacing it with a StrictWebGraphicsContext3DWithIOSurface,
+ // Lose the context, replacing it with a StrictWebGraphicsContext3DWithIOSurface,
// that will warn if any resource from the previous context gets used.
- m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new StrictWebGraphicsContext3DWithIOSurface)).PassAs<OutputSurface>());
+ m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new StrictWebGraphicsContext3DWithIOSurface)).PassAs<GraphicsContext>());
// Create dummy resources so that looking up an old resource will get an
// invalid texture id mapping.
@@ -2937,7 +2937,7 @@
m_hostImpl->resourceProvider()->createResourceFromExternalTexture(StrictWebGraphicsContext3D::kExternalTextureId);
// The WebVideoFrameProvider is expected to recreate its textures after a
- // lost output surface (or not serve a frame).
+ // lost context (or not serve a frame).
hwProvider.setFrame(0);
providerScaled.setFrame(0);
@@ -3047,9 +3047,9 @@
ioSurfaceLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(ioSurfaceLayer.PassAs<LayerImpl>());
- // Lose the WebGraphicsContext3D, replacing it with a TrackingWebGraphicsContext3D (which the LayerTreeHostImpl takes ownership of).
- scoped_ptr<OutputSurface> outputSurface(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new TrackingWebGraphicsContext3D)));
- TrackingWebGraphicsContext3D* trackingWebGraphicsContext3D = static_cast<TrackingWebGraphicsContext3D*>(outputSurface->context3D());
+ // Lose the context, replacing it with a TrackingWebGraphicsContext3D (which the LayerTreeHostImpl takes ownership of).
+ scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new TrackingWebGraphicsContext3D)));
+ TrackingWebGraphicsContext3D* trackingWebGraphicsContext = static_cast<TrackingWebGraphicsContext3D*>(outputSurface->context3D());
m_hostImpl->initializeRenderer(outputSurface.Pass());
m_hostImpl->setRootLayer(rootLayer.Pass());
@@ -3060,12 +3060,12 @@
m_hostImpl->didDrawAllLayers(frame);
m_hostImpl->swapBuffers();
- EXPECT_GT(trackingWebGraphicsContext3D->numTextures(), 0u);
+ EXPECT_GT(trackingWebGraphicsContext->numTextures(), 0u);
// Kill the layer tree.
m_hostImpl->setRootLayer(LayerImpl::create(100));
// There should be no textures left in use after.
- EXPECT_EQ(0u, trackingWebGraphicsContext3D->numTextures());
+ EXPECT_EQ(0u, trackingWebGraphicsContext->numTextures());
}
class MockDrawQuadsToFillScreenContext : public FakeWebGraphicsContext3D {
@@ -3076,11 +3076,11 @@
TEST_P(LayerTreeHostImplTest, hasTransparentBackground)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new MockDrawQuadsToFillScreenContext)).PassAs<OutputSurface>();
- MockDrawQuadsToFillScreenContext* mockContext = static_cast<MockDrawQuadsToFillScreenContext*>(outputSurface->context3D());
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new MockDrawQuadsToFillScreenContext)).PassAs<GraphicsContext>();
+ MockDrawQuadsToFillScreenContext* mockContext = static_cast<MockDrawQuadsToFillScreenContext*>(context->context3D());
// Run test case
- scoped_ptr<LayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, outputSurface.Pass(), LayerImpl::create(1));
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context.Pass(), LayerImpl::create(1));
myHostImpl->setBackgroundColor(SK_ColorWHITE);
// Verify one quad is drawn when transparent background set is not set.
@@ -3120,9 +3120,9 @@
static void setupLayersForTextureCaching(LayerTreeHostImpl* layerTreeHostImpl, LayerImpl*& rootPtr, LayerImpl*& intermediateLayerPtr, LayerImpl*& surfaceLayerPtr, LayerImpl*& childPtr, const gfx::Size& rootSize)
{
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
+ layerTreeHostImpl->initializeRenderer(context.Pass());
layerTreeHostImpl->setViewportSize(rootSize, rootSize);
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3164,11 +3164,11 @@
LayerImpl* rootPtr;
LayerImpl* surfaceLayerPtr;
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
gfx::Size rootSize(100, 100);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3275,11 +3275,11 @@
LayerImpl* layerS1Ptr;
LayerImpl* layerS2Ptr;
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
gfx::Size rootSize(1000, 1000);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3386,11 +3386,11 @@
LayerImpl* layerS1Ptr;
LayerImpl* layerS2Ptr;
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
gfx::Size rootSize(1000, 1000);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3498,11 +3498,11 @@
LayerImpl* layerS1Ptr;
LayerImpl* layerS2Ptr;
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
gfx::Size rootSize(1000, 1000);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3579,11 +3579,11 @@
LayerImpl* rootPtr;
LayerImpl* layerS1Ptr;
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
gfx::Size rootSize(1000, 1000);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3663,11 +3663,11 @@
LayerImpl* layerS1Ptr;
LayerImpl* layerS2Ptr;
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
gfx::Size rootSize(1000, 1000);
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
@@ -3782,8 +3782,8 @@
gfx::Rect childRect(10, 10, 50, 50);
gfx::Rect grandChildRect(5, 5, 150, 150);
- scoped_ptr<OutputSurface> outputSurface = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
- myHostImpl->initializeRenderer(outputSurface.Pass());
+ scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
+ myHostImpl->initializeRenderer(context.Pass());
root->setAnchorPoint(gfx::PointF(0, 0));
root->setPosition(gfx::PointF(rootRect.x(), rootRect.y()));
@@ -4228,7 +4228,7 @@
// RendererClient implementation.
virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_viewportSize; }
virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settings; }
- virtual void didLoseOutputSurface() OVERRIDE { }
+ virtual void didLoseContext() OVERRIDE { }
virtual void onSwapBuffersComplete() OVERRIDE { }
virtual void setFullRootLayerDamage() OVERRIDE { }
virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE { }
@@ -4523,9 +4523,9 @@
TEST_P(LayerTreeHostImplTest, testRemoveRenderPasses)
{
- scoped_ptr<OutputSurface> outputSurface(createOutputSurface());
- ASSERT_TRUE(outputSurface->context3D());
- scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outputSurface.get()));
+ scoped_ptr<GraphicsContext> context(createContext());
+ ASSERT_TRUE(context->context3D());
+ scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(context.get()));
scoped_ptr<TestRenderer> renderer(TestRenderer::create(resourceProvider.get(), &m_proxy));
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698