[CoordinatedGraphics] Rearrange uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS
authorgyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 01:16:59 +0000 (01:16 +0000)
committergyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 01:16:59 +0000 (01:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147256

Reviewed by Benjamin Poulain.

Reduce uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS guard in order to fix build
breaks when USE_COORDINATED_GRAPHICS_MULTIPROCESS is off. This is first step to switch
between multiprocess model to thread model.

* PlatformEfl.cmake:
* Shared/DrawingAreaInfo.h:
* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewFindZoomableAreaForRect):
* UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
(WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
(WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::pageTransitionViewportReady):
* UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp:
* UIProcess/CoordinatedGraphics/WebView.cpp:
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::commitPageTransitionViewport):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
(WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
(WebKit::WebPage::pageDidRequestScroll):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

21 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/Shared/DrawingAreaInfo.h
Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h
Source/WebKit2/UIProcess/CoordinatedGraphics/PageViewportController.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h

index a2d354c..85506ee 100644 (file)
@@ -1,3 +1,46 @@
+2015-08-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        [CoordinatedGraphics] Rearrange uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS
+        https://bugs.webkit.org/show_bug.cgi?id=147256
+
+        Reviewed by Benjamin Poulain.
+
+        Reduce uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS guard in order to fix build
+        breaks when USE_COORDINATED_GRAPHICS_MULTIPROCESS is off. This is first step to switch
+        between multiprocess model to thread model.
+
+        * PlatformEfl.cmake:
+        * Shared/DrawingAreaInfo.h:
+        * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
+        (WKViewFindZoomableAreaForRect):
+        * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
+        (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
+        (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
+        * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
+        (WebKit::PageViewportController::pageTransitionViewportReady):
+        * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp:
+        * UIProcess/CoordinatedGraphics/WebView.cpp:
+        * UIProcess/CoordinatedGraphics/WebView.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::commitPageTransitionViewport):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
+        (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
+        * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+        * WebProcess/WebPage/DrawingAreaImpl.h:
+        * WebProcess/WebPage/LayerTreeHost.cpp:
+        (WebKit::LayerTreeHost::create):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::sendViewportAttributesChanged):
+        (WebKit::WebPage::pageDidRequestScroll):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2015-08-03  Matt Rajca  <mrajca@apple.com>
 
         Media Session: let UI clients query whether a media element is paused
index d1faf88..3d24f4c 100644 (file)
@@ -209,6 +209,8 @@ list(APPEND WebKit2_SOURCES
 
     WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
 
+    WebProcess/WebPage/DrawingAreaImpl.cpp
+
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
     WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp
index 1b6da52..224d8d2 100644 (file)
@@ -38,7 +38,7 @@ enum DrawingAreaType {
 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     DrawingAreaTypeCoordinated
 #else
-    DrawingAreaTypeImpl,
+    DrawingAreaTypeImpl
 #endif
 #endif
 };
index 9a21104..a588480 100644 (file)
@@ -191,8 +191,13 @@ double WKViewOpacity(WKViewRef view)
 
 void WKViewFindZoomableAreaForRect(WKViewRef viewRef, WKRect wkRect)
 {
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     IntRect rect = toIntRect(wkRect);
     toImpl(viewRef)->findZoomableAreaForPoint(rect.center(), rect.size());
+#else
+    UNUSED_PARAM(viewRef);
+    UNUSED_PARAM(wkRect);
+#endif
 }
 
 WKSize WKViewGetContentsSize(WKViewRef viewRef)
index c31de2b..a4651f4 100644 (file)
@@ -45,7 +45,11 @@ using namespace WebCore;
 namespace WebKit {
 
 CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy(WebPageProxy& webPageProxy)
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     : DrawingAreaProxy(DrawingAreaTypeCoordinated, webPageProxy)
+#else
+    : DrawingAreaProxy(DrawingAreaTypeImpl, webPageProxy)
+#endif
     , m_currentBackingStoreStateID(0)
     , m_nextBackingStoreStateID(0)
     , m_isWaitingForDidUpdateBackingStoreState(false)
index ca51bd3..f76f6e5 100644 (file)
@@ -65,7 +65,7 @@ void CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState(const Coordin
     });
 
     updateViewport();
-#if USE(COORDINATED_GRAPHICS)
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     m_drawingAreaProxy->page().didRenderFrame(graphicsState.contentsSize, graphicsState.coveredRect);
 #endif
 }
index 0465b69..d69fa17 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef CoordinatedLayerTreeHostProxy_h
 #define CoordinatedLayerTreeHostProxy_h
 
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+#if USE(COORDINATED_GRAPHICS)
 
 #include "CoordinatedGraphicsArgumentCoders.h"
 #include "CoordinatedGraphicsScene.h"
@@ -69,6 +69,6 @@ protected:
 
 } // namespace WebKit
 
-#endif // USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+#endif // USE(COORDINATED_GRAPHICS)
 
 #endif // CoordinatedLayerTreeHostProxy_h
index 20a25f6..1715657 100644 (file)
@@ -215,11 +215,13 @@ void PageViewportController::pageTransitionViewportReady()
         applyScaleAfterRenderingContents(innerBoundedViewportScale(initialScale));
     }
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     // At this point we should already have received the first viewport arguments and the requested scroll
     // position for the newly loaded page and sent our reactions to the web process. It's now safe to tell
     // the web process to start rendering the new page contents and possibly re-use the current tiles.
     // This assumes that all messages have been handled in order and that nothing has been pushed back on the event loop.
     m_webPageProxy->commitPageTransitionViewport();
