Remove preserves3D() from CCLayerDelegate, replacing it by setting the
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 23:25:01 +0000 (23:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 23:25:01 +0000 (23:25 +0000)
value explicitly after creating a layer, or setting its delegate.
https://bugs.webkit.org/show_bug.cgi?id=68295

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

Covered by compositing/ layeout tests.

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setContentsToCanvas):
(WebCore::GraphicsLayerChromium::setContentsToMedia):
(WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
(WebCore::GraphicsLayerChromium::setupContentsLayer):
* platform/graphics/chromium/GraphicsLayerChromium.h:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::setPreserves3D):
(WebCore::LayerChromium::preserves3D):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h

index e976406..77a0d9f 100644 (file)
@@ -1,3 +1,25 @@
+2011-09-23  Antoine Labour  <piman@chromium.org>
+
+        Remove preserves3D() from CCLayerDelegate, replacing it by setting the
+        value explicitly after creating a layer, or setting its delegate.
+        https://bugs.webkit.org/show_bug.cgi?id=68295
+
+        Reviewed by James Robinson.
+
+        Covered by compositing/ layeout tests.
+
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::setContentsToCanvas):
+        (WebCore::GraphicsLayerChromium::setContentsToMedia):
+        (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+        (WebCore::GraphicsLayerChromium::setupContentsLayer):
+        * platform/graphics/chromium/GraphicsLayerChromium.h:
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::LayerChromium):
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::setPreserves3D):
+        (WebCore::LayerChromium::preserves3D):
+
 2011-09-23  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Implicit conversion double to float in ShadowBlur::adjustBlurRadius
index 4a522f7..96a9ca6 100644 (file)
@@ -551,6 +551,7 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
     if (m_preserves3D && !m_transformLayer) {
         // Create the transform layer.
         m_transformLayer = LayerChromium::create(this);
+        m_transformLayer->setPreserves3D(true);
 
         // Copy the position from this layer.
         updateLayerPosition();
@@ -592,6 +593,7 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
         updateChildList();
     }
 
+    m_layer->setPreserves3D(m_preserves3D);
     updateOpacityOnLayer();
     updateNames();
 }
@@ -671,11 +673,6 @@ 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);
index 8b213a8..7190e50 100644 (file)
@@ -97,7 +97,6 @@ public:
 
     // 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();
 
index 049bb9e..0dd421d 100644 (file)
@@ -70,6 +70,7 @@ LayerChromium::LayerChromium(CCLayerDelegate* delegate)
     , m_doubleSided(true)
     , m_usesLayerScissor(false)
     , m_isNonCompositedContent(false)
+    , m_preserves3D(false)
     , m_replicaLayer(0)
     , m_drawOpacity(0)
     , m_targetRenderSurface(0)
index 252262c..331e6c1 100644 (file)
@@ -59,7 +59,6 @@ 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;
 };
@@ -134,7 +133,8 @@ public:
     bool doubleSided() const { return m_doubleSided; }
     void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
 
-    bool preserves3D() const { return m_delegate && m_delegate->preserves3D(); }
+    void setPreserves3D(bool preserve3D) { m_preserves3D = preserve3D; }
+    bool preserves3D() const { return m_preserves3D; }
 
     void setUsesLayerScissor(bool usesLayerScissor) { m_usesLayerScissor = usesLayerScissor; }
     bool usesLayerScissor() const { return m_usesLayerScissor; }
@@ -249,6 +249,7 @@ private:
     bool m_doubleSided;
     bool m_usesLayerScissor;
     bool m_isNonCompositedContent;
+    bool m_preserves3D;
 
     TransformationMatrix m_transform;
     TransformationMatrix m_sublayerTransform;