2011-06-28 Joone Hur <joone.hur@collabora.co.uk>
authorjoone.hur@collabora.co.uk <joone.hur@collabora.co.uk@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2011 16:27:46 +0000 (16:27 +0000)
committerjoone.hur@collabora.co.uk <joone.hur@collabora.co.uk@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2011 16:27:46 +0000 (16:27 +0000)
        Reviewed by Martin Robinson.

        [GTK] Allow to build WebKitGtk+ with accelerated compositing
        https://bugs.webkit.org/show_bug.cgi?id=63404

        WebKitGtk+ needs to implement accelerated compositing for running CSS3 3D transforms
        and animation through GPU acceleration. We could implement GraphicsLayer using Clutter.

        * GNUmakefile.list.am:
        * platform/graphics/clutter/GraphicsLayerClutter.cpp: Added.
        (WebCore::GraphicsLayer::create): Not implemented yet.
        (WebCore::GraphicsLayerClutter::GraphicsLayerClutter):
        (WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
        (WebCore::GraphicsLayerClutter::setNeedsDisplay): Ditto.
        (WebCore::GraphicsLayerClutter::setNeedsDisplayInRect): Ditto.
        * platform/graphics/clutter/GraphicsLayerClutter.h: Added.
2011-06-28  Joone Hur  <joone.hur@collabora.co.uk>

        Reviewed by Martin Robinson.

        [GTK] Allow to build WebKitGtk+ with accelerated compositing
        https://bugs.webkit.org/show_bug.cgi?id=63404

        WebKitGtk+ needs to implement accelerated compositing for running CSS3 3D transforms
        and animation through GPU acceleration. We could implement GraphicsLayer using Clutter.

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::attachRootGraphicsLayer): not implemented yet.
        (WebKit::ChromeClient::setNeedsOneShotDrawingSynchronization): Ditto.
        (WebKit::ChromeClient::scheduleCompositingLayerSync): Ditto.
        (WebKit::ChromeClient::allowedCompositingTriggers): Ditto.
        * WebCoreSupport/ChromeClientGtk.h:

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

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h [new file with mode: 0644]
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h