+#endif
 }
 
 void PageViewportController::pageDidRequestScroll(const IntPoint& cssPosition)
index 07b1671..ad73d36 100644 (file)
@@ -37,6 +37,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
 {
     if (!isValid())
@@ -49,6 +50,7 @@ void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& ar
 {
     m_pageClient.didFindZoomableArea(target, area);
 }
+#endif
 
 } // namespace WebKit
 
index b6ef639..3747fbb 100644 (file)
@@ -519,6 +519,7 @@ void WebView::didChangeViewportProperties(const WebCore::ViewportAttributes& att
     m_client.didChangeViewportAttributes(this, attr);
 }
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
 void WebView::pageDidRequestScroll(const IntPoint& position)
 {
     FloatPoint uiPosition(position);
@@ -541,6 +542,7 @@ void WebView::findZoomableAreaForPoint(const IntPoint& point, const IntSize& siz
 {
     m_page->findZoomableAreaForPoint(transformFromScene().mapPoint(point), transformFromScene().mapSize(size));
 }
+#endif
 
 } // namespace WebKit
 
index d453724..48114e0 100644 (file)
@@ -94,7 +94,9 @@ public:
     bool requestExitFullScreen();
 #endif
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
+#endif
 
     // View client.
     void initializeClient(const WKViewClientBase*);
@@ -147,9 +149,11 @@ protected:
 
     virtual void didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) override;
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     virtual void pageDidRequestScroll(const WebCore::IntPoint&) override;
     virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) override;
     virtual void pageTransitionViewportReady() override;
+#endif
 
     virtual void setCursor(const WebCore::Cursor&) override;
     virtual void setCursorHiddenUntilMouseMoves(bool) override;
index 028b540..4168d1c 100644 (file)
@@ -1578,16 +1578,6 @@ void WebPageProxy::didCommitLayerTree(const RemoteLayerTreeTransaction&)
 }
 #endif
 
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
-void WebPageProxy::commitPageTransitionViewport()
-{
-    if (!isValid())
-        return;
-
-    process().send(Messages::WebPage::CommitPageTransitionViewport(), m_pageID);
-}
-#endif
-
 #if ENABLE(DRAG_SUPPORT)
 void WebPageProxy::dragEntered(DragData& dragData, const String& dragStorageName)
 {
@@ -3798,6 +3788,13 @@ void WebPageProxy::didRenderFrame(const WebCore::IntSize& contentsSize, const We
     m_pageClient.didRenderFrame(contentsSize, coveredRect);
 }
 
+void WebPageProxy::commitPageTransitionViewport()
+{
+    if (!isValid())
+        return;
+
+    process().send(Messages::WebPage::CommitPageTransitionViewport(), m_pageID);
+}
 #endif
 
 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
index 1ebce1e..96c8d1e 100644 (file)
@@ -529,6 +529,7 @@ public:
 
 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
+    void commitPageTransitionViewport();
 #endif
 #if PLATFORM(EFL)
     void setThemePath(const String&);
@@ -610,10 +611,6 @@ public:
     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
 #endif
 
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
-    void commitPageTransitionViewport();
-#endif
-
     void handleMouseEvent(const NativeWebMouseEvent&);
     void handleWheelEvent(const NativeWebWheelEvent&);
     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
@@ -880,7 +877,7 @@ public:
 
     WebPageCreationParameters creationParameters();
 
-#if USE(COORDINATED_GRAPHICS)
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
 #endif
 
index ad2579d..f74e800 100644 (file)
@@ -56,7 +56,11 @@ CoordinatedDrawingArea::~CoordinatedDrawingArea()
 }
 
 CoordinatedDrawingArea::CoordinatedDrawingArea(WebPage& webPage, const WebPageCreationParameters& parameters)
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
     : DrawingArea(DrawingAreaTypeCoordinated, webPage)
+#else
+    : DrawingArea(DrawingAreaTypeImpl, webPage)
+#endif
     , m_backingStoreStateID(0)
     , m_isPaintingEnabled(true)
     , m_inUpdateBackingStoreState(false)
index d705346..5410c40 100644 (file)
@@ -68,6 +68,10 @@ private:
     virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&, IPC::MessageDecoder&);
 #endif
 
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK)
+    virtual void setNativeSurfaceHandleForCompositing(uint64_t) override { };
+#endif
+
     virtual void viewStateDidChange(WebCore::ViewState::Flags, bool /* wantsDidUpdateViewState */, const Vector<uint64_t>& /* callbackIDs */) override;
     virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
 
index 6e39567..345648b 100644 (file)
@@ -44,6 +44,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
 void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
 {
     UNUSED_PARAM(area);
@@ -84,6 +85,7 @@ void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& are
 
     send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
 }
+#endif
 
 } // namespace WebKit
 
index a23d8c2..5139d9d 100644 (file)
@@ -50,7 +50,11 @@ DrawingAreaImpl::~DrawingAreaImpl()
 }
 
 DrawingAreaImpl::DrawingAreaImpl(WebPage& webPage, const WebPageCreationParameters& parameters)
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+    : DrawingArea(DrawingAreaTypeCoordinated, webPage)
+#else
     : DrawingArea(DrawingAreaTypeImpl, webPage)
+#endif
     , m_backingStoreStateID(0)
     , m_isPaintingEnabled(true)
     , m_inUpdateBackingStoreState(false)
index 95f2a99..94df31f 100644 (file)
@@ -74,6 +74,10 @@ private:
     virtual void setNativeSurfaceHandleForCompositing(uint64_t) override;
 #endif
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+    virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&, IPC::MessageDecoder&) override { };
+#endif
+
     // IPC message handlers.
     virtual void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override;
     virtual void didUpdate() override;
index 0f7c22e..ec67160 100644 (file)
@@ -40,10 +40,10 @@ namespace WebKit {
 
 PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage)
 {
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
-    return CoordinatedLayerTreeHost::create(webPage);
-#elif USE(COORDINATED_GRAPHICS_THREADED)
+#if USE(COORDINATED_GRAPHICS_THREADED)
     return ThreadedCoordinatedLayerTreeHost::create(webPage);
+#elif USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+    return CoordinatedLayerTreeHost::create(webPage);
 #elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
     return LayerTreeHostGtk::create(webPage);
 #else
index 725f5c0..88dc76f 100644 (file)
@@ -1299,11 +1299,11 @@ void WebPage::sendViewportAttributesChanged()
     // This also takes care of the relayout.
     setFixedLayoutSize(roundedIntSize(attr.layoutSize));
 
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
-    send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
-#else
+#if USE(COORDINATED_GRAPHICS_THREADED)
     if (m_drawingArea->layerTreeHost())
         m_drawingArea->layerTreeHost()->didChangeViewportProperties(attr);
+#else
+    send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
 #endif
 }
 #endif
@@ -1851,10 +1851,10 @@ void WebPage::pageStoppedScrolling()
 #if USE(COORDINATED_GRAPHICS)
 void WebPage::pageDidRequestScroll(const IntPoint& point)
 {
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
-    send(Messages::WebPageProxy::PageDidRequestScroll(point));
-#elif USE(COORDINATED_GRAPHICS_THREADED)
+#if USE(COORDINATED_GRAPHICS_THREADED)
     drawingArea()->scroll(IntRect(point, IntSize()), IntSize());
+#elif USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+    send(Messages::WebPageProxy::PageDidRequestScroll(point));
 #endif
 }
 #endif
index 159a80c..064b125 100644 (file)
@@ -572,6 +572,10 @@ public:
     void sendViewportAttributesChanged();
 #endif
 
+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+    void commitPageTransitionViewport();
+#endif
+
 #if ENABLE(CONTEXT_MENUS)
     WebContextMenu* contextMenu();
     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
@@ -610,10 +614,6 @@ public:
     void setThemePath(const String&);
 #endif
 
-#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
-    void commitPageTransitionViewport();
-#endif
-
 #if PLATFORM(GTK)
     void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
     void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);