[chromium] Defer texture id allocation for copies until the actual copy executes
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 18:17:53 +0000 (18:17 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 18:17:53 +0000 (18:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83514

Reviewed by Adrienne Walker.

Source/WebCore:

This allows for queuing a texture copy operation into a ManagedTexture whose texture ID has not yet been
allocated. The ManagedTexture* serves as a promise that an ID will be available when the copy is executed.

* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::updateCompositorResources):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::doCommit):
* platform/graphics/chromium/cc/CCTextureUpdater.cpp:
(WebCore::CCTextureUpdater::CCTextureUpdater):
(WebCore::CCTextureUpdater::appendManagedCopy):
(WebCore):
(WebCore::CCTextureUpdater::hasMoreUpdates):
(WebCore::CCTextureUpdater::update):
(WebCore::CCTextureUpdater::clear):
* platform/graphics/chromium/cc/CCTextureUpdater.h:
(CCTextureUpdater):
(ManagedCopyEntry):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
(WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):

Source/WebKit/chromium:

* tests/CCTiledLayerTestCommon.cpp:
* tests/CCTiledLayerTestCommon.h:
* tests/Canvas2DLayerChromiumTest.cpp:
* tests/TiledLayerChromiumTest.cpp:
(WTF::TEST):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

index ce4cc3e..5b38e08 100644 (file)
@@ -1,3 +1,31 @@
+2012-04-09  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Defer texture id allocation for copies until the actual copy executes
+        https://bugs.webkit.org/show_bug.cgi?id=83514
+
+        Reviewed by Adrienne Walker.
+
+        This allows for queuing a texture copy operation into a ManagedTexture whose texture ID has not yet been
+        allocated. The ManagedTexture* serves as a promise that an ID will be available when the copy is executed.
+
+        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+        (WebCore::Canvas2DLayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::doCommit):
+        * platform/graphics/chromium/cc/CCTextureUpdater.cpp:
+        (WebCore::CCTextureUpdater::CCTextureUpdater):
+        (WebCore::CCTextureUpdater::appendManagedCopy):
+        (WebCore):
+        (WebCore::CCTextureUpdater::hasMoreUpdates):
+        (WebCore::CCTextureUpdater::update):
+        (WebCore::CCTextureUpdater::clear):
+        * platform/graphics/chromium/cc/CCTextureUpdater.h:
+        (CCTextureUpdater):
+        (ManagedCopyEntry):
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+        (WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
+
 2012-04-10  David Hyatt  <hyatt@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=83595
index ca555fc..bfa834e 100644 (file)
@@ -134,8 +134,7 @@ void Canvas2DLayerChromium::updateCompositorResources(GraphicsContext3D* context
     if (!m_backTextureId || !m_frontTexture || !m_frontTexture->isValid(m_size, GraphicsContext3D::RGBA))
         return;
 
-    m_frontTexture->allocate(updater.allocator());
-    updater.appendCopy(m_backTextureId, m_frontTexture->textureId(), m_size);
+    updater.appendManagedCopy(m_backTextureId, m_frontTexture.get(), m_size);
 }
 
 void Canvas2DLayerChromium::pushPropertiesTo(CCLayerImpl* layer)
index ec8428d..57f0c20 100644 (file)
@@ -200,9 +200,9 @@ void CCSingleThreadProxy::doCommit()
         m_layerTreeHostImpl->beginCommit();
 
         m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
-        CCTextureUpdater updater(m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier());
+        CCTextureUpdater updater;
         m_layerTreeHost->updateCompositorResources(m_layerTreeHostImpl->context(), updater);
-        updater.update(m_layerTreeHostImpl->context(), numeric_limits<size_t>::max());
+        updater.update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), numeric_limits<size_t>::max());
         ASSERT(!updater.hasMoreUpdates());
         m_layerTreeHostImpl->setVisible(m_layerTreeHost->visible());
         m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
