[EFL][CoordinatedGraphics] All EFL layout tests are broken since r174231
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Oct 2014 11:38:32 +0000 (11:38 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Oct 2014 11:38:32 +0000 (11:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137443

Reviewed by Zoltan Herczeg.

EFL layout test and MiniBrowser have broken since r174231. r174231 was to move PageOverlay implementation
from WebKit2 to WebCore with lazy initializing of PageOverlayController. It caused all EFL layout tests
crash and build break. To restore EFL layout test, this patch sets viewOverlayRootLayer through
attachViewOverlayGraphicsLayer() as mac port's one in r174231.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
(WebKit::CoordinatedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::updateRootLayers):
(WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
(WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
(WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h

index b0f51a1..816474e 100644 (file)
@@ -1,3 +1,26 @@
+2014-10-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        [EFL][CoordinatedGraphics] All EFL layout tests are broken since r174231
+        https://bugs.webkit.org/show_bug.cgi?id=137443
+
+        Reviewed by Zoltan Herczeg.
+
+        EFL layout test and MiniBrowser have broken since r174231. r174231 was to move PageOverlay implementation
+        from WebKit2 to WebCore with lazy initializing of PageOverlayController. It caused all EFL layout tests
+        crash and build break. To restore EFL layout test, this patch sets viewOverlayRootLayer through
+        attachViewOverlayGraphicsLayer() as mac port's one in r174231.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
+        (WebKit::CoordinatedDrawingArea::attachViewOverlayGraphicsLayer):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
+        (WebKit::CoordinatedLayerTreeHost::updateRootLayers):
+        (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
+        (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
+        (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
+
 2014-10-08  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r174335.
index df57768..a8accdb 100644 (file)
@@ -29,6 +29,7 @@
 #if USE(COORDINATED_GRAPHICS)
 #include "CoordinatedDrawingArea.h"
 
+#include "CoordinatedLayerTreeHost.h"
 #include "DrawingAreaProxyMessages.h"
 #include "LayerTreeContext.h"
 #include "PageOverlayController.h"
@@ -605,5 +606,17 @@ void CoordinatedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage(IPC::Conn
         m_layerTreeHost->didReceiveCoordinatedLayerTreeHostMessage(connection, decoder);
 }
 
+void CoordinatedDrawingArea::attachViewOverlayGraphicsLayer(WebCore::Frame* frame, WebCore::GraphicsLayer* viewOverlayRootLayer)
+{
+    if (!frame->isMainFrame())
+        return;
+
+    if (!m_layerTreeHost)
+        return;
+
+    CoordinatedLayerTreeHost* coordinatedLayerTreeHost = static_cast<CoordinatedLayerTreeHost*>(m_layerTreeHost.get());
+    coordinatedLayerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer);
+}
+
 } // namespace WebKit
 #endif // USE(COORDINATED_GRAPHICS)
index 7e6486e..a4e2ebf 100644 (file)
@@ -66,6 +66,8 @@ private:
 
     virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection*, IPC::MessageDecoder&);
 
+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
+
     // IPC message handlers.
     virtual void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset);
     virtual void didUpdate();
index 546b34c..b066194 100644 (file)
@@ -67,6 +67,8 @@ CoordinatedLayerTreeHost::CoordinatedLayerTreeHost(WebPage* webPage)
     , m_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired)
     , m_layerFlushSchedulingEnabled(true)
     , m_forceRepaintAsyncCallbackID(0)
+    , m_contentLayer(nullptr)
+    , m_viewOverlayRootLayer(nullptr)
 {
     m_coordinator = std::make_unique<CompositingCoordinator>(webPage->corePage(), this);
 
@@ -112,9 +114,24 @@ void CoordinatedLayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool
     m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
 }
 
+void CoordinatedLayerTreeHost::updateRootLayers()
+{
+    if (!m_contentLayer && !m_viewOverlayRootLayer)
+        return;
+
+    m_coordinator->setRootCompositingLayer(m_contentLayer, m_viewOverlayRootLayer);
+}
+
+void CoordinatedLayerTreeHost::setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer)
+{
+    m_viewOverlayRootLayer = viewOverlayRootLayer;
+    updateRootLayers();
+}
+
 void CoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
 {
-    m_coordinator->setRootCompositingLayer(graphicsLayer, &m_webPage->mainFrame()->pageOverlayController().viewOverlayRootLayer());
+    m_contentLayer = graphicsLayer;
+    updateRootLayers();
 }
 
 void CoordinatedLayerTreeHost::invalidate()
@@ -178,7 +195,8 @@ void CoordinatedLayerTreeHost::purgeBackingStores()
 void CoordinatedLayerTreeHost::didFlushRootLayer(const FloatRect& visibleContentRect)
 {
     // Because our view-relative overlay root layer is not attached to the FrameView's GraphicsLayer tree, we need to flush it manually.
-    m_coordinator->mainContentsLayer()->flushCompositingState(visibleContentRect);
+    if (m_coordinator->mainContentsLayer())
+        m_coordinator->mainContentsLayer()->flushCompositingState(visibleContentRect);
 }
 
 void CoordinatedLayerTreeHost::performScheduledLayerFlush()
index 94eda45..e2ca9c0 100644 (file)
@@ -70,6 +70,8 @@ public:
     virtual void scheduleAnimation() override;
 #endif
 
+    void setViewOverlayRootLayer(WebCore::GraphicsLayer*);
+
     static PassRefPtr<WebCore::CoordinatedSurface> createCoordinatedSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags);
 
 protected:
@@ -86,6 +88,8 @@ private:
 
     void layerFlushTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*);
 
+    void updateRootLayers();
+
     // CompositingCoordinator::Client
     virtual void didFlushRootLayer(const WebCore::FloatRect& visibleContentRect) override;
     virtual void notifyFlushRequired() override { scheduleLayerFlush(); };
@@ -104,6 +108,9 @@ private:
     WebCore::Timer<CoordinatedLayerTreeHost> m_layerFlushTimer;
     bool m_layerFlushSchedulingEnabled;
     uint64_t m_forceRepaintAsyncCallbackID;
+
+    WebCore::GraphicsLayer* m_contentLayer;
+    WebCore::GraphicsLayer* m_viewOverlayRootLayer;
 };
 
 } // namespace WebKit