Title: [141376] trunk/Source/WebKit2
Revision
141376
Author
[email protected]
Date
2013-01-30 21:22:01 -0800 (Wed, 30 Jan 2013)

Log Message

Coordinated Graphics : Remove CoordinatedLayerTreeHostProxy dependency from LayerTreeRenderer
https://bugs.webkit.org/show_bug.cgi?id=108164

Patch by Jae Hyun Park <[email protected]> on 2013-01-30
Reviewed by Benjamin Poulain.

This is a preparation patch for Threaded Coordinated Graphics.

LayerTreeRenderer should not depend on CoordinatedLayerTreeHostProxy so that it
can be moved to WebCore.  This patch introduces LayerTreeRendererClient which
is implemented in CoordinatedLayerTreeHostProxy. LayerTreeRenderer uses this
client, instead of using CoordinatedLayerTreeHostProxy directly.

* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
(CoordinatedLayerTreeHostProxy):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::LayerTreeRenderer):
(WebKit::LayerTreeRenderer::animationFrameReady):
(WebKit::LayerTreeRenderer::updateViewport):
(WebKit::LayerTreeRenderer::renderNextFrame):
(WebKit::LayerTreeRenderer::purgeBackingStores):
(WebKit::LayerTreeRenderer::detach):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(WebKit):
(LayerTreeRendererClient):
(LayerTreeRenderer):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (141375 => 141376)


--- trunk/Source/WebKit2/ChangeLog	2013-01-31 05:15:30 UTC (rev 141375)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-31 05:22:01 UTC (rev 141376)
@@ -1,3 +1,31 @@
+2013-01-30  Jae Hyun Park  <[email protected]>
+
+        Coordinated Graphics : Remove CoordinatedLayerTreeHostProxy dependency from LayerTreeRenderer
+        https://bugs.webkit.org/show_bug.cgi?id=108164
+
+        Reviewed by Benjamin Poulain.
+
+        This is a preparation patch for Threaded Coordinated Graphics.
+
+        LayerTreeRenderer should not depend on CoordinatedLayerTreeHostProxy so that it
+        can be moved to WebCore.  This patch introduces LayerTreeRendererClient which
+        is implemented in CoordinatedLayerTreeHostProxy. LayerTreeRenderer uses this
+        client, instead of using CoordinatedLayerTreeHostProxy directly.
+
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
+        (CoordinatedLayerTreeHostProxy):
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::LayerTreeRenderer):
+        (WebKit::LayerTreeRenderer::animationFrameReady):
+        (WebKit::LayerTreeRenderer::updateViewport):
+        (WebKit::LayerTreeRenderer::renderNextFrame):
+        (WebKit::LayerTreeRenderer::purgeBackingStores):
+        (WebKit::LayerTreeRenderer::detach):
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
+        (WebKit):
+        (LayerTreeRendererClient):
+        (LayerTreeRenderer):
+
 2013-01-30  Tim Horton  <[email protected]>
 
         PDFPlugin: Should respond to three-finger tap for dictionary definitions

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h (141375 => 141376)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-31 05:15:30 UTC (rev 141375)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-31 05:22:01 UTC (rev 141376)
@@ -26,6 +26,7 @@
 #include "CoordinatedGraphicsArgumentCoders.h"
 #include "CoordinatedLayerInfo.h"
 #include "DrawingAreaProxy.h"
+#include "LayerTreeRenderer.h"
 #include "Region.h"
 #include "SurfaceUpdateInfo.h"
 #include "WebCoordinatedSurface.h"
@@ -46,7 +47,7 @@
 class CoordinatedLayerInfo;
 class LayerTreeRenderer;
 