index 4012da4..a7304d7 100644 (file)
@@ -38,12 +38,9 @@ using namespace std;
 
 namespace WebCore {
 
-CCTextureUpdater::CCTextureUpdater(TextureAllocator* allocator, TextureCopier* copier)
-    : m_allocator(allocator)
-    , m_copier(copier)
-    , m_entryIndex(0)
+CCTextureUpdater::CCTextureUpdater()
+    : m_entryIndex(0)
 {
-    ASSERT(m_allocator);
 }
 
 CCTextureUpdater::~CCTextureUpdater()
@@ -80,18 +77,27 @@ void CCTextureUpdater::appendCopy(unsigned sourceTexture, unsigned destTexture,
     m_copyEntries.append(copy);
 }
 
+void CCTextureUpdater::appendManagedCopy(unsigned sourceTexture, ManagedTexture* destTexture, const IntSize& size)
+{
+    ManagedCopyEntry copy;
+    copy.sourceTexture = sourceTexture;
+    copy.destTexture = destTexture;
+    copy.size = size;
+    m_managedCopyEntries.append(copy);
+}
+
 bool CCTextureUpdater::hasMoreUpdates() const
 {
-    return m_entries.size() || m_partialEntries.size() || m_copyEntries.size();
+    return m_entries.size() || m_partialEntries.size() || m_copyEntries.size() || m_managedCopyEntries.size();
 }
 
-bool CCTextureUpdater::update(GraphicsContext3D* context, size_t count)
+bool CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allocator, TextureCopier* copier, size_t count)
 {
     size_t index;
     size_t maxIndex = min(m_entryIndex + count, m_entries.size());
     for (index = m_entryIndex; index < maxIndex; ++index) {
         UpdateEntry& entry = m_entries[index];
-        entry.texture->updateRect(context, m_allocator, entry.sourceRect, entry.destRect);
+        entry.texture->updateRect(context, allocator, entry.sourceRect, entry.destRect);
     }
 
     bool moreUpdates = maxIndex < m_entries.size();
@@ -109,17 +115,22 @@ bool CCTextureUpdater::update(GraphicsContext3D* context, size_t count)
 
     for (index = 0; index < m_partialEntries.size(); ++index) {
         UpdateEntry& entry = m_partialEntries[index];
-        entry.texture->updateRect(context, m_allocator, entry.sourceRect, entry.destRect);
+        entry.texture->updateRect(context, allocator, entry.sourceRect, entry.destRect);
     }
 
     for (index = 0; index < m_copyEntries.size(); ++index) {
         CopyEntry& copyEntry = m_copyEntries[index];
-        m_copier->copyTexture(context, copyEntry.sourceTexture, copyEntry.destTexture, copyEntry.size);
+        copier->copyTexture(context, copyEntry.sourceTexture, copyEntry.destTexture, copyEntry.size);
+    }
+    for (index = 0; index < m_managedCopyEntries.size(); ++index) {
+        ManagedCopyEntry& managedCopyEntry = m_managedCopyEntries[index];
+        managedCopyEntry.destTexture->allocate(allocator);
+        copier->copyTexture(context, managedCopyEntry.sourceTexture, managedCopyEntry.destTexture->textureId(), managedCopyEntry.size);
     }
     // If we've performed any texture copies, we need to insert a flush here into the compositor context
     // before letting the main thread proceed as it may make draw calls to the source texture of one of
     // our copy operations.
-    if (m_copyEntries.size())
+    if (m_copyEntries.size() || m_managedCopyEntries.size())
         context->flush();
 
     // If no entries left to process, auto-clear.
@@ -133,6 +144,7 @@ void CCTextureUpdater::clear()
     m_entries.clear();
     m_partialEntries.clear();
     m_copyEntries.clear();
+    m_managedCopyEntries.clear();
 }
 
 }
index a086bab..b6fc1a2 100644 (file)
@@ -38,22 +38,21 @@ class TextureCopier;
 
 class CCTextureUpdater {
 public:
-    CCTextureUpdater(TextureAllocator*, TextureCopier*);
+    CCTextureUpdater();
     ~CCTextureUpdater();
 
     void appendUpdate(LayerTextureUpdater::Texture*, const IntRect& sourceRect, const IntRect& destRect);
     void appendPartialUpdate(LayerTextureUpdater::Texture*, const IntRect& sourceRect, const IntRect& destRect);
     void appendCopy(unsigned sourceTexture, unsigned destTexture, const IntSize&);
+    void appendManagedCopy(unsigned sourceTexture, ManagedTexture* destTexture, const IntSize&);
 
     bool hasMoreUpdates() const;
 
     // Update some textures. Returns true if more textures left to process.
-    bool update(GraphicsContext3D*, size_t count);
+    bool update(GraphicsContext3D*, TextureAllocator*, TextureCopier*, size_t count);
 
     void clear();
 
-    TextureAllocator* allocator() { return m_allocator; }
-
 private:
     struct UpdateEntry {
         LayerTextureUpdater::Texture* texture;
@@ -67,14 +66,19 @@ private:
         unsigned destTexture;
     };
 
+    struct ManagedCopyEntry {
+        IntSize size;
+        unsigned sourceTexture;
+        ManagedTexture* destTexture;
+    };
+
     static void appendUpdate(LayerTextureUpdater::Texture*, const IntRect& sourceRect, const IntRect& destRect, Vector<UpdateEntry>&);
 
-    TextureAllocator* m_allocator;
-    TextureCopier* m_copier;
     size_t m_entryIndex;
     Vector<UpdateEntry> m_entries;
     Vector<UpdateEntry> m_partialEntries;
     Vector<CopyEntry> m_copyEntries;
+    Vector<ManagedCopyEntry> m_managedCopyEntries;
 };
 
 }
