Diff
Modified: trunk/Source/WebCore/ChangeLog (114449 => 114450)
--- trunk/Source/WebCore/ChangeLog 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/ChangeLog 2012-04-17 22:42:11 UTC (rev 114450)
@@ -1,3 +1,40 @@
+2012-04-17 David Reveman <[email protected]>
+
+ [Chromium] Add TextureUploader which allows us to use persistent GC3D state for texture uploads.
+ https://bugs.webkit.org/show_bug.cgi?id=83972
+
+ Reviewed by James Robinson.
+
+ Add TextureUploader class that allows us to add persistent GC3D state to the upload machinery.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ (WebCore::LayerRendererChromium::cleanupSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebCore::LayerRendererChromium::textureUploader):
+ (LayerRendererChromium):
+ * platform/graphics/chromium/TextureUploader.cpp: Added.
+ (WebCore):
+ (WebCore::AcceleratedTextureUploader::AcceleratedTextureUploader):
+ (WebCore::AcceleratedTextureUploader::~AcceleratedTextureUploader):
+ (WebCore::AcceleratedTextureUploader::uploadTexture):
+ * platform/graphics/chromium/TextureUploader.h: Added.
+ (WebCore):
+ (TextureUploader):
+ (WebCore::TextureUploader::~TextureUploader):
+ (AcceleratedTextureUploader):
+ (WebCore::AcceleratedTextureUploader::create):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::doCommit):
+ * platform/graphics/chromium/cc/CCTextureUpdater.cpp:
+ (WebCore::CCTextureUpdater::update):
+ * platform/graphics/chromium/cc/CCTextureUpdater.h:
+ (WebCore):
+ (CCTextureUpdater):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
+
2012-04-17 Luke Macpherson <[email protected]>
Clean up CSSParser::parseFillRepeat().
Modified: trunk/Source/WebCore/WebCore.gypi (114449 => 114450)
--- trunk/Source/WebCore/WebCore.gypi 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/WebCore.gypi 2012-04-17 22:42:11 UTC (rev 114450)
@@ -3576,6 +3576,8 @@
'platform/graphics/chromium/TextureCopier.h',
'platform/graphics/chromium/TextureManager.cpp',
'platform/graphics/chromium/TextureManager.h',
+ 'platform/graphics/chromium/TextureUploader.cpp',
+ 'platform/graphics/chromium/TextureUploader.h',
'platform/graphics/chromium/TiledLayerChromium.cpp',
'platform/graphics/chromium/TiledLayerChromium.h',
'platform/graphics/chromium/TransparencyWin.cpp',
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (114449 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -1402,6 +1402,7 @@
TextureManager::reclaimLimitBytes(viewportSize()),
m_capabilities.maxTextureSize);
m_textureCopier = AcceleratedTextureCopier::create(m_context.get());
+ m_textureUploader = AcceleratedTextureUploader::create(m_context.get());
m_contentsTextureAllocator = TrackingTextureAllocator::create(m_context.get());
m_renderSurfaceTextureAllocator = TrackingTextureAllocator::create(m_context.get());
if (m_capabilities.usingTextureUsageHint)
@@ -1728,6 +1729,7 @@
if (m_offscreenFramebufferId)
GLC(m_context.get(), m_context->deleteFramebuffer(m_offscreenFramebufferId));
m_textureCopier.clear();
+ m_textureUploader.clear();
releaseRenderSurfaceTextures();
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (114449 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h 2012-04-17 22:42:11 UTC (rev 114450)
@@ -39,6 +39,7 @@
#include "IntRect.h"
#include "LayerChromium.h"
#include "TextureCopier.h"
+#include "TextureUploader.h"
#include "TrackingTextureAllocator.h"
#include "cc/CCDrawQuad.h"
#include "cc/CCHeadsUpDisplay.h"
@@ -140,6 +141,7 @@
TextureManager* renderSurfaceTextureManager() const { return m_renderSurfaceTextureManager.get(); }
TextureCopier* textureCopier() const { return m_textureCopier.get(); }
+ TextureUploader* textureUploader() const { return m_textureUploader.get(); }
TextureAllocator* renderSurfaceTextureAllocator() const { return m_renderSurfaceTextureAllocator.get(); }
TextureAllocator* contentsTextureAllocator() const { return m_contentsTextureAllocator.get(); }
@@ -246,6 +248,7 @@
OwnPtr<TextureManager> m_renderSurfaceTextureManager;
OwnPtr<AcceleratedTextureCopier> m_textureCopier;
+ OwnPtr<AcceleratedTextureUploader> m_textureUploader;
OwnPtr<TrackingTextureAllocator> m_contentsTextureAllocator;
OwnPtr<TrackingTextureAllocator> m_renderSurfaceTextureAllocator;
Added: trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp (0 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp (rev 0)
+++ trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "TextureUploader.h"
+
+namespace WebCore {
+
+AcceleratedTextureUploader::AcceleratedTextureUploader(PassRefPtr<GraphicsContext3D> context)
+ : m_context(context)
+{
+}
+
+AcceleratedTextureUploader::~AcceleratedTextureUploader()
+{
+}
+
+void AcceleratedTextureUploader::uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect)
+{
+ texture->updateRect(context, allocator, sourceRect, destRect);
+}
+
+}
Added: trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.h (0 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.h 2012-04-17 22:42:11 UTC (rev 114450)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TextureUploader_h
+#define TextureUploader_h
+
+#include "LayerTextureUpdater.h"
+
+namespace WebCore {
+
+class TextureUploader {
+public:
+ virtual void uploadTexture(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) = 0;
+
+protected:
+ virtual ~TextureUploader() { }
+};
+
+class AcceleratedTextureUploader : public TextureUploader {
+ WTF_MAKE_NONCOPYABLE(AcceleratedTextureUploader);
+public:
+ static PassOwnPtr<AcceleratedTextureUploader> create(PassRefPtr<GraphicsContext3D> context)
+ {
+ return adoptPtr(new AcceleratedTextureUploader(context));
+ }
+ virtual ~AcceleratedTextureUploader();
+
+ virtual void uploadTexture(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect);
+
+protected:
+ explicit AcceleratedTextureUploader(PassRefPtr<GraphicsContext3D>);
+
+ RefPtr<GraphicsContext3D> m_context;
+};
+
+}
+
+#endif
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (114449 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -197,7 +197,7 @@
m_layerTreeHostImpl->beginCommit();
m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
- updater.update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), numeric_limits<size_t>::max());
+ updater.update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader(), numeric_limits<size_t>::max());
ASSERT(!updater.hasMoreUpdates());
m_layerTreeHostImpl->setVisible(m_layerTreeHost->visible());
m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp (114449 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -33,6 +33,7 @@
#include "LayerTextureUpdater.h"
#include "ManagedTexture.h"
#include "TextureCopier.h"
+#include "TextureUploader.h"
using namespace std;
@@ -91,13 +92,13 @@
return m_entries.size() || m_partialEntries.size() || m_copyEntries.size() || m_managedCopyEntries.size();
}
-bool CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allocator, TextureCopier* copier, size_t count)
+bool CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allocator, TextureCopier* copier, TextureUploader* uploader, 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, allocator, entry.sourceRect, entry.destRect);
+ uploader->uploadTexture(context, entry.texture, allocator, entry.sourceRect, entry.destRect);
}
bool moreUpdates = maxIndex < m_entries.size();
@@ -115,7 +116,7 @@
for (index = 0; index < m_partialEntries.size(); ++index) {
UpdateEntry& entry = m_partialEntries[index];
- entry.texture->updateRect(context, allocator, entry.sourceRect, entry.destRect);
+ uploader->uploadTexture(context, entry.texture, allocator, entry.sourceRect, entry.destRect);
}
for (index = 0; index < m_copyEntries.size(); ++index) {
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h (114449 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h 2012-04-17 22:42:11 UTC (rev 114450)
@@ -35,6 +35,7 @@
class GraphicsContext3D;
class TextureAllocator;
class TextureCopier;
+class TextureUploader;
class CCTextureUpdater {
public:
@@ -49,7 +50,7 @@
bool hasMoreUpdates() const;
// Update some textures. Returns true if more textures left to process.
- bool update(GraphicsContext3D*, TextureAllocator*, TextureCopier*, size_t count);
+ bool update(GraphicsContext3D*, TextureAllocator*, TextureCopier*, TextureUploader*, size_t count);
void clear();
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (114449 => 114450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -527,7 +527,7 @@
{
TRACE_EVENT("CCThreadProxy::scheduledActionUpdateMoreResources", this, 0);
ASSERT(m_currentTextureUpdaterOnImplThread);
- m_currentTextureUpdaterOnImplThread->update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), textureUpdatesPerFrame);
+ m_currentTextureUpdaterOnImplThread->update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader(), textureUpdatesPerFrame);
}
void CCThreadProxy::scheduledActionCommit()
Modified: trunk/Source/WebKit/chromium/ChangeLog (114449 => 114450)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-04-17 22:42:11 UTC (rev 114450)
@@ -1,3 +1,18 @@
+2012-04-17 David Reveman <[email protected]>
+
+ [Chromium] Add TextureUploader which allows us to use persistent GC3D state for texture uploads.
+ https://bugs.webkit.org/show_bug.cgi?id=83972
+
+ Reviewed by James Robinson.
+
+ * tests/CCTiledLayerTestCommon.h:
+ (FakeTextureUploader):
+ (WebKitTests::FakeTextureUploader::uploadTexture):
+ (WebKitTests):
+ * tests/Canvas2DLayerChromiumTest.cpp:
+ * tests/TiledLayerChromiumTest.cpp:
+ (WTF::TEST):
+
2012-04-17 Alec Flett <[email protected]>
IndexedDB: stub getKey/getObject interfaces for IDBKeyRange
Modified: trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h (114449 => 114450)
--- trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h 2012-04-17 22:42:11 UTC (rev 114450)
@@ -32,6 +32,7 @@
#include "Region.h"
#include "TextureCopier.h"
#include "TextureManager.h"
+#include "TextureUploader.h"
#include "TiledLayerChromium.h"
#include "cc/CCTextureUpdater.h"
#include "cc/CCTiledLayerImpl.h"
@@ -158,5 +159,10 @@
virtual void copyTexture(WebCore::GraphicsContext3D*, unsigned, unsigned, const WebCore::IntSize&) { }
};
+class FakeTextureUploader : public WebCore::TextureUploader {
+public:
+ virtual void uploadTexture(WebCore::GraphicsContext3D* context, WebCore::LayerTextureUpdater::Texture* texture, WebCore::TextureAllocator* allocator, const WebCore::IntRect sourceRect, const WebCore::IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
+};
+
}
#endif // CCTiledLayerTestCommon_h
Modified: trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp (114449 => 114450)
--- trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -88,6 +88,11 @@
MOCK_METHOD4(copyTexture, void(GraphicsContext3D*, unsigned, unsigned, const IntSize&));
};
+class MockTextureUploader : public TextureUploader {
+public:
+ MOCK_METHOD5(uploadTexture, void(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect, const IntRect));
+};
+
class Canvas2DLayerChromiumTest : public Test {
protected:
void fullLifecycleTest(bool threaded)
@@ -102,6 +107,7 @@
MockTextureAllocator allocatorMock;
MockTextureCopier copierMock;
+ MockTextureUploader uploaderMock;
CCTextureUpdater updater;
const IntSize size(300, 150);
@@ -153,7 +159,7 @@
OwnPtr<CCLayerImpl> layerImpl = canvas->createCCLayerImpl();
EXPECT_EQ(0u, static_cast<CCTextureLayerImpl*>(layerImpl.get())->textureId());
- updater.update(implContext.get(), &allocatorMock, &copierMock, 1);
+ updater.update(implContext.get(), &allocatorMock, &copierMock, &uploaderMock, 1);
canvas->pushPropertiesTo(layerImpl.get());
if (threaded)
Modified: trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp (114449 => 114450)
--- trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-04-17 22:37:28 UTC (rev 114449)
+++ trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-04-17 22:42:11 UTC (rev 114450)
@@ -150,7 +150,6 @@
CCTextureUpdater updater;
FakeTextureAllocator allocator;
- FakeTextureCopier copier;
// The tile size is 100x100, so this invalidates and then paints two tiles.
layer->setBounds(IntSize(100, 200));
@@ -248,6 +247,7 @@
CCTextureUpdater updater;
FakeTextureAllocator allocator;
FakeTextureCopier copier;
+ FakeTextureUploader uploader;
// 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
@@ -273,7 +273,7 @@
EXPECT_TRUE(layer2->needsIdlePaint(layer2Rect));
// Commit the frame over to impl.
- updater.update(0, &allocator, &copier, 5000);
+ updater.update(0, &allocator, &copier, &uploader, 5000);
layer1->pushPropertiesTo(layerImpl1.get());
layer2->pushPropertiesTo(layerImpl2.get());
@@ -282,7 +282,7 @@
layer2->idleUpdateLayerRect(updater, layer2Rect, 0);
// Oh well, commit the frame and push.
- updater.update(0, &allocator, &copier, 5000);
+ updater.update(0, &allocator, &copier, &uploader, 5000);
layer1->pushPropertiesTo(layerImpl1.get());
layer2->pushPropertiesTo(layerImpl2.get());
@@ -301,7 +301,7 @@
layer2->updateLayerRect(updater, layer2Rect, 0);
layer1->updateLayerRect(updater, IntRect(), 0);
- updater.update(0, &allocator, &copier, 5000);
+ updater.update(0, &allocator, &copier, &uploader, 5000);
layer1->pushPropertiesTo(layerImpl1.get());
layer2->pushPropertiesTo(layerImpl2.get());
@@ -669,13 +669,14 @@
CCTextureUpdater updater;
FakeTextureAllocator fakeAllocator;
FakeTextureCopier fakeCopier;
+ FakeTextureUploader fakeUploader;
RefPtr<GraphicsContext3D> context = createCompositorMockGraphicsContext3D(GraphicsContext3D::Attributes());
// The tile size is 100x100, so this invalidates and then paints two tiles.
layer->setBounds(IntSize(100, 200));
layer->invalidateRect(IntRect(0, 0, 100, 200));
layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
- updater.update(context.get(), &fakeAllocator, &fakeCopier, 1000);
+ updater.update(context.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
layer->pushPropertiesTo(layerImpl.get());
// We should have both tiles on the impl side.
@@ -688,7 +689,7 @@
// Invoke updateLayerRect again. As the layer is valid updateLayerRect shouldn't be invoked on
// the LayerTextureUpdater.
layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
- updater.update(context.get(), &fakeAllocator, &fakeCopier, 1000);
+ updater.update(context.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount());
layer->invalidateRect(IntRect(0, 0, 50, 50));
@@ -696,12 +697,12 @@
layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
layer->fakeLayerTextureUpdater()->clearPrepareCount();
layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
- updater.update(context.get(), &fakeAllocator, &fakeCopier, 1000);
+ updater.update(context.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
layer->fakeLayerTextureUpdater()->clearPrepareCount();
// The layer should still be invalid as updateLayerRect invoked invalidate.
layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
- updater.update(context.get(), &fakeAllocator, &fakeCopier, 1000);
+ updater.update(context.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
}
@@ -889,6 +890,7 @@
CCTextureUpdater updater;
FakeTextureAllocator allocator;
FakeTextureCopier copier;
+ FakeTextureUploader uploader;
ccLayerTreeHost->setRootLayer(layer);
ccLayerTreeHost->setViewportSize(IntSize(300, 200));
@@ -898,11 +900,11 @@
{
DebugScopedSetImplThread implThread;
OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_TRUE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_FALSE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
@@ -916,11 +918,11 @@
{
DebugScopedSetImplThread implThread;
OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_TRUE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_FALSE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
@@ -934,11 +936,11 @@
DebugScopedSetImplThread implThread;
OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
ccLayerTreeHost->updateLayers(updater);
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_TRUE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_FALSE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
@@ -961,11 +963,11 @@
DebugScopedSetImplThread implThread;
OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
ccLayerTreeHost->updateLayers(updater);
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_TRUE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();
- updater.update(0, &allocator, &copier, 4);
+ updater.update(0, &allocator, &copier, &uploader, 4);
EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount());
EXPECT_FALSE(updater.hasMoreUpdates());
layer->fakeLayerTextureUpdater()->clearUpdateCount();