Title: [130085] trunk/Source/WebCore
Revision
130085
Author
ander...@apple.com
Date
2012-10-01 15:31:40 -0700 (Mon, 01 Oct 2012)

Log Message

Add a GraphicsLayerFactory getter to ChromeClient
https://bugs.webkit.org/show_bug.cgi?id=98069

Reviewed by Andreas Kling.

* page/ChromeClient.h:
(WebCore::ChromeClient::graphicsLayerFactory):
New function that can be overridden by ports to customize the layer type created for a page.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::graphicsLayerFactory):
* rendering/RenderLayerCompositor.h:
Add helper getter that's unused for now but will be called by RenderLayerBacking when creating graphics layers.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (130084 => 130085)


--- trunk/Source/WebCore/ChangeLog	2012-10-01 22:24:20 UTC (rev 130084)
+++ trunk/Source/WebCore/ChangeLog	2012-10-01 22:31:40 UTC (rev 130085)
@@ -1,3 +1,19 @@
+2012-10-01  Anders Carlsson  <ander...@apple.com>
+
+        Add a GraphicsLayerFactory getter to ChromeClient
+        https://bugs.webkit.org/show_bug.cgi?id=98069
+
+        Reviewed by Andreas Kling.
+
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::graphicsLayerFactory):
+        New function that can be overridden by ports to customize the layer type created for a page.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::graphicsLayerFactory):
+        * rendering/RenderLayerCompositor.h:
+        Add helper getter that's unused for now but will be called by RenderLayerBacking when creating graphics layers.
+
 2012-10-01  Ryosuke Niwa  <rn...@webkit.org>
 
         Rename AssertNoEventDispatch to NoEventDispatchAssertion

Modified: trunk/Source/WebCore/page/ChromeClient.h (130084 => 130085)


--- trunk/Source/WebCore/page/ChromeClient.h	2012-10-01 22:24:20 UTC (rev 130084)
+++ trunk/Source/WebCore/page/ChromeClient.h	2012-10-01 22:31:40 UTC (rev 130085)
@@ -78,6 +78,7 @@
 
 #if USE(ACCELERATED_COMPOSITING)
     class GraphicsLayer;
+    class GraphicsLayerFactory;
 #endif
 
 #if ENABLE(INPUT_TYPE_COLOR)
@@ -246,6 +247,9 @@
         virtual void elementDidBlur(const Node*) { };
 
 #if USE(ACCELERATED_COMPOSITING)
+        // Allows ports to customize the type of graphics layers created by this page.
+        virtual GraphicsLayerFactory* graphicsLayerFactory() const { return 0; }
+
         // Pass 0 as the GraphicsLayer to detatch the root layer.
         virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*) = 0;
         // Sets a flag to specify that the next time content is drawn to the window,

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (130084 => 130085)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-10-01 22:24:20 UTC (rev 130084)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-10-01 22:31:40 UTC (rev 130085)
@@ -2452,6 +2452,16 @@
     return 0;
 }
 
+GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
+{
+    if (Frame* frame = m_renderView->frameView()->frame()) {
+        if (Page* page = frame->page())
+            return page->chrome()->client()->graphicsLayerFactory();
+    }
+
+    return 0;
+}
+
 } // namespace WebCore
 
 #endif // USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (130084 => 130085)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2012-10-01 22:24:20 UTC (rev 130084)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2012-10-01 22:31:40 UTC (rev 130085)
@@ -283,6 +283,7 @@
 
     bool isFlushingLayers() const { return m_flushingLayers; }
 
+    GraphicsLayerFactory* graphicsLayerFactory() const;
     ScrollingCoordinator* scrollingCoordinator() const;
 
     // Whether a running transition or animation enforces the need for a compositing layer.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to