index 10f73ba..5bdee4e 100644 (file)
@@ -503,7 +503,7 @@ void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion
     m_commitCompletionEventOnImplThread = completion;
 
     ASSERT(!m_currentTextureUpdaterOnImplThread);
-    m_currentTextureUpdaterOnImplThread = adoptPtr(new CCTextureUpdater(m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier()));
+    m_currentTextureUpdaterOnImplThread = adoptPtr(new CCTextureUpdater);
     m_layerTreeHost->updateCompositorResources(m_layerTreeHostImpl->context(), *m_currentTextureUpdaterOnImplThread);
 
     m_schedulerOnImplThread->beginFrameComplete();
@@ -528,7 +528,7 @@ void CCThreadProxy::scheduledActionUpdateMoreResources()
 {
     TRACE_EVENT("CCThreadProxy::scheduledActionUpdateMoreResources", this, 0);
     ASSERT(m_currentTextureUpdaterOnImplThread);
-    m_currentTextureUpdaterOnImplThread->update(m_layerTreeHostImpl->context(), textureUpdatesPerFrame);
+    m_currentTextureUpdaterOnImplThread->update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), textureUpdatesPerFrame);
 }
 
 void CCThreadProxy::scheduledActionCommit()
index 644d3fe..edd728d 100644 (file)
@@ -1,3 +1,16 @@
+2012-04-09  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Defer texture id allocation for copies until the actual copy executes
+        https://bugs.webkit.org/show_bug.cgi?id=83514
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCTiledLayerTestCommon.cpp:
+        * tests/CCTiledLayerTestCommon.h:
+        * tests/Canvas2DLayerChromiumTest.cpp:
+        * tests/TiledLayerChromiumTest.cpp:
+        (WTF::TEST):
+
 2012-04-10  David Dorwin  <ddorwin@chromium.org>
 
         Add Encrypted Media Extensions methods to HTMLMediaElement
index 603d421..f7d7894 100644 (file)
@@ -126,9 +126,4 @@ FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(TextureManager* t
 {
 }
 
-FakeCCTextureUpdater::FakeCCTextureUpdater()
-    : CCTextureUpdater(&m_textureAllocator, &m_textureCopier)
-{
-}
-
 } // namespace
index efb8ae8..81bd114 100644 (file)
@@ -158,16 +158,5 @@ public:
     virtual void copyTexture(WebCore::GraphicsContext3D*, unsigned, unsigned, const WebCore::IntSize&) { }
 };
 
-class FakeCCTextureUpdater : public WebCore::CCTextureUpdater {
-public:
-    explicit FakeCCTextureUpdater();
-
-    FakeTextureAllocator& textureAllocator() { return m_textureAllocator; }
-
-protected:
-    FakeTextureAllocator m_textureAllocator;
-    FakeTextureCopier m_textureCopier;
-};
-
 }
 #endif // CCTiledLayerTestCommon_h
index d091a43..16d174f 100644 (file)
@@ -102,7 +102,7 @@ protected:
 
         MockTextureAllocator allocatorMock;
         MockTextureCopier copierMock;
-        CCTextureUpdater updater(&allocatorMock, &copierMock);
+        CCTextureUpdater updater;
 
         const IntSize size(300, 150);
 
@@ -154,10 +154,9 @@ protected:
             EXPECT_EQ(0u, static_cast<CCTextureLayerImpl*>(layerImpl.get())->textureId());
 
             canvas->updateCompositorResources(implContext.get(), updater);
+            updater.update(implContext.get(), &allocatorMock, &copierMock, 1);
             canvas->pushPropertiesTo(layerImpl.get());
 
-            updater.update(implContext.get(), 1);
-
             if (threaded)
                 EXPECT_EQ(frontTextureId, static_cast<CCTextureLayerImpl*>(layerImpl.get())->textureId());
             else
