[Chromium] Move instantiation of texture uploader to LayerRendererChromium.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 May 2012 06:33:58 +0000 (06:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 May 2012 06:33:58 +0000 (06:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85893

Patch by David Reveman <reveman@chromium.org> on 2012-05-10
Reviewed by Adrienne Walker.

Source/WebCore:

Move instantiation of texture uploader to LayerRendererChromium and
allow CCProxy to decide between a throttled or unthrottled uploader
using a flag passed to the LayerRendererChromium constructor.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::create):
(WebCore::LayerRendererChromium::LayerRendererChromium):
(WebCore::LayerRendererChromium::initializeSharedObjects):
* platform/graphics/chromium/LayerRendererChromium.h:
(LayerRendererChromium):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::initializeLayerRenderer):
(WebCore::CCSingleThreadProxy::recreateContext):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):

Source/WebKit/chromium:

* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest):
(WebKitTests::TEST_F):
* tests/LayerRendererChromiumTest.cpp:
(FakeLayerRendererChromium::FakeLayerRendererChromium):
(LayerRendererChromiumTest::LayerRendererChromiumTest):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116731 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp

index a56ad68..8afdc0f 100644 (file)
@@ -1,3 +1,31 @@
+2012-05-10  David Reveman  <reveman@chromium.org>
+
+        [Chromium] Move instantiation of texture uploader to LayerRendererChromium.
+        https://bugs.webkit.org/show_bug.cgi?id=85893
+
+        Reviewed by Adrienne Walker.
+
+        Move instantiation of texture uploader to LayerRendererChromium and
+        allow CCProxy to decide between a throttled or unthrottled uploader
+        using a flag passed to the LayerRendererChromium constructor.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::create):
+        (WebCore::LayerRendererChromium::LayerRendererChromium):
+        (WebCore::LayerRendererChromium::initializeSharedObjects):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        (LayerRendererChromium):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+        (CCLayerTreeHostImpl):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::initializeLayerRenderer):
+        (WebCore::CCSingleThreadProxy::recreateContext):
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
+        (WebCore::CCThreadProxy::recreateContextOnImplThread):
+
 2012-05-10  MORITA Hajime  <morrita@google.com>
 
         ElementShadow should minimize the usage of "ShadowRoot" name
index 9f3edd0..9e11507 100644 (file)
@@ -143,6 +143,24 @@ bool needsLionIOSurfaceReadbackWorkaround()
 #endif
 }
 
+class UnthrottledTextureUploader : public TextureUploader {
+    WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
+public:
+    static PassOwnPtr<UnthrottledTextureUploader> create()
+    {
+        return adoptPtr(new UnthrottledTextureUploader());
+    }
+    virtual ~UnthrottledTextureUploader() { }
+
+    virtual bool isBusy() { return false; }
+    virtual void beginUploads() { }
+    virtual void endUploads() { }
+    virtual void uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
+
+protected:
+    UnthrottledTextureUploader() { }
+};
+
 } // anonymous namespace
 
 class LayerRendererSwapBuffersCompleteCallbackAdapter : public Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM {
@@ -194,9 +212,9 @@ private:
 };
 
 
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader)
+PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, TextureUploaderOption textureUploaderSetting)
 {
-    OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, context, uploader)));
+    OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, context, textureUploaderSetting)));
     if (!layerRenderer->initialize())
         return nullptr;
 
@@ -205,17 +223,17 @@ PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(LayerRendererChr
 
 LayerRendererChromium::LayerRendererChromium(LayerRendererChromiumClient* client,
                                              PassRefPtr<GraphicsContext3D> context,
-                                             PassOwnPtr<TextureUploader> uploader)
+                                             TextureUploaderOption textureUploaderSetting)
     : m_client(client)
     , m_currentRenderSurface(0)
     , m_currentManagedTexture(0)
     , m_offscreenFramebufferId(0)
-    , m_textureUploader(uploader)
     , m_context(context)
     , m_defaultRenderSurface(0)
     , m_sharedGeometryQuad(FloatRect(-0.5f, -0.5f, 1.0f, 1.0f))
     , m_isViewportChanged(false)
     , m_isFramebufferDiscarded(false)
+    , m_textureUploaderSetting(m_textureUploaderSetting)
 {
 }
 
