Unreviewed, rolling out r105564.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2012 23:56:14 +0000 (23:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2012 23:56:14 +0000 (23:56 +0000)
http://trac.webkit.org/changeset/105564
https://bugs.webkit.org/show_bug.cgi?id=76792

Does not compile on Chromium Mac (Requested by abarth on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-01-21

Source/WebCore:

* platform/graphics/chromium/ManagedTexture.cpp:
* platform/graphics/chromium/ManagedTexture.h:
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::prepareToUpdateTiles):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::initialize):
(WebCore::CCLayerTreeHost::commitComplete):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCSettings::CCSettings):
* platform/graphics/chromium/cc/CCProxy.h:
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

* tests/CCLayerTreeHostTest.cpp:
(WTF::MockLayerTreeHostClient::createLayerTreeHostContext3D):
* tests/CompositorFakeWebGraphicsContext3D.h:

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp
Source/WebCore/platform/graphics/chromium/ManagedTexture.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/CompositorFakeWebGraphicsContext3D.h

index 0bd568a..146cd0b 100644 (file)
@@ -1,3 +1,27 @@
+2012-01-21  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r105564.
+        http://trac.webkit.org/changeset/105564
+        https://bugs.webkit.org/show_bug.cgi?id=76792
+
+        Does not compile on Chromium Mac (Requested by abarth on
+        #webkit).
+
+        * platform/graphics/chromium/ManagedTexture.cpp:
+        * platform/graphics/chromium/ManagedTexture.h:
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::prepareToUpdateTiles):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::initialize):
+        (WebCore::CCLayerTreeHost::commitComplete):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::CCSettings::CCSettings):
+        * platform/graphics/chromium/cc/CCProxy.h:
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
+        * platform/graphics/chromium/cc/CCThreadProxy.h:
+
 2012-01-20  Chris Marrin  <cmarrin@apple.com>
 
         Implement hardware accelerated Brightness and contrast filters
index 5bb19fa..0c1e4b7 100644 (file)
@@ -41,15 +41,6 @@ ManagedTexture::ManagedTexture(TextureManager* manager)
 {
 }
 
-ManagedTexture::ManagedTexture(TextureManager* manager, TextureToken token, IntSize size, unsigned format, unsigned textureId)
-    : m_textureManager(manager)
-    , m_token(token)
-    , m_size(size)
-    , m_format(format)
-    , m_textureId(textureId)
-{
-}
-
 ManagedTexture::~ManagedTexture()
 {
     if (m_token)
@@ -108,17 +99,6 @@ void ManagedTexture::framebufferTexture2D(GraphicsContext3D* context, TextureAll
     context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_textureId, 0);
 }
 
-PassOwnPtr<ManagedTexture> ManagedTexture::steal()
-{
-    OwnPtr<ManagedTexture> texture = adoptPtr(new ManagedTexture(m_textureManager, m_token, m_size, m_format, m_textureId));
-    m_token = 0;
-    m_size = IntSize();
-    m_format = 0;
-    m_textureId = 0;
-    return texture.release();
-}
-
-
 }
 
 #endif // USE(ACCELERATED_COMPOSITING)
index 76d62a8..1cc8bfa 100644 (file)
@@ -63,13 +63,8 @@ public:
     unsigned format() const { return m_format; }
     unsigned textureId() const { return m_textureId; }
 
-    // Steal token and textureId by instantiates a new texture using existing
-    // member variables.
-    PassOwnPtr<ManagedTexture> steal();
-
 private:
     explicit ManagedTexture(TextureManager*);
-    ManagedTexture(TextureManager*, TextureToken, IntSize, unsigned format, unsigned textureId);
 
     TextureManager* m_textureManager;
     TextureToken m_token;
index 92d102e..1430a61 100644 (file)
@@ -380,11 +380,6 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int
             if (!tile)
                 tile = createTile(i, j);
 
-            // Do post commit deletion of current texture when partial texture
-            // updates are not used.
-            if (tile->isDirty() && layerTreeHost() && !layerTreeHost()->settings().partialTextureUpdates)
-                layerTreeHost()->deleteTextureAfterCommit(tile->managedTexture()->steal());
-
             if (!tile->managedTexture()->isValid(m_tiler->tileSize(), m_textureFormat))
                 tile->m_dirtyRect = m_tiler->tileRect(tile);
 