index 57dc54f..c36e51a 100644 (file)
@@ -72,7 +72,7 @@ TEST(TiledLayerChromiumTest, pushDirtyTiles)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
@@ -107,7 +107,7 @@ TEST(TiledLayerChromiumTest, pushOccludedDirtyTiles)
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
     TestCCOcclusionTracker occluded;
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
@@ -152,7 +152,9 @@ TEST(TiledLayerChromiumTest, pushDeletedTiles)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
+    FakeTextureAllocator allocator;
+    FakeTextureCopier copier;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
@@ -165,7 +167,7 @@ TEST(TiledLayerChromiumTest, pushDeletedTiles)
     EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
     EXPECT_TRUE(layerImpl->hasTileAt(0, 1));
 
-    textureManager->evictAndDeleteAllTextures(&updater.textureAllocator());
+    textureManager->evictAndDeleteAllTextures(&allocator);
     textureManager->setMaxMemoryLimitBytes(4*1024*1024);
     textureManager->setPreferredMemoryLimitBytes(4*1024*1024);
 
@@ -193,7 +195,7 @@ TEST(TiledLayerChromiumTest, pushIdlePaintTiles)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The tile size is 100x100. Setup 5x5 tiles with one visible tile in the center.
     IntSize contentBounds(500, 500);