@@ -1382,6 +1400,10 @@ bool LayerRendererChromium::initializeSharedObjects()
                                                            TextureManager::reclaimLimitBytes(viewportSize()),
                                                            m_capabilities.maxTextureSize);
     m_textureCopier = AcceleratedTextureCopier::create(m_context.get());
+    if (m_textureUploaderSetting == ThrottledUploader)
+        m_textureUploader = ThrottledTextureUploader::create(m_context.get());
+    else
+        m_textureUploader = UnthrottledTextureUploader::create();
     m_contentsTextureAllocator = TrackingTextureAllocator::create(m_context.get());
     m_renderSurfaceTextureAllocator = TrackingTextureAllocator::create(m_context.get());
     if (m_capabilities.usingTextureUsageHint)
index d73f71a..a92cf82 100644 (file)
@@ -74,11 +74,13 @@ public:
     virtual void setContentsMemoryAllocationLimitBytes(size_t) = 0;
 };
 
+enum TextureUploaderOption { ThrottledUploader, UnthrottledUploader };
+
 // Class that handles drawing of composited render layers using GL.
 class LayerRendererChromium {
     WTF_MAKE_NONCOPYABLE(LayerRendererChromium);
 public:
-    static PassOwnPtr<LayerRendererChromium> create(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, PassOwnPtr<TextureUploader>);
+    static PassOwnPtr<LayerRendererChromium> create(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption);
 
     ~LayerRendererChromium();
 
@@ -144,7 +146,7 @@ protected:
     void ensureFramebuffer();
     bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
 
-    LayerRendererChromium(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, PassOwnPtr<TextureUploader>);
+    LayerRendererChromium(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption);
     bool initialize();
 
 private:
@@ -298,6 +300,7 @@ private:
 
     bool m_isViewportChanged;
     bool m_isFramebufferDiscarded;
+    TextureUploaderOption m_textureUploaderSetting;
 };
 
 
index ec564f5..4ac8534 100644 (file)
@@ -526,10 +526,10 @@ void CCLayerTreeHostImpl::setVisible(bool visible)
     m_timeSourceClientAdapter->setActive(shouldTickInBackground);
 }
 
-bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader)
+bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D> context, TextureUploaderOption textureUploader)
 {
     OwnPtr<LayerRendererChromium> layerRenderer;
-    layerRenderer = LayerRendererChromium::create(this, context, uploader);
+    layerRenderer = LayerRendererChromium::create(this, context, textureUploader);
 
     // Since we now have a new context/layerRenderer, we cannot continue to use the old
     // resources (i.e. renderSurfaces and texture IDs).
index 8f16f9f..13a8cd6 100644 (file)
@@ -122,7 +122,7 @@ public:
     void finishAllRendering();
     int frameNumber() const { return m_frameNumber; }
 
-    bool initializeLayerRenderer(PassRefPtr<GraphicsContext3D>, PassOwnPtr<TextureUploader>);
+    bool initializeLayerRenderer(PassRefPtr<GraphicsContext3D>, TextureUploaderOption);
     bool isContextLost();
     LayerRendererChromium* layerRenderer() { return m_layerRenderer.get(); }
     const LayerRendererCapabilities& layerRendererCapabilities() const;
index d5318ae..418cacf 100644 (file)
@@ -38,24 +38,6 @@ using namespace WTF;
 
 namespace WebCore {
 
-class UnthrottledTextureUploader : public TextureUploader {
-    WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
-public:
-    static PassOwnPtr<UnthrottledTextureUploader> create()
-    {
-        return adoptPtr(new UnthrottledTextureUploader());
-    }
-    virtual ~UnthrottledTextureUploader() { }
-
-    virtual bool isBusy() { return false; }
-    virtual void beginUploads() { }
-    virtual void endUploads() { }
-    virtual void uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
-
-protected:
-    UnthrottledTextureUploader() { }
-};
-
 PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost)
 {
     return adoptPtr(new CCSingleThreadProxy(layerTreeHost));
@@ -155,7 +137,7 @@ bool CCSingleThreadProxy::initializeLayerRenderer()
     ASSERT(m_contextBeforeInitialization);
     {
         DebugScopedSetImplThread impl;
-        bool ok = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitialization.release(), UnthrottledTextureUploader::create());
+        bool ok = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitialization.release(), UnthrottledUploader);
         if (ok) {
             m_layerRendererInitialized = true;
             m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
@@ -179,7 +161,7 @@ bool CCSingleThreadProxy::recreateContext()
     {
         DebugScopedSetImplThread impl;
         m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->contentsTextureAllocator());
-        initialized = m_layerTreeHostImpl->initializeLayerRenderer(context, UnthrottledTextureUploader::create());
+        initialized = m_layerTreeHostImpl->initializeLayerRenderer(context, UnthrottledUploader);
         if (initialized) {
             m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
         }
index 0784905..6375d7f 100644 (file)
@@ -57,24 +57,12 @@ static const double contextRecreationTickRate = 0.03;
 
 namespace WebCore {
 
-// FIXME: remove when ThrottledTextureUploader is ready to be used.
-class UnthrottledTextureUploader : public TextureUploader {
-    WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
-public:
-    static PassOwnPtr<UnthrottledTextureUploader> create(PassRefPtr<GraphicsContext3D> context)
-    {
-        return adoptPtr(new UnthrottledTextureUploader(context));
-    }
-    virtual ~UnthrottledTextureUploader() { }
+namespace {
 
-    virtual bool isBusy() { return false; }
-    virtual void beginUploads() { }
-    virtual void endUploads() { }
-    virtual void uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
+// FIXME: Use ThrottledUploader by default.
+static TextureUploaderOption textureUploader = UnthrottledUploader;
 
-protected:
-    explicit UnthrottledTextureUploader(PassRefPtr<GraphicsContext3D>) { }
-};
+} // anonymous namespace
 
 PassOwnPtr<CCProxy> CCThreadProxy::create(CCLayerTreeHost* layerTreeHost)
 {
@@ -834,8 +822,7 @@ void CCThreadProxy::initializeLayerRendererOnImplThread(CCCompletionEvent* compl
     TRACE_EVENT("CCThreadProxy::initializeLayerRendererOnImplThread", this, 0);
     ASSERT(isImplThread());
     ASSERT(m_contextBeforeInitializationOnImplThread);
-    OwnPtr<TextureUploader> uploader = UnthrottledTextureUploader::create(m_contextBeforeInitializationOnImplThread.get());
-    *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitializationOnImplThread.release(), uploader.release());
+    *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitializationOnImplThread.release(), textureUploader);
     if (*initializeSucceeded) {
         *capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
         if (capabilities->usingSwapCompleteCallback)
@@ -885,8 +872,7 @@ void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, G
     TRACE_EVENT0("cc", "CCThreadProxy::recreateContextOnImplThread");
     ASSERT(isImplThread());
     m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->contentsTextureAllocator());
-    OwnPtr<TextureUploader> uploader = UnthrottledTextureUploader::create(contextPtr);
-    *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(contextPtr), uploader.release());
+    *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(contextPtr), textureUploader);
     if (*recreateSucceeded) {
         *capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
         m_schedulerOnImplThread->didRecreateContext();
index eb23d1e..b3257aa 100644 (file)
@@ -1,3 +1,18 @@
+2012-05-10  David Reveman  <reveman@chromium.org>
+
+        [Chromium] Move instantiation of texture uploader to LayerRendererChromium.
+        https://bugs.webkit.org/show_bug.cgi?id=85893
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+        (WebKitTests::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest):
+        (WebKitTests::TEST_F):
+        * tests/LayerRendererChromiumTest.cpp:
+        (FakeLayerRendererChromium::FakeLayerRendererChromium):
+        (LayerRendererChromiumTest::LayerRendererChromiumTest):
+        (TEST):
+
 2012-05-10  Min Qin  <qinmin@google.com>
 
         split MediaPlayer::enterFullscreen into 2 seperate functions
index 58668d0..9f26734 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CCAnimationTestCommon.h"
 #include "CCLayerTestCommon.h"
-#include "CCTiledLayerTestCommon.h"
 #include "FakeWebGraphicsContext3D.h"
 #include "GraphicsContext3DPrivate.h"
 #include "LayerRendererChromium.h"
@@ -60,7 +59,7 @@ public:
     {
         CCSettings settings;
         m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
-        m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
+        m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
         m_hostImpl->setViewportSize(IntSize(10, 10));
     }
 
@@ -876,7 +875,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
 
 TEST_F(CCLayerTreeHostImplTest, viewportCovered)
 {
-    m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
+    m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
     m_hostImpl->setBackgroundColor(Color::gray);
 
     IntSize viewportSize(1000, 1000);
@@ -987,7 +986,7 @@ TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw)
 {
     ReshapeTrackerContext* reshapeTracker = new ReshapeTrackerContext();
     RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(reshapeTracker), GraphicsContext3D::RenderDirectlyToHostWindow);
-    m_hostImpl->initializeLayerRenderer(context, adoptPtr(new FakeTextureUploader));
+    m_hostImpl->initializeLayerRenderer(context, UnthrottledUploader);
 
     CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
     root->setAnchorPoint(FloatPoint(0, 0));
@@ -1036,7 +1035,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
     CCSettings settings;
     settings.partialSwapEnabled = true;
     OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this);
-    layerTreeHostImpl->initializeLayerRenderer(context, adoptPtr(new FakeTextureUploader()));
+    layerTreeHostImpl->initializeLayerRenderer(context, UnthrottledUploader);
     layerTreeHostImpl->setViewportSize(IntSize(500, 500));
 
     CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
@@ -1135,7 +1134,7 @@ TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayer
     EXPECT_FALSE(layer1->didLoseContextCalled());
     EXPECT_FALSE(layer2->didLoseContextCalled());
 
-    m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
+    m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
 
     EXPECT_TRUE(root->didLoseContextCalled());
     EXPECT_TRUE(layer1->didLoseContextCalled());
@@ -1150,7 +1149,7 @@ public:
 TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
 {
     // The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
-    m_hostImpl->initializeLayerRenderer(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow), adoptPtr(new FakeTextureUploader));
+    m_hostImpl->initializeLayerRenderer(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow), UnthrottledUploader);
     m_hostImpl->finishAllRendering();
 }
 