index 459749a..4f307c5 100644 (file)
@@ -1,3 +1,22 @@
+2011-06-28  Joone Hur  <joone.hur@collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Allow to build WebKitGtk+ with accelerated compositing
+        https://bugs.webkit.org/show_bug.cgi?id=63404
+
+        WebKitGtk+ needs to implement accelerated compositing for running CSS3 3D transforms 
+        and animation through GPU acceleration. We could implement GraphicsLayer using Clutter.
+
+        * GNUmakefile.list.am:
+        * platform/graphics/clutter/GraphicsLayerClutter.cpp: Added.
+        (WebCore::GraphicsLayer::create): Not implemented yet.
+        (WebCore::GraphicsLayerClutter::GraphicsLayerClutter):
+        (WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
+        (WebCore::GraphicsLayerClutter::setNeedsDisplay): Ditto.
+        (WebCore::GraphicsLayerClutter::setNeedsDisplayInRect): Ditto.
+        * platform/graphics/clutter/GraphicsLayerClutter.h: Added.
+
 2011-06-28  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Darin Adler.
index c71058e..5c8f48b 100644 (file)
@@ -2420,6 +2420,8 @@ webcore_sources += \
        Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp \
        Source/WebCore/platform/graphics/cairo/RefPtrCairo.h \
        Source/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp \
+       Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h \
+       Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp \
        Source/WebCore/platform/graphics/filters/DistantLightSource.cpp \
        Source/WebCore/platform/graphics/filters/DistantLightSource.h \
        Source/WebCore/platform/graphics/filters/FEBlend.cpp \
@@ -2518,6 +2520,7 @@ webcore_sources += \
        Source/WebCore/platform/graphics/GraphicsContext.cpp \
        Source/WebCore/platform/graphics/GraphicsContext.h \
        Source/WebCore/platform/graphics/GraphicsLayer.h \
+       Source/WebCore/platform/graphics/GraphicsLayer.cpp \
        Source/WebCore/platform/graphics/GraphicsTypes.cpp \
        Source/WebCore/platform/graphics/GraphicsTypes.h \
        Source/WebCore/platform/graphics/GraphicsTypes3D.h \
@@ -2963,6 +2966,10 @@ webcore_sources += \
        Source/WebCore/rendering/RenderLayerBacking.h \
        Source/WebCore/rendering/RenderLayer.cpp \
        Source/WebCore/rendering/RenderLayer.h \
+       Source/WebCore/rendering/RenderLayerBacking.cpp \
+       Source/WebCore/rendering/RenderLayerBacking.h \
+       Source/WebCore/rendering/RenderLayerCompositor.cpp \
+       Source/WebCore/rendering/RenderLayerCompositor.h \
        Source/WebCore/rendering/RenderLineBoxList.cpp \
        Source/WebCore/rendering/RenderLineBoxList.h \
        Source/WebCore/rendering/RenderListBox.cpp \
diff --git a/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp b/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp
new file mode 100644 (file)
index 0000000..ceedc3c
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Collabora Ltd.
+ *
+ * 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. ``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 COMPUTER, INC. OR
+ * 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"
+
+#if USE(ACCELERATED_COMPOSITING)
+#include "GraphicsLayerClutter.h"
+
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
+{
+    return adoptPtr(new GraphicsLayerClutter(client));
+}
+
+GraphicsLayerClutter::GraphicsLayerClutter(GraphicsLayerClient* client)
+    : GraphicsLayer(client)
+{
+}
+
+GraphicsLayerClutter::~GraphicsLayerClutter()
+{
+}
+
+void GraphicsLayerClutter::setNeedsDisplay()
+{
+    notImplemented();
+}
+
+void GraphicsLayerClutter::setNeedsDisplayInRect(const FloatRect&)
+{
+    notImplemented();
+}
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h b/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h
new file mode 100644 (file)
index 0000000..db29b1f
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Collabora Ltd.
+ *
+ * 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. ``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 COMPUTER, INC. OR
+ * 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 GraphicsLayerClutter_h
+#define GraphicsLayerClutter_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "GraphicsLayer.h"
+
+namespace WebCore {
+
+class GraphicsLayerClutter : public GraphicsLayer {
+public:
+    GraphicsLayerClutter(GraphicsLayerClient*);
+    virtual ~GraphicsLayerClutter();
+
+    virtual void setNeedsDisplay();
+    virtual void setNeedsDisplayInRect(const FloatRect&);
+};
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // GraphicsLayerClutter_h
index ce54592..d3f6d3e 100644 (file)
@@ -1,3 +1,20 @@
+2011-06-28  Joone Hur  <joone.hur@collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Allow to build WebKitGtk+ with accelerated compositing
+        https://bugs.webkit.org/show_bug.cgi?id=63404
+
+        WebKitGtk+ needs to implement accelerated compositing for running CSS3 3D transforms 
+        and animation through GPU acceleration. We could implement GraphicsLayer using Clutter.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::attachRootGraphicsLayer): not implemented yet.
+        (WebKit::ChromeClient::setNeedsOneShotDrawingSynchronization): Ditto.
+        (WebKit::ChromeClient::scheduleCompositingLayerSync): Ditto.
+        (WebKit::ChromeClient::allowedCompositingTriggers): Ditto.
+        * WebCoreSupport/ChromeClientGtk.h:
+
 2011-06-27  ChangSeok Oh  <shivamidow@gmail.com>
 
         Reviewed by Martin Robinson.
index 6974844..2a5c4f3 100644 (file)
@@ -743,4 +743,26 @@ void ChromeClient::exitFullScreenForElement(WebCore::Element* element)
 }
 #endif
 
+#if USE(ACCELERATED_COMPOSITING)
+void ChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* rootLayer)
+{
+    notImplemented();
+}
+
+void ChromeClient::setNeedsOneShotDrawingSynchronization()
+{
+    notImplemented();
+}
+
+void ChromeClient::scheduleCompositingLayerSync()
+{
+    notImplemented();
+}
+
+ChromeClient::CompositingTriggerFlags ChromeClient::allowedCompositingTriggers() const
+{
+    return 0;
+}
+#endif
+
 }
index 853b132..c4bbc72 100644 (file)
@@ -157,6 +157,13 @@ namespace WebKit {
         virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
         virtual void numWheelEventHandlersChanged(unsigned) { }
 
+#if USE(ACCELERATED_COMPOSITING) 
+        virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
+        virtual void setNeedsOneShotDrawingSynchronization();
+        virtual void scheduleCompositingLayerSync();
+        virtual CompositingTriggerFlags allowedCompositingTriggers() const;
+#endif 
+
     private:
         WebKitWebView* m_webView;
         GtkAdjustmentWatcher m_adjustmentWatcher;