Title: [95148] trunk/Source/WebCore
Revision
95148
Author
jam...@google.com
Date
2011-09-14 18:32:18 -0700 (Wed, 14 Sep 2011)

Log Message

Added a pure virtual class CCLayerDelegate which helps to isolate
the chromium compositor from the rest of WebCore, and aids unit
testing by being easily mockable.  The compositor layers no longer
directly see instances of GraphicsLayerChromium, instead they use
this interface.
https://bugs.webkit.org/show_bug.cgi?id=67750

Patch by Antoine Labour <pi...@chromium.org> on 2011-09-14
Reviewed by James Robinson.

No new tests: changes already covered by existing compositing layout
tests.

* platform/graphics/chromium/CanvasLayerChromium.cpp:
(WebCore::CanvasLayerChromium::CanvasLayerChromium):
* platform/graphics/chromium/CanvasLayerChromium.h:
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerPainter::create):
(WebCore::ContentLayerPainter::paint):
(WebCore::ContentLayerPainter::ContentLayerPainter):
(WebCore::ContentLayerChromium::create):
(WebCore::ContentLayerChromium::ContentLayerChromium):
(WebCore::ContentLayerChromium::drawsContent):
* platform/graphics/chromium/ContentLayerChromium.h:
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::getDrawsContent):
(WebCore::GraphicsLayerChromium::getPreserves3D):
(WebCore::GraphicsLayerChromium::paintingGoesToWindow):
(WebCore::GraphicsLayerChromium::doPaintGraphicsLayerContents):
(WebCore::GraphicsLayerChromium::notifySyncRequired):
* platform/graphics/chromium/GraphicsLayerChromium.h:
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::create):
(WebCore::ImageLayerChromium::ImageLayerChromium):
* platform/graphics/chromium/ImageLayerChromium.h:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::create):
(WebCore::LayerChromium::LayerChromium):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::CCLayerDelegate::~CCLayerDelegate):
(WebCore::LayerChromium::preserves3D):
(WebCore::LayerChromium::setOwner):
* platform/graphics/chromium/PluginLayerChromium.cpp:
(WebCore::PluginLayerChromium::create):
(WebCore::PluginLayerChromium::PluginLayerChromium):
* platform/graphics/chromium/PluginLayerChromium.h:
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::TiledLayerChromium):
* platform/graphics/chromium/TiledLayerChromium.h:
* platform/graphics/chromium/VideoLayerChromium.cpp:
(WebCore::VideoLayerChromium::create):
(WebCore::VideoLayerChromium::VideoLayerChromium):
(WebCore::VideoLayerChromium::updateCompositorResources):
* platform/graphics/chromium/VideoLayerChromium.h:
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::create):
(WebCore::WebGLLayerChromium::WebGLLayerChromium):
* platform/graphics/chromium/WebGLLayerChromium.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95147 => 95148)