@@ -1180,7 +1179,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollbarLayerLostContext)
         // Scrollbar layer should always generate quads, even after lost context
         EXPECT_GT(renderPass->quadList().size(), 0u);
         m_hostImpl->didDrawAllLayers(frame);
-        m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
+        m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
     }
 }
 
@@ -1355,7 +1354,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
 
     // Lose the context, replacing it with a StrictWebGraphicsContext3D, that
     // will warn if any resource from the previous context gets used.
-    m_hostImpl->initializeLayerRenderer(StrictWebGraphicsContext3D::createGraphicsContext(), adoptPtr(new FakeTextureUploader));
+    m_hostImpl->initializeLayerRenderer(StrictWebGraphicsContext3D::createGraphicsContext(), UnthrottledUploader);
     EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
     m_hostImpl->drawLayers(frame);
     m_hostImpl->didDrawAllLayers(frame);
index 69d0ff5..13f04a2 100644 (file)
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "LayerRendererChromium.h"
 
-#include "CCTiledLayerTestCommon.h"
 #include "FakeWebGraphicsContext3D.h"
 #include "GraphicsContext3D.h"
 #include "GraphicsContext3DPrivate.h"
@@ -36,7 +35,6 @@
 
 using namespace WebCore;
 using namespace WebKit;
-using namespace WebKitTests;
 
 class FrameCountingMemoryAllocationSettingContext : public FakeWebGraphicsContext3D {
 public:
@@ -93,7 +91,7 @@ private:
 
 class FakeLayerRendererChromium : public LayerRendererChromium {
 public:
-    FakeLayerRendererChromium(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader) : LayerRendererChromium(client, context, uploader) { }
+    FakeLayerRendererChromium(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context) : LayerRendererChromium(client, context, UnthrottledUploader) { }
 
     // LayerRendererChromium methods.
 
@@ -109,7 +107,7 @@ protected:
         , m_suggestHaveBackbufferNo(1, false)
         , m_context(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FrameCountingMemoryAllocationSettingContext()), GraphicsContext3D::RenderDirectlyToHostWindow))
         , m_mockContext(*static_cast<FrameCountingMemoryAllocationSettingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_context.get())))
-        , m_layerRendererChromium(&m_mockClient, m_context.release(), adoptPtr(new FakeTextureUploader()))
+        , m_layerRendererChromium(&m_mockClient, m_context.release())
     {
     }
 
@@ -273,7 +271,7 @@ public:
 TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls)
 {
     FakeLayerRendererChromiumClient mockClient;
-    FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow), adoptPtr(new FakeTextureUploader()));
+    FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow));
 
     EXPECT_TRUE(layerRendererChromium.initialize());
 }