index a2fb822..8663ec0 100644 (file)
@@ -95,9 +95,6 @@ bool CCLayerTreeHost::initialize()
     // Update m_settings based on capabilities that we got back from the renderer.
     m_settings.acceleratePainting = m_proxy->layerRendererCapabilities().usingAcceleratedPainting;
 
-    // Update m_settings based on partial update capability.
-    m_settings.partialTextureUpdates = m_settings.partialTextureUpdates && m_proxy->partialTextureUpdateCapability();
-
     m_contentsTextureManager = TextureManager::create(TextureManager::highLimitBytes(viewportSize()),
                                                       TextureManager::reclaimLimitBytes(viewportSize()),
                                                       m_proxy->layerRendererCapabilities().maxTextureSize);
@@ -168,7 +165,6 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
 
 void CCLayerTreeHost::commitComplete()
 {
-    m_deleteTextureAfterCommitList.clear();
     clearPendingUpdate();
     m_contentsTextureManager->unprotectAllTextures();
 }
@@ -518,9 +514,4 @@ void CCLayerTreeHost::stopRateLimiter(GraphicsContext3D* context)
     }
 }
 
-void CCLayerTreeHost::deleteTextureAfterCommit(PassOwnPtr<ManagedTexture> texture)
-{
-    m_deleteTextureAfterCommitList.append(texture);
-}
-
 }
index d92adc1..2f989bc 100644 (file)
@@ -76,8 +76,7 @@ struct CCSettings {
             , showPlatformLayerTree(false)
             , refreshRate(0)
             , perTilePainting(false)
-            , partialSwapEnabled(false)
-            , partialTextureUpdates(true) { }
+            , partialSwapEnabled(false) { }
 
     bool acceleratePainting;
     bool compositeOffscreen;
@@ -86,7 +85,6 @@ struct CCSettings {
     double refreshRate;
     bool perTilePainting;
     bool partialSwapEnabled;
-    bool partialTextureUpdates;
 };
 
 // Provides information on an Impl's rendering capabilities back to the CCLayerTreeHost
@@ -194,15 +192,12 @@ public:
     void startRateLimiter(GraphicsContext3D*);
     void stopRateLimiter(GraphicsContext3D*);
 
-    void deleteTextureAfterCommit(PassOwnPtr<ManagedTexture>);
-
 protected:
     CCLayerTreeHost(CCLayerTreeHostClient*, const CCSettings&);
     bool initialize();
 
 private:
     typedef Vector<RefPtr<LayerChromium> > LayerList;
-    typedef Vector<OwnPtr<ManagedTexture> > TextureList;
 
     enum PaintType { PaintVisible, PaintIdle };
     static void paintContentsIfDirty(LayerChromium*, PaintType);
@@ -238,8 +233,6 @@ private:
     float m_pageScale;
     float m_minPageScale, m_maxPageScale;
     bool m_triggerIdlePaints;
-
-    TextureList m_deleteTextureAfterCommitList;
 };
 
 }
index 937c154..bb37801 100644 (file)
@@ -79,10 +79,6 @@ public:
     virtual void start() = 0; // Must be called before using the proxy.
     virtual void stop() = 0; // Must be called before deleting the proxy.
 
-    // Whether sub-regions of textures can be updated or if complete texture
-    // updates are required.
-    virtual bool partialTextureUpdateCapability() const = 0;
-
     // Debug hooks
 #ifndef NDEBUG
     static bool isMainThread();
index 4faa229..0d5a4a2 100644 (file)
@@ -54,7 +54,6 @@ public:
     virtual void setVisible(bool);
     virtual void start();
     virtual void stop();
-    virtual bool partialTextureUpdateCapability() const { return true; }
 
     // CCLayerTreeHostImplClient implementation
     virtual void onSwapBuffersCompleteOnImplThread() { ASSERT_NOT_REACHED(); }
index 32a8630..9033135 100644 (file)
 #include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 
-using namespace std;
 using namespace WTF;
 
