WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-83972-20120414202757.patch (text/plain), 27.09 KB, created by
David Reveman
on 2012-04-14 20:27:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
David Reveman
Created:
2012-04-14 20:27:58 PDT
Size:
27.09 KB
patch
obsolete
>Subversion Revision: 114209 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 00b9b7ef8d6b531ab950940edcaace3e5cdc916f..e9e03b77010bbbaad3634b224ce198eb3db09314 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2012-04-14 David Reveman <reveman@chromium.org> >+ >+ [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 NOBODY (OOPS!). >+ >+ 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-14 Joe Thomas <joethomas@motorola.com> > > Viewport-percentage Length units does not work for Replaced elements size >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 6829267163736811da39f7f800c43edfe95e8af9..5f5c0a58a8338208bf245e1c5fab22de0492c135 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,18 @@ >+2012-04-14 David Reveman <reveman@chromium.org> >+ >+ [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 NOBODY (OOPS!). >+ >+ * tests/CCTiledLayerTestCommon.h: >+ (FakeTextureUploader): >+ (WebKitTests::FakeTextureUploader::uploadTexture): >+ (WebKitTests): >+ * tests/Canvas2DLayerChromiumTest.cpp: >+ * tests/TiledLayerChromiumTest.cpp: >+ (WTF::TEST): >+ > 2012-04-13 David Reveman <reveman@chromium.org> > > [Chromium] Avoid unnecessary full tile updates for checkerboard tiles. >diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi >index 1a27d63b69d95863d175dba48bc3554121f8b5d7..9600e8e7bcf71f47ef2f88b0af3004b56ddfc472 100644 >--- a/Source/WebCore/WebCore.gypi >+++ b/Source/WebCore/WebCore.gypi >@@ -3571,6 +3571,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', >diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >index 7d640a57e0391ff95c4928aeaed6a9260df5cb95..52f5d7bfd97851341e761189acba43ea193fe43b 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >@@ -1399,6 +1399,7 @@ bool LayerRendererChromium::initializeSharedObjects() > 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) >@@ -1725,6 +1726,7 @@ void LayerRendererChromium::cleanupSharedObjects() > if (m_offscreenFramebufferId) > GLC(m_context.get(), m_context->deleteFramebuffer(m_offscreenFramebufferId)); > m_textureCopier.clear(); >+ m_textureUploader.clear(); > > releaseRenderSurfaceTextures(); > } >diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h >index 662d9c5a94d79aaf3b530cbae31cad74bcf246d8..e00a71ac646e01e28fdd20d9eec65ca407f92200 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h >+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h >@@ -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" >@@ -146,6 +147,7 @@ public: > > 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(); } > >@@ -260,6 +262,7 @@ private: > > OwnPtr<TextureManager> m_renderSurfaceTextureManager; > OwnPtr<AcceleratedTextureCopier> m_textureCopier; >+ OwnPtr<AcceleratedTextureUploader> m_textureUploader; > OwnPtr<TrackingTextureAllocator> m_contentsTextureAllocator; > OwnPtr<TrackingTextureAllocator> m_renderSurfaceTextureAllocator; > >diff --git a/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp b/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..556fe0e0cb206f03a043e3d68e2e561e21c01dfc >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp >@@ -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); >+} >+ >+} >diff --git a/Source/WebCore/platform/graphics/chromium/TextureUploader.h b/Source/WebCore/platform/graphics/chromium/TextureUploader.h >new file mode 100644 >index 0000000000000000000000000000000000000000..afed54a4aecc034ffae362b9eb1c3e19dc88b0ab >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/TextureUploader.h >@@ -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 >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp >index b139cd4daf63eefb1d5543ab353f12f6decdd8ff..fc947b0e57e2267a1434610c9dfde14af201d720 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp >@@ -197,7 +197,7 @@ void CCSingleThreadProxy::doCommit(CCTextureUpdater& updater) > 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()); >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp >index a7304d717bbf033b0c7d3017b40f89dbaab23cce..e1743a8c9fd9b473953cbcd52c9dc257463da1b7 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp >@@ -33,6 +33,7 @@ > #include "LayerTextureUpdater.h" > #include "ManagedTexture.h" > #include "TextureCopier.h" >+#include "TextureUploader.h" > > using namespace std; > >@@ -91,13 +92,13 @@ bool CCTextureUpdater::hasMoreUpdates() const > 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 @@ bool CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allo > > 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) { >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h >index b6fc1a24b6988146d64b5b7d6e15743ebccf4462..01508bfa2245eb3e8d92c101e16111aa073defca 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h >@@ -35,6 +35,7 @@ namespace WebCore { > class GraphicsContext3D; > class TextureAllocator; > class TextureCopier; >+class TextureUploader; > > class CCTextureUpdater { > public: >@@ -49,7 +50,7 @@ public: > 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(); > >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp >index 20325efe0086fb92e9c739a53c87706034f07e2a..ecf955ea66b3c2a70952b787d3595ea2914775e9 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp >@@ -527,7 +527,7 @@ void CCThreadProxy::scheduledActionUpdateMoreResources() > { > 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() >diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h >index 97a130483de42570717b466b781d89c6e6c0d12e..8863dab5dc8e5db0dc5ecbb85843110194799dee 100644 >--- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h >+++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h >@@ -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 @@ public: > 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 >diff --git a/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp >index a0f8006e472e3fce8c958fdfdfccfe877d607373..0bae223d0e1b3989c2e5341121df83c4e83b73e8 100644 >--- a/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp >+++ b/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp >@@ -88,6 +88,11 @@ public: > 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 @@ protected: > > MockTextureAllocator allocatorMock; > MockTextureCopier copierMock; >+ MockTextureUploader uploaderMock; > CCTextureUpdater updater; > > const IntSize size(300, 150); >@@ -153,7 +159,7 @@ protected: > 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) >diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp >index 36563b4863df53fbd7bf92296c0ce9556334a056..5b7cb0df75c972489cbc1ce24775bb4e9c8f1bd4 100644 >--- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp >+++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp >@@ -150,7 +150,6 @@ TEST(TiledLayerChromiumTest, pushDeletedTiles) > > 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 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) > 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 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) > 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 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) > 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 @@ TEST(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) > 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 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare) > 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 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare) > // 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 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare) > 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 @@ TEST(TiledLayerChromiumTest, partialUpdates) > CCTextureUpdater updater; > FakeTextureAllocator allocator; > FakeTextureCopier copier; >+ FakeTextureUploader uploader; > > ccLayerTreeHost->setRootLayer(layer); > ccLayerTreeHost->setViewportSize(IntSize(300, 200)); >@@ -898,11 +900,11 @@ TEST(TiledLayerChromiumTest, partialUpdates) > { > 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 @@ TEST(TiledLayerChromiumTest, partialUpdates) > { > 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 @@ TEST(TiledLayerChromiumTest, partialUpdates) > 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 @@ TEST(TiledLayerChromiumTest, partialUpdates) > 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();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 83972
:
137197
| 137229