-class CoordinatedLayerTreeHostProxy {
+class CoordinatedLayerTreeHostProxy : public LayerTreeRendererClient {
     WTF_MAKE_NONCOPYABLE(CoordinatedLayerTreeHostProxy);
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -77,8 +78,6 @@
     void clearImageBackingContents(CoordinatedImageBackingID);
     void removeImageBacking(CoordinatedImageBackingID);
     void didReceiveCoordinatedLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
-    void updateViewport();
-    void renderNextFrame();
     void didChangeScrollPosition(const WebCore::FloatPoint& position);
 #if USE(GRAPHICS_SURFACE)
     void createCanvas(CoordinatedLayerID, const WebCore::IntSize&, const WebCore::GraphicsSurfaceToken&);
@@ -86,16 +85,22 @@
     void destroyCanvas(CoordinatedLayerID);
 #endif
     void setLayerRepaintCount(CoordinatedLayerID, int value);
-    void purgeBackingStores();
     LayerTreeRenderer* layerTreeRenderer() const { return m_renderer.get(); }
     void setLayerAnimations(CoordinatedLayerID, const WebCore::GraphicsLayerAnimations&);
     void setAnimationsLocked(bool);
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     void requestAnimationFrame();
-    void animationFrameReady();
 #endif
     void setBackgroundColor(const WebCore::Color&);
 
+    // LayerTreeRendererClient Methods.
+#if ENABLE(REQUEST_ANIMATION_FRAME)
+    virtual void animationFrameReady() OVERRIDE;
+#endif
+    virtual void updateViewport() OVERRIDE;
+    virtual void renderNextFrame() OVERRIDE;
+    virtual void purgeBackingStores() OVERRIDE;
+
 protected:
     void dispatchUpdate(const Function<void()>&);
 

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (141375 => 141376)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-31 05:15:30 UTC (rev 141375)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-31 05:22:01 UTC (rev 141376)
@@ -25,7 +25,6 @@
 #include "LayerTreeRenderer.h"
 
 #include "CoordinatedBackingStore.h"
-#include "CoordinatedLayerTreeHostProxy.h"
 #include "GraphicsLayerTextureMapper.h"
 #include "MessageID.h"
 #include "TextureMapper.h"
@@ -71,8 +70,8 @@
     return layer->drawsContent() && layer->contentsAreVisible() && !layer->size().isEmpty();
 }
 
-LayerTreeRenderer::LayerTreeRenderer(CoordinatedLayerTreeHostProxy* coordinatedLayerTreeHostProxy)
-    : m_coordinatedLayerTreeHostProxy(coordinatedLayerTreeHostProxy)
+LayerTreeRenderer::LayerTreeRenderer(LayerTreeRendererClient* client)
+    : m_client(client)
     , m_isActive(false)
     , m_rootLayerID(InvalidCoordinatedLayerID)
     , m_animationsLocked(false)
@@ -147,8 +146,8 @@
 void LayerTreeRenderer::animationFrameReady()
 {
     ASSERT(isMainThread());
-    if (m_coordinatedLayerTreeHostProxy)
-        m_coordinatedLayerTreeHostProxy->animationFrameReady();
+    if (m_client)
+        m_client->animationFrameReady();
 }
 
 void LayerTreeRenderer::requestAnimationFrame()
@@ -193,8 +192,8 @@
 void LayerTreeRenderer::updateViewport()
 {
     ASSERT(isMainThread());
-    if (m_coordinatedLayerTreeHostProxy)
-        m_coordinatedLayerTreeHostProxy->updateViewport();
+    if (m_client)
+        m_client->updateViewport();
 }
 
 void LayerTreeRenderer::adjustPositionForFixedLayers()
@@ -572,8 +571,8 @@
 
 void LayerTreeRenderer::renderNextFrame()
 {
-    if (m_coordinatedLayerTreeHostProxy)
-        m_coordinatedLayerTreeHostProxy->renderNextFrame();
+    if (m_client)
+        m_client->renderNextFrame();
 }
 
 void LayerTreeRenderer::ensureRootLayer()
@@ -633,8 +632,8 @@
 
 void LayerTreeRenderer::purgeBackingStores()
 {
-    if (m_coordinatedLayerTreeHostProxy)
-        m_coordinatedLayerTreeHostProxy->purgeBackingStores();
+    if (m_client)
+        m_client->purgeBackingStores();
 }
 
 void LayerTreeRenderer::setLayerAnimations(CoordinatedLayerID id, const GraphicsLayerAnimations& animations)
@@ -662,7 +661,7 @@
 void LayerTreeRenderer::detach()
 {
     ASSERT(isMainThread());
-    m_coordinatedLayerTreeHostProxy = 0;
+    m_client = 0;
 }
 
 void LayerTreeRenderer::appendUpdate(const Function<void()>& function)

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h (141375 => 141376)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-31 05:15:30 UTC (rev 141375)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-31 05:22:01 UTC (rev 141376)
@@ -48,9 +48,18 @@
 namespace WebKit {
 
 class CoordinatedBackingStore;
-class CoordinatedLayerTreeHostProxy;
 class CoordinatedLayerInfo;
 
+class LayerTreeRendererClient {
+public:
+#if ENABLE(REQUEST_ANIMATION_FRAME)
+    virtual void animationFrameReady() = 0;
+#endif
+    virtual void updateViewport() = 0;
+    virtual void renderNextFrame() = 0;
+    virtual void purgeBackingStores() = 0;
+};
+
 class LayerTreeRenderer : public ThreadSafeRefCounted<LayerTreeRenderer>, public WebCore::GraphicsLayerClient {
 public:
     struct TileUpdate {
@@ -66,7 +75,7 @@
         {
         }
     };
-    explicit LayerTreeRenderer(CoordinatedLayerTreeHostProxy*);
+    explicit LayerTreeRenderer(LayerTreeRendererClient*);
     virtual ~LayerTreeRenderer();
     void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&, WebCore::TextureMapper::PaintFlags = 0);
     void paintToGraphicsContext(BackingStore::PlatformGraphicsContext);
@@ -83,7 +92,7 @@
     void detach();
     void appendUpdate(const Function<void()>&);
 
-    // The painting thread must lock the main thread to use below two methods, because two methods access members that the main thread manages. See m_coordinatedLayerTreeHostProxy.
+    // The painting thread must lock the main thread to use below two methods, because two methods access members that the main thread manages. See m_client.
     // Currently, QQuickWebPage::updatePaintNode() locks the main thread before calling both methods.
     void purgeGLResources();
     void setActive(bool);
@@ -187,7 +196,7 @@
     SurfaceMap m_surfaces;
 
     // Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members.
-    CoordinatedLayerTreeHostProxy* m_coordinatedLayerTreeHostProxy;
+    LayerTreeRendererClient* m_client;
     bool m_isActive;
 
     OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to