-namespace {
-
-static const size_t textureUpdatesPerFrame = numeric_limits<size_t>::max();
-
-} // anonymous namespace
-
 namespace WebCore {
 
 PassOwnPtr<CCProxy> CCThreadProxy::create(CCLayerTreeHost* layerTreeHost)
@@ -445,7 +438,8 @@ void CCThreadProxy::scheduledActionUpdateMoreResources()
 {
     TRACE_EVENT("CCThreadProxy::scheduledActionUpdateMoreResources", this, 0);
     ASSERT(m_currentTextureUpdaterOnImplThread);
-    m_currentTextureUpdaterOnImplThread->update(m_layerTreeHostImpl->context(), textureUpdatesPerFrame);
+    static const int UpdatesPerFrame = 99999;
+    m_currentTextureUpdaterOnImplThread->update(m_layerTreeHostImpl->context(), UpdatesPerFrame);
 }
 
 void CCThreadProxy::scheduledActionCommit()
@@ -571,9 +565,4 @@ void CCThreadProxy::layerTreeHostClosedOnImplThread(CCCompletionEvent* completio
     completion->signal();
 }
 
-bool CCThreadProxy::partialTextureUpdateCapability() const
-{
-    return textureUpdatesPerFrame == numeric_limits<size_t>::max();
-}
-
 } // namespace WebCore
index a11b527..a41c0d5 100644 (file)
@@ -62,7 +62,6 @@ public:
     virtual void setVisible(bool);
     virtual void start();
     virtual void stop();
-    virtual bool partialTextureUpdateCapability() const;
 
     // CCLayerTreeHostImplClient implementation
     virtual void onSwapBuffersCompleteOnImplThread();
index 02539ad..25c258e 100644 (file)
@@ -1,3 +1,16 @@
+2012-01-21  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r105564.
+        http://trac.webkit.org/changeset/105564
+        https://bugs.webkit.org/show_bug.cgi?id=76792
+
+        Does not compile on Chromium Mac (Requested by abarth on
+        #webkit).
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::MockLayerTreeHostClient::createLayerTreeHostContext3D):
+        * tests/CompositorFakeWebGraphicsContext3D.h:
+
 2012-01-20  Alexandre Elias  <aelias@google.com>
 
         [chromium] Write unit tests for compositor-thread zooming
index 58de759..9518596 100644 (file)
@@ -26,9 +26,9 @@
 
 #include "cc/CCLayerTreeHost.h"
 
-#include "CompositorFakeWebGraphicsContext3D.h"
+#include "CompositorFakeGraphicsContext3D.h"
 #include "ContentLayerChromium.h"
-#include "GraphicsContext3DPrivate.h"
+#include "FakeWebGraphicsContext3D.h"
 #include "LayerChromium.h"
 #include "TextureManager.h"
 #include "WebCompositor.h"
@@ -40,7 +40,6 @@
 #include "cc/CCThreadTask.h"
 #include "platform/WebKitPlatformSupport.h"
 #include "platform/WebThread.h"
-#include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <webkit/support/webkit_support.h>
 #include <wtf/MainThread.h>
@@ -131,52 +130,6 @@ private:
     TestHooks* m_testHooks;
 };
 
-class CompositorFakeWebGraphicsContext3DWithTextureTracking : public CompositorFakeWebGraphicsContext3D {
-public:
-    static PassOwnPtr<CompositorFakeWebGraphicsContext3DWithTextureTracking> create(Attributes attrs)
-    {
-        return adoptPtr(new CompositorFakeWebGraphicsContext3DWithTextureTracking(attrs));
-    }
-
-    virtual WebGLId createTexture()
-    {
-        WebGLId texture = m_textures.size() + 1;
-        m_textures.append(texture);
-        return texture;
-    }
-
-    virtual void deleteTexture(WebGLId texture)
-    {
-        for (size_t i = 0; i < m_textures.size(); i++) {
-            if (m_textures[i] == texture) {
-                m_textures.remove(i);
-                break;
-            }
-        }
-    }
-
-    virtual void bindTexture(WGC3Denum /* target */, WebGLId texture)
-    {
-        m_usedTextures.add(texture);
-    }
-
-    int numTextures() const { return static_cast<int>(m_textures.size()); }
-    int texture(int i) const { return m_textures[i]; }
-    void resetTextures() { m_textures.clear(); }
-
-    int numUsedTextures() const { return static_cast<int>(m_usedTextures.size()); }
-    bool usedTexture(int texture) const { return m_usedTextures.find(texture) != m_usedTextures.end(); }
-    void resetUsedTextures() { m_usedTextures.clear(); }
-
-private:
-    explicit CompositorFakeWebGraphicsContext3DWithTextureTracking(Attributes attrs) : CompositorFakeWebGraphicsContext3D(attrs)
-    {
-    }
-
-    Vector<WebGLId> m_textures;
-    HashSet<WebGLId> m_usedTextures;
-};
-
 // Implementation of CCLayerTreeHost callback interface.
 class MockLayerTreeHostClient : public CCLayerTreeHostClient {
 public:
@@ -202,15 +155,7 @@ public:
 
     virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D()
     {
-        GraphicsContext3D::Attributes attrs;
-        WebGraphicsContext3D::Attributes webAttrs;
-        webAttrs.alpha = attrs.alpha;
-
-        OwnPtr<WebGraphicsContext3D> webContext = CompositorFakeWebGraphicsContext3DWithTextureTracking::create(webAttrs);
-        return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(
-            webContext.release(), attrs, 0,
-            GraphicsContext3D::RenderDirectlyToHostWindow,
-            GraphicsContext3DPrivate::ForUseOnAnotherThread);
+        return createCompositorMockGraphicsContext3D(GraphicsContext3D::Attributes());
     }
 
     virtual void didCommitAndDrawFrame()
@@ -1123,101 +1068,4 @@ TEST_F(CCLayerTreeHostTestSetViewportSize, runSingleThread)
     runTest(false);
 }
 
-class MockContentLayerDelegate : public ContentLayerDelegate {
-public:
-    bool drawsContent() const { return true; }
-    MOCK_CONST_METHOD0(preserves3D, bool());
-    void paintContents(GraphicsContext&, const IntRect&) { }
-    void notifySyncRequired() { }
-};
-
-// Verify atomicity of commits and reuse of textures.
-class CCLayerTreeHostTestAtomicCommit : public CCLayerTreeHostTest {
-public:
-    CCLayerTreeHostTestAtomicCommit()
-        : m_updateCheckLayer(ContentLayerChromiumWithUpdateTracking::create(&m_delegate))
-        , m_numCommits(0)
-    {
-        // Make sure partial texture updates are turned off.
-        m_settings.partialTextureUpdates = false;
-    }
-
-    virtual void beginTest()
-    {
-        m_layerTreeHost->setRootLayer(m_updateCheckLayer);
-        m_layerTreeHost->setViewportSize(IntSize(10, 10));
-
-        postSetNeedsCommitToMainThread();
-        postSetNeedsRedrawToMainThread();
-    }
-
-    virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl)
-    {
-        CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()));
-
-        switch (impl->frameNumber()) {
-        case 0:
-            // Number of textures should be one.
-            EXPECT_EQ(1, context->numTextures());
-            // Number of textures used for commit should be one.
-            EXPECT_EQ(1, context->numUsedTextures());
-            // Verify used texture is correct.
-            EXPECT_TRUE(context->usedTexture(context->texture(0)));
-
-            context->resetUsedTextures();
-            break;
-        case 1:
-            // Number of textures should be two as the first texture
-            // is used by impl thread and cannot by used for update.
-            EXPECT_EQ(2, context->numTextures());
-            // Number of textures used for commit should still be one.
-            EXPECT_EQ(1, context->numUsedTextures());
-            // First texture should not have been used.
-            EXPECT_FALSE(context->usedTexture(context->texture(0)));
-            // New texture should have been used.
-            EXPECT_TRUE(context->usedTexture(context->texture(1)));
-
-            context->resetUsedTextures();
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-        }
-    }
-
-    virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl)
-    {
-        CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()));
-
-        // Number of textures used for draw should always be one.
-        EXPECT_EQ(1, context->numUsedTextures());
-
-        if (impl->frameNumber() < 2) {
-            context->resetUsedTextures();
-            postSetNeedsAnimateAndCommitToMainThread();
-            postSetNeedsRedrawToMainThread();
-        } else
-            endTest();
-    }
-
-    virtual void layout()
-    {
-        m_updateCheckLayer->setNeedsDisplay();
-    }
-
-    virtual void afterTest()
-    {
-    }
-
-private:
-    MockContentLayerDelegate m_delegate;
-    RefPtr<ContentLayerChromiumWithUpdateTracking> m_updateCheckLayer;
-    int m_numCommits;
-};
-
-TEST_F(CCLayerTreeHostTestAtomicCommit, runMultiThread)
-{
-    runTest(true);
-}
-
 } // namespace
index 0790639..de1409b 100644 (file)
@@ -43,7 +43,7 @@ public:
     virtual void getShaderiv(WebGLId, WGC3Denum, WGC3Dint* value) { *value = 1; }
     virtual void getProgramiv(WebGLId, WGC3Denum, WGC3Dint* value) { *value = 1; }
 
-protected:
+private:
     explicit CompositorFakeWebGraphicsContext3D(Attributes attrs)
     {
         m_attrs = attrs;