@@ -251,7 +253,9 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
     RefPtr<FakeTiledLayerChromium> layer2 = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
     OwnPtr<FakeCCTiledLayerImpl> layerImpl2(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
+    FakeTextureAllocator allocator;
+    FakeTextureCopier copier;
 
     // For this test we have two layers. layer1 exhausts most texture memory, leaving room for 2 more tiles from
     // layer2, but not all three tiles. First we paint layer1, and one tile from layer2. Then when we idle paint
@@ -279,7 +283,7 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
     // Commit the frame over to impl.
     layer1->updateCompositorResources(0, updater);
     layer2->updateCompositorResources(0, updater);
-    updater.update(0, 5000);
+    updater.update(0, &allocator, &copier, 5000);
     layer1->pushPropertiesTo(layerImpl1.get());
     layer2->pushPropertiesTo(layerImpl2.get());
 
@@ -290,7 +294,7 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
     // Oh well, commit the frame and push.
     layer1->updateCompositorResources(0, updater);
     layer2->updateCompositorResources(0, updater);
-    updater.update(0, 5000);
+    updater.update(0, &allocator, &copier, 5000);
     layer1->pushPropertiesTo(layerImpl1.get());
     layer2->pushPropertiesTo(layerImpl2.get());
 
@@ -311,7 +315,7 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
 
     layer1->updateCompositorResources(0, updater);
     layer2->updateCompositorResources(0, updater);
-    updater.update(0, 5000);
+    updater.update(0, &allocator, &copier, 5000);
     layer1->pushPropertiesTo(layerImpl1.get());
     layer2->pushPropertiesTo(layerImpl2.get());
 
@@ -331,7 +335,7 @@ TEST(TiledLayerChromiumTest, pushIdlePaintedOccludedTiles)
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
     TestCCOcclusionTracker occluded;
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The tile size is 100x100, so this invalidates one occluded tile, culls it during paint, but prepaints it.
     occluded.setOcclusion(IntRect(0, 0, 100, 100));
@@ -356,7 +360,7 @@ TEST(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     // However, during the paint, we invalidate one of the tiles. This should
@@ -382,7 +386,7 @@ TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer)
     OwnPtr<FakeCCTiledLayerImpl> layer1Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
     OwnPtr<FakeCCTiledLayerImpl> layer2Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     layer1->setBounds(IntSize(100, 200));
     layer1->invalidateRect(IntRect(0, 0, 100, 200));
@@ -417,7 +421,7 @@ TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer
     OwnPtr<FakeCCTiledLayerImpl> layer1Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
     OwnPtr<FakeCCTiledLayerImpl> layer2Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     layer1->setBounds(IntSize(100, 200));
     layer1->invalidateRect(IntRect(0, 0, 100, 200));
@@ -458,7 +462,7 @@ TEST(TiledLayerChromiumTest, idlePaintOutOfMemory)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // This invalidates 9 tiles and then paints one visible tile.
     layer->setBounds(contentBounds);
@@ -493,7 +497,7 @@ TEST(TiledLayerChromiumTest, idlePaintZeroSizedLayer)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The layer's bounds are empty.
     IntRect contentRect;
@@ -535,7 +539,7 @@ TEST(TiledLayerChromiumTest, idlePaintZeroSizedAnimatingLayer)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // Pretend the layer is animating.
     layer->setDrawTransformIsAnimating(true);
@@ -583,7 +587,7 @@ TEST(TiledLayerChromiumTest, idlePaintNonVisibleLayers)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // Invalidate the layer but make none of it visible, so nothing paints.
     IntRect visibleRect;
@@ -637,7 +641,7 @@ TEST(TiledLayerChromiumTest, idlePaintNonVisibleAnimatingLayers)
     OwnPtr<TextureManager> textureManager = TextureManager::create(8000*8000*8, 8000*8000*4, 1024);
     DebugScopedSetImplThread implThread;
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     int tileWidth = FakeTiledLayerChromium::tileSize().width();
     int tileHeight = FakeTiledLayerChromium::tileSize().height();
@@ -694,7 +698,7 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
@@ -735,7 +739,7 @@ TEST(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled)
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerWithScaledBounds> layer = adoptRef(new FakeTiledLayerWithScaledBounds(textureManager.get()));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     IntRect layerBounds(0, 0, 300, 200);
     IntRect contentBounds(0, 0, 200, 250);
@@ -772,7 +776,7 @@ TEST(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     // Create a layer with one tile.
     layer->setBounds(IntSize(100, 100));
@@ -842,7 +846,7 @@ TEST(TiledLayerChromiumTest, skipsDrawGetsReset)
     rootLayer->invalidateRect(contentRect);
     childLayer->invalidateRect(contentRect);
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
 
     ccLayerTreeHost->setRootLayer(rootLayer);
     ccLayerTreeHost->setViewportSize(IntSize(300, 300));
@@ -913,7 +917,9 @@ TEST(TiledLayerChromiumTest, partialUpdates)
     layer->setPosition(FloatPoint(150, 150));
     layer->invalidateRect(contentRect);
 
-    FakeCCTextureUpdater updater;
+    CCTextureUpdater updater;
+    FakeTextureAllocator allocator;
+    FakeTextureCopier copier;
 
     ccLayerTreeHost->setRootLayer(layer);
     ccLayerTreeHost->setViewportSize(IntSize(300, 200));
@@ -921,11 +927,11 @@ TEST(TiledLayerChromiumTest, partialUpdates)
     // Full update of all 6 tiles.
     ccLayerTreeHost->updateLayers();
     ccLayerTreeHost->updateCompositorResources(ccLayerTreeHost->context(), updater);
-    updater.update(0, 4);
+    updater.update(0, &allocator, &copier, 4);
     EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
     EXPECT_TRUE(updater.hasMoreUpdates());
     layer->fakeLayerTextureUpdater()->clearUpdateCount();
-    updater.update(0, 4);
+    updater.update(0, &allocator, &copier, 4);
     EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount());
     EXPECT_FALSE(updater.hasMoreUpdates());
     layer->fakeLayerTextureUpdater()->clearUpdateCount();
@@ -935,11 +941,11 @@ TEST(TiledLayerChromiumTest, partialUpdates)
     layer->invalidateRect(IntRect(0, 0, 300, 150));
     ccLayerTreeHost->updateLayers();
     ccLayerTreeHost->updateCompositorResources(ccLayerTreeHost->context(), updater);
-    updater.update(0, 4);
+    updater.update(0, &allocator, &copier, 4);
     EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount());
     EXPECT_TRUE(updater.hasMoreUpdates());
     layer->fakeLayerTextureUpdater()->clearUpdateCount();
-    updater.update(0, 4);
+    updater.update(0, &allocator, &copier, 4);
     EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount());
     EXPECT_FALSE(updater.hasMoreUpdates());
     layer->fakeLayerTextureUpdater()->clearUpdateCount();
@@ -949,11 +955,11 @@ TEST(TiledLayerChromiumTest, partialUpdates)
     layer->invalidateRect(IntRect(50, 50, 200, 100));
     ccLayerTreeHost->updateLayers();
     ccLayerTreeHost->updateCompositorResources(ccLayerTreeHost->context(), updater);
-    updater.update(0, 4);
+    updater.update(0, &allocator, &copier, 4);
     EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount());
     EXPECT_TRUE(updater.hasMoreUpdates());
     layer->fakeLayerTextureUpdater()->clearUpdateCount();
-    updater.update(0, 4);
+    updater.update(0, &allocator, &copier, 4);
     EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
     EXPECT_FALSE(updater.hasMoreUpdates());
     layer->fakeLayerTextureUpdater()->clearUpdateCount();