--- trunk/Source/WebCore/ChangeLog	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/ChangeLog	2011-09-15 01:32:18 UTC (rev 95148)
@@ -1,3 +1,63 @@
+2011-09-14  Antoine Labour  <pi...@chromium.org>
+
+        Added a pure virtual class CCLayerDelegate which helps to isolate
+        the chromium compositor from the rest of WebCore, and aids unit
+        testing by being easily mockable.  The compositor layers no longer
+        directly see instances of GraphicsLayerChromium, instead they use
+        this interface.
+        https://bugs.webkit.org/show_bug.cgi?id=67750
+
+        Reviewed by James Robinson.
+
+        No new tests: changes already covered by existing compositing layout
+        tests.
+
+        * platform/graphics/chromium/CanvasLayerChromium.cpp:
+        (WebCore::CanvasLayerChromium::CanvasLayerChromium):
+        * platform/graphics/chromium/CanvasLayerChromium.h:
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerPainter::create):
+        (WebCore::ContentLayerPainter::paint):
+        (WebCore::ContentLayerPainter::ContentLayerPainter):
+        (WebCore::ContentLayerChromium::create):
+        (WebCore::ContentLayerChromium::ContentLayerChromium):
+        (WebCore::ContentLayerChromium::drawsContent):
+        * platform/graphics/chromium/ContentLayerChromium.h:
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::getDrawsContent):
+        (WebCore::GraphicsLayerChromium::getPreserves3D):
+        (WebCore::GraphicsLayerChromium::paintingGoesToWindow):
+        (WebCore::GraphicsLayerChromium::doPaintGraphicsLayerContents):
+        (WebCore::GraphicsLayerChromium::notifySyncRequired):
+        * platform/graphics/chromium/GraphicsLayerChromium.h:
+        * platform/graphics/chromium/ImageLayerChromium.cpp:
+        (WebCore::ImageLayerChromium::create):
+        (WebCore::ImageLayerChromium::ImageLayerChromium):
+        * platform/graphics/chromium/ImageLayerChromium.h:
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::create):
+        (WebCore::LayerChromium::LayerChromium):
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::CCLayerDelegate::~CCLayerDelegate):
+        (WebCore::LayerChromium::preserves3D):
+        (WebCore::LayerChromium::setOwner):
+        * platform/graphics/chromium/PluginLayerChromium.cpp:
+        (WebCore::PluginLayerChromium::create):
+        (WebCore::PluginLayerChromium::PluginLayerChromium):
+        * platform/graphics/chromium/PluginLayerChromium.h:
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::TiledLayerChromium):
+        * platform/graphics/chromium/TiledLayerChromium.h:
+        * platform/graphics/chromium/VideoLayerChromium.cpp:
+        (WebCore::VideoLayerChromium::create):
+        (WebCore::VideoLayerChromium::VideoLayerChromium):
+        (WebCore::VideoLayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/VideoLayerChromium.h:
+        * platform/graphics/chromium/WebGLLayerChromium.cpp:
+        (WebCore::WebGLLayerChromium::create):
+        (WebCore::WebGLLayerChromium::WebGLLayerChromium):
+        * platform/graphics/chromium/WebGLLayerChromium.h:
+
 2011-09-14  Anders Carlsson  <ander...@apple.com>
 
         Try to fix GTK+ build.

Modified: trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -40,8 +40,8 @@
 
 namespace WebCore {
 
-CanvasLayerChromium::CanvasLayerChromium(GraphicsLayerChromium* owner)
-    : LayerChromium(owner)
+CanvasLayerChromium::CanvasLayerChromium(CCLayerDelegate* delegate)
+    : LayerChromium(delegate)
     , m_hasAlpha(true)
     , m_premultipliedAlpha(true)
     , m_textureId(0)

Modified: trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -50,7 +50,7 @@
     void setTextureId(unsigned textureId) { m_textureId = textureId; }
 
 protected:
-    explicit CanvasLayerChromium(GraphicsLayerChromium* owner);
+    explicit CanvasLayerChromium(CCLayerDelegate*);
 
     bool m_hasAlpha;
     bool m_premultipliedAlpha;

Modified: trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -46,9 +46,9 @@
 class ContentLayerPainter : public LayerPainterChromium {
     WTF_MAKE_NONCOPYABLE(ContentLayerPainter);
 public:
-    static PassOwnPtr<ContentLayerPainter> create(GraphicsLayerChromium* owner)
+    static PassOwnPtr<ContentLayerPainter> create(CCLayerDelegate* delegate)
     {
-        return adoptPtr(new ContentLayerPainter(owner));
+        return adoptPtr(new ContentLayerPainter(delegate));
     }
 
     virtual void paint(GraphicsContext& context, const IntRect& contentRect)
@@ -56,28 +56,28 @@
         double paintStart = currentTime();
         context.clearRect(contentRect);
         context.clip(contentRect);
-        m_owner->paintGraphicsLayerContents(context, contentRect);
+        m_delegate->paintContents(context, contentRect);
         double paintEnd = currentTime();
         double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart);
         PlatformSupport::histogramCustomCounts("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30);
         PlatformSupport::histogramCustomCounts("Renderer4.AccelContentPaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30);
     }
 private:
-    explicit ContentLayerPainter(GraphicsLayerChromium* owner)
-        : m_owner(owner)
+    explicit ContentLayerPainter(CCLayerDelegate* delegate)
+        : m_delegate(delegate)
     {
     }
 
-    GraphicsLayerChromium* m_owner;
+    CCLayerDelegate* m_delegate;
 };
 
-PassRefPtr<ContentLayerChromium> ContentLayerChromium::create(GraphicsLayerChromium* owner)
+PassRefPtr<ContentLayerChromium> ContentLayerChromium::create(CCLayerDelegate* delegate)
 {
-    return adoptRef(new ContentLayerChromium(owner));
+    return adoptRef(new ContentLayerChromium(delegate));
 }
 
-ContentLayerChromium::ContentLayerChromium(GraphicsLayerChromium* owner)
-    : TiledLayerChromium(owner)
+ContentLayerChromium::ContentLayerChromium(CCLayerDelegate* delegate)
+    : TiledLayerChromium(delegate)
 {
 }
 
@@ -115,7 +115,7 @@
 
 bool ContentLayerChromium::drawsContent() const
 {
-    return m_owner && m_owner->drawsContent() && TiledLayerChromium::drawsContent();
+    return m_delegate && m_delegate->drawsContent() && TiledLayerChromium::drawsContent();
 }
 
 void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host)
@@ -125,12 +125,12 @@
     // mode. This thus depends on CCLayerTreeHost::initialize turning off
     // acceleratePainting to prevent this from crashing.
     if (host->settings().acceleratePainting) {
-        m_textureUpdater = LayerTextureUpdaterSkPicture::create(ContentLayerPainter::create(m_owner));
+        m_textureUpdater = LayerTextureUpdaterSkPicture::create(ContentLayerPainter::create(m_delegate));
         return;
     }
 #endif // SKIA
 
-    m_textureUpdater = LayerTextureUpdaterBitmap::create(ContentLayerPainter::create(m_owner), host->layerRendererCapabilities().usingMapSub);
+    m_textureUpdater = LayerTextureUpdaterBitmap::create(ContentLayerPainter::create(m_delegate), host->layerRendererCapabilities().usingMapSub);
 }
 
 }

Modified: trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -45,14 +45,14 @@
 // A Layer that requires a GraphicsContext to render its contents.
 class ContentLayerChromium : public TiledLayerChromium {
 public:
-    static PassRefPtr<ContentLayerChromium> create(GraphicsLayerChromium* owner = 0);
+    static PassRefPtr<ContentLayerChromium> create(CCLayerDelegate*);
 
     virtual ~ContentLayerChromium();
 
     virtual void paintContentsIfDirty();
 
 private:
-    explicit ContentLayerChromium(GraphicsLayerChromium* owner);
+    explicit ContentLayerChromium(CCLayerDelegate*);
 
     virtual void cleanupResources();
     virtual bool drawsContent() const;

Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -102,15 +102,15 @@
 GraphicsLayerChromium::~GraphicsLayerChromium()
 {
     if (m_layer) {
-        m_layer->setOwner(0);
+        m_layer->setDelegate(0);
         m_layer->clearRenderSurface();
     }
     if (m_contentsLayer) {
-        m_contentsLayer->setOwner(0);
+        m_contentsLayer->setDelegate(0);
         m_contentsLayer->clearRenderSurface();
     }
     if (m_transformLayer) {
-        m_transformLayer->setOwner(0);
+        m_transformLayer->setDelegate(0);
         m_transformLayer->clearRenderSurface();
     }
 }
@@ -383,7 +383,7 @@
 {
     bool childrenChanged = false;
     if (platformLayer) {
-        platformLayer->setOwner(this);
+        platformLayer->setDelegate(this);
         if (m_contentsLayer.get() != platformLayer) {
             setupContentsLayer(platformLayer);
             m_contentsLayer = platformLayer;
@@ -415,7 +415,7 @@
             m_contentsLayerPurpose = ContentsLayerForVideo;
             childrenChanged = true;
         }
-        layer->setOwner(this);
+        layer->setDelegate(this);
         layer->setNeedsDisplay();
         updateContentsRect();
     } else {
@@ -686,6 +686,27 @@
     primaryLayer()->setOpacity(m_opacity);
 }
 
+bool GraphicsLayerChromium::drawsContent() const
+{
+    return GraphicsLayer::drawsContent();
+}
+
+bool GraphicsLayerChromium::preserves3D() const
+{
+    return GraphicsLayer::preserves3D();
+}
+
+void GraphicsLayerChromium::paintContents(GraphicsContext& context, const IntRect& clip)
+{
+    paintGraphicsLayerContents(context, clip);
+}
+
+void GraphicsLayerChromium::notifySyncRequired()
+{
+    if (m_client)
+        m_client->notifySyncRequired(this);
+}
+
 } // namespace WebCore
 
 #endif // USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -33,6 +33,7 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
+#include "LayerChromium.h"
 #include "GraphicsContext.h"
 #include "GraphicsLayer.h"
 
@@ -40,7 +41,7 @@
 
 class LayerChromium;
 
-class GraphicsLayerChromium : public GraphicsLayer {
+class GraphicsLayerChromium : public GraphicsLayer, public CCLayerDelegate {
 public:
     GraphicsLayerChromium(GraphicsLayerClient*);
     virtual ~GraphicsLayerChromium();
@@ -94,11 +95,11 @@
     virtual void setDebugBackgroundColor(const Color&);
     virtual void setDebugBorder(const Color&, float borderWidth);
 
-    void notifySyncRequired()
-    {
-        if (m_client)
-            m_client->notifySyncRequired(this);
-    }
+    // The following functions implement the CCLayerDelegate interface.
+    virtual bool drawsContent() const;
+    virtual bool preserves3D() const;
+    virtual void paintContents(GraphicsContext&, const IntRect& clip);
+    virtual void notifySyncRequired();
 
 private:
     void updateOpacityOnLayer();

Modified: trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -108,13 +108,13 @@
     LayerTextureSubImage m_texSubImage;
 };
 
-PassRefPtr<ImageLayerChromium> ImageLayerChromium::create(GraphicsLayerChromium* owner)
+PassRefPtr<ImageLayerChromium> ImageLayerChromium::create(CCLayerDelegate* delegate)
 {
-    return adoptRef(new ImageLayerChromium(owner));
+    return adoptRef(new ImageLayerChromium(delegate));
 }
 
-ImageLayerChromium::ImageLayerChromium(GraphicsLayerChromium* owner)
-    : TiledLayerChromium(owner)
+ImageLayerChromium::ImageLayerChromium(CCLayerDelegate* delegate)
+    : TiledLayerChromium(delegate)
     , m_imageForCurrentFrame(0)
 {
 }

Modified: trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -49,7 +49,7 @@
 // A Layer that contains only an Image element.
 class ImageLayerChromium : public TiledLayerChromium {
 public:
-    static PassRefPtr<ImageLayerChromium> create(GraphicsLayerChromium* owner = 0);
+    static PassRefPtr<ImageLayerChromium> create(CCLayerDelegate*);
     virtual ~ImageLayerChromium();
 
     virtual bool drawsContent() const;
@@ -58,7 +58,7 @@
     void setContents(Image* image);
 
 private:
-    ImageLayerChromium(GraphicsLayerChromium* owner);
+    explicit ImageLayerChromium(CCLayerDelegate*);
 
     virtual void cleanupResources();
     virtual void createTextureUpdater(const CCLayerTreeHost*);

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -51,13 +51,13 @@
 
 static int s_nextLayerId = 1;
 
-PassRefPtr<LayerChromium> LayerChromium::create(GraphicsLayerChromium* owner)
+PassRefPtr<LayerChromium> LayerChromium::create(CCLayerDelegate* delegate)
 {
-    return adoptRef(new LayerChromium(owner));
+    return adoptRef(new LayerChromium(delegate));
 }
 
-LayerChromium::LayerChromium(GraphicsLayerChromium* owner)
-    : m_owner(owner)
+LayerChromium::LayerChromium(CCLayerDelegate* delegate)
+    : m_delegate(delegate)
     , m_contentsDirty(false)
     , m_layerId(s_nextLayerId++)
     , m_parent(0)
@@ -127,8 +127,8 @@
     // call setRootLayerNeedsDisplay() on the WebView, which will cause LayerRendererChromium
     // to render a frame.
     // This function has no effect on root layers.
-    if (m_owner)
-        m_owner->notifySyncRequired();
+    if (m_delegate)
+        m_delegate->notifySyncRequired();
 }
 
 void LayerChromium::setParent(LayerChromium* layer)

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -36,7 +36,6 @@
 
 #include "FloatPoint.h"
 #include "GraphicsContext.h"
-#include "GraphicsLayerChromium.h"
 #include "PlatformString.h"
 #include "ProgramBinding.h"
 #include "RenderSurfaceChromium.h"
@@ -56,12 +55,21 @@
 class CCLayerTreeHost;
 class GraphicsContext3D;
 
+class CCLayerDelegate {
+public:
+    virtual ~CCLayerDelegate() { }
+    virtual bool drawsContent() const = 0;
+    virtual bool preserves3D() const = 0;
+    virtual void paintContents(GraphicsContext&, const IntRect& clip) = 0;
+    virtual void notifySyncRequired() = 0;
+};
+
 // Base class for composited layers. Special layer types are derived from
 // this class.
 class LayerChromium : public RefCounted<LayerChromium> {
     friend class LayerTilerChromium;
 public:
-    static PassRefPtr<LayerChromium> create(GraphicsLayerChromium* owner = 0);
+    static PassRefPtr<LayerChromium> create(CCLayerDelegate* = 0);
 
     virtual ~LayerChromium();
 
@@ -144,7 +152,7 @@
     void setGeometryFlipped(bool flipped) { m_geometryFlipped = flipped; setNeedsCommit(); }
     bool geometryFlipped() const { return m_geometryFlipped; }
 
-    bool preserves3D() { return m_owner && m_owner->preserves3D(); }
+    bool preserves3D() { return m_delegate && m_delegate->preserves3D(); }
 
     void setUsesLayerScissor(bool usesLayerScissor) { m_usesLayerScissor = usesLayerScissor; }
     bool usesLayerScissor() const { return m_usesLayerScissor; }
@@ -154,7 +162,7 @@
 
     virtual void setLayerTreeHost(CCLayerTreeHost*);
 
-    void setOwner(GraphicsLayerChromium* owner) { m_owner = owner; }
+    void setDelegate(CCLayerDelegate* delegate) { m_delegate = delegate; }
 
     void setReplicaLayer(LayerChromium* layer) { m_replicaLayer = layer; }
     LayerChromium* replicaLayer() { return m_replicaLayer.get(); }
@@ -209,8 +217,8 @@
     void cleanupResourcesRecursive();
 
 protected:
-    GraphicsLayerChromium* m_owner;
-    explicit LayerChromium(GraphicsLayerChromium* owner);
+    CCLayerDelegate* m_delegate;
+    explicit LayerChromium(CCLayerDelegate*);
 
     // This is called to clean up resources being held in the same context as
     // layerRendererContext(). Subclasses should override this method if they

Modified: trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -36,13 +36,13 @@
 
 namespace WebCore {
 
-PassRefPtr<PluginLayerChromium> PluginLayerChromium::create(GraphicsLayerChromium* owner)
+PassRefPtr<PluginLayerChromium> PluginLayerChromium::create(CCLayerDelegate* delegate)
 {
-    return adoptRef(new PluginLayerChromium(owner));
+    return adoptRef(new PluginLayerChromium(delegate));
 }
 
-PluginLayerChromium::PluginLayerChromium(GraphicsLayerChromium* owner)
-    : LayerChromium(owner)
+PluginLayerChromium::PluginLayerChromium(CCLayerDelegate* delegate)
+    : LayerChromium(delegate)
     , m_textureId(0)
 {
 }

Modified: trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -36,7 +36,7 @@
 // A Layer containing a the rendered output of a plugin instance.
 class PluginLayerChromium : public LayerChromium {
 public:
-    static PassRefPtr<PluginLayerChromium> create(GraphicsLayerChromium* owner = 0);
+    static PassRefPtr<PluginLayerChromium> create(CCLayerDelegate* = 0);
     virtual bool drawsContent() const { return true; }
 
     virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
@@ -47,7 +47,7 @@
     virtual void pushPropertiesTo(CCLayerImpl*);
 
 private:
-    explicit PluginLayerChromium(GraphicsLayerChromium* owner);
+    explicit PluginLayerChromium(CCLayerDelegate*);
     unsigned m_textureId;
 };
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -63,8 +63,8 @@
     OwnPtr<ManagedTexture> m_tex;
 };
 
-TiledLayerChromium::TiledLayerChromium(GraphicsLayerChromium* owner)
-    : LayerChromium(owner)
+TiledLayerChromium::TiledLayerChromium(CCLayerDelegate* delegate)
+    : LayerChromium(delegate)
     , m_tilingOption(AutoTile)
     , m_textureFormat(GraphicsContext3D::INVALID_ENUM)
     , m_skipsDraw(false)
@@ -122,7 +122,7 @@
 
 bool TiledLayerChromium::drawsContent() const
 {
-    if (!m_owner)
+    if (!m_delegate)
         return false;
 
     if (!m_tiler)

Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -55,7 +55,7 @@
     void protectTileTextures(const IntRect& contentRect);
 
 protected:
-    explicit TiledLayerChromium(GraphicsLayerChromium*);
+    explicit TiledLayerChromium(CCLayerDelegate*);
 
     virtual void cleanupResources();
     void updateTileSizeAndTilingOption();

Modified: trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -37,7 +37,6 @@
 #include "GraphicsContext3D.h"
 #include "LayerRendererChromium.h"
 #include "NotImplemented.h"
-#include "RenderLayerBacking.h"
 #include "VideoFrameChromium.h"
 #include "VideoFrameProvider.h"
 #include "cc/CCLayerImpl.h"
@@ -45,14 +44,14 @@
 
 namespace WebCore {
 
-PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(GraphicsLayerChromium* owner,
+PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(CCLayerDelegate* delegate,
                                                           VideoFrameProvider* provider)
 {
-    return adoptRef(new VideoLayerChromium(owner, provider));
+    return adoptRef(new VideoLayerChromium(delegate, provider));
 }
 
-VideoLayerChromium::VideoLayerChromium(GraphicsLayerChromium* owner, VideoFrameProvider* provider)
-    : LayerChromium(owner)
+VideoLayerChromium::VideoLayerChromium(CCLayerDelegate* delegate, VideoFrameProvider* provider)
+    : LayerChromium(delegate)
     , m_skipsDraw(true)
     , m_frameFormat(VideoFrameChromium::Invalid)
     , m_provider(provider)
@@ -80,13 +79,9 @@
 
 void VideoLayerChromium::updateCompositorResources(GraphicsContext3D* context)
 {
-    if (!m_contentsDirty || !m_owner)
+    if (!m_contentsDirty || !m_delegate)
         return;
 
-    RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_owner->client());
-    if (!backing || backing->paintingGoesToWindow())
-        return;
-
     ASSERT(drawsContent());
 
     m_skipsDraw = false;

Modified: trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -44,7 +44,7 @@
 class VideoLayerChromium : public LayerChromium {
 public:
 
-    static PassRefPtr<VideoLayerChromium> create(GraphicsLayerChromium* owner = 0,
+    static PassRefPtr<VideoLayerChromium> create(CCLayerDelegate* = 0,
                                                  VideoFrameProvider* = 0);
     virtual ~VideoLayerChromium();
 
@@ -70,7 +70,7 @@
         OwnPtr<ManagedTexture> m_texture;
     };
 
-    VideoLayerChromium(GraphicsLayerChromium* owner, VideoFrameProvider*);
+    VideoLayerChromium(CCLayerDelegate*, VideoFrameProvider*);
 
     static GC3Denum determineTextureFormat(const VideoFrameChromium*);
     static IntSize computeVisibleSize(const VideoFrameChromium*, unsigned plane);

Modified: trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp	2011-09-15 01:32:18 UTC (rev 95148)
@@ -41,13 +41,13 @@
 
 namespace WebCore {
 
-PassRefPtr<WebGLLayerChromium> WebGLLayerChromium::create(GraphicsLayerChromium* owner)
+PassRefPtr<WebGLLayerChromium> WebGLLayerChromium::create(CCLayerDelegate* delegate)
 {
-    return adoptRef(new WebGLLayerChromium(owner));
+    return adoptRef(new WebGLLayerChromium(delegate));
 }
 
-WebGLLayerChromium::WebGLLayerChromium(GraphicsLayerChromium* owner)
-    : CanvasLayerChromium(owner)
+WebGLLayerChromium::WebGLLayerChromium(CCLayerDelegate* delegate)
+    : CanvasLayerChromium(delegate)
     , m_context(0)
     , m_textureChanged(true)
     , m_contextSupportsRateLimitingExtension(false)

Modified: trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h (95147 => 95148)


--- trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h	2011-09-15 01:24:39 UTC (rev 95147)
+++ trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h	2011-09-15 01:32:18 UTC (rev 95148)
@@ -45,7 +45,7 @@
 // A Layer containing a WebGL canvas
 class WebGLLayerChromium : public CanvasLayerChromium {
 public:
-    static PassRefPtr<WebGLLayerChromium> create(GraphicsLayerChromium* owner = 0);
+    static PassRefPtr<WebGLLayerChromium> create(CCLayerDelegate* = 0);
 
     virtual ~WebGLLayerChromium();
 
@@ -58,7 +58,7 @@
     GraphicsContext3D* context() { return m_context; }
 
 private:
-    explicit WebGLLayerChromium(GraphicsLayerChromium* owner);
+    explicit WebGLLayerChromium(CCLayerDelegate*);
     friend class WebGLLayerChromiumRateLimitTask;
 
     GraphicsContext3D* layerRendererContext();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to