[GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jun 2019 11:17:31 +0000 (11:17 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jun 2019 11:17:31 +0000 (11:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198748

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsGTK.cmake: Remove USE_REDIRECTED_XCOMPOSITE_WINDOW build option.

Source/WebKit:

It's unused and untested, we kept that code path only because the redirected window caused performance issues in
some drivers in embedded devices. Nowadays there are much better solutions for those cases like using WPE port
or GTK port under wayland instead of X11.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::create): Remove the ShouldDoFrameSync parameter since it always receives Yes.
(WebKit::ThreadedCompositor::ThreadedCompositor): Ditto.
(WebKit::ThreadedCompositor::createGLContext): Remove the code to handle the case of ShouldDoFrameSync being No,
since it's always Yes.
(WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
(webkitWebViewBaseUnrealize): Ditto.
(webkitWebViewBaseDraw): acceleratedBackingStore member can't be nullptr now.
(webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
(webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
(webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
(webkitWebViewBaseMakeGLContextCurrent): Ditto.
(webkitWebViewBaseDidRelaunchWebProcess): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
(webkitWebViewBasePageClosed): Ditto.
(webkitWebViewBaseRenderHostFileDescriptor): acceleratedBackingStore member can't be nullptr now.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
(WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
(WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
(WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
* UIProcess/gtk/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::create): Add an assert to ensure we create an AcceleratedBackingStore.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
* UIProcess/gtk/AcceleratedBackingStoreX11.h:
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create): Add an assert to ensure we create an AcceleratedSurface.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
(WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
(WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::LayerTreeHost): m_surface can't be nullptr now.
(WebKit::LayerTreeHost::sizeDidChange): Ditto.
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
(WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing): Ditto.
(WebKit::LayerTreeHost::didDestroyGLContext): Ditto.
(WebKit::LayerTreeHost::willRenderFrame): Ditto.
(WebKit::LayerTreeHost::didRenderFrame): Ditto.
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::nativeWindowHandle): Deleted.
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:

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

22 files changed:
ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp
Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h
Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp
Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
Source/WebKit/WebProcess/WebPage/DrawingArea.h
Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp
Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h
Source/cmake/OptionsGTK.cmake

index 59cdcce..42a2f75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
+        https://bugs.webkit.org/show_bug.cgi?id=198748
+
+        Reviewed by Žan Doberšek.
+
+        * Source/cmake/OptionsGTK.cmake: Remove USE_REDIRECTED_XCOMPOSITE_WINDOW build option.
+
 2019-06-10  Sam Weinig  <weinig@apple.com>
 
         Remove Dashboard support
index 62d6d4a..8dcd7dc 100644 (file)
@@ -1,3 +1,67 @@
+2019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
+        https://bugs.webkit.org/show_bug.cgi?id=198748
+
+        Reviewed by Žan Doberšek.
+
+        It's unused and untested, we kept that code path only because the redirected window caused performance issues in
+        some drivers in embedded devices. Nowadays there are much better solutions for those cases like using WPE port
+        or GTK port under wayland instead of X11.
+
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::create): Remove the ShouldDoFrameSync parameter since it always receives Yes.
+        (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto.
+        (WebKit::ThreadedCompositor::createGLContext): Remove the code to handle the case of ShouldDoFrameSync being No,
+        since it's always Yes.
+        (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Deleted.
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseRealize): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
+        (webkitWebViewBaseUnrealize): Ditto.
+        (webkitWebViewBaseDraw): acceleratedBackingStore member can't be nullptr now.
+        (webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
+        (webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
+        (webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
+        (webkitWebViewBaseMakeGLContextCurrent): Ditto.
+        (webkitWebViewBaseDidRelaunchWebProcess): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
+        (webkitWebViewBasePageClosed): Ditto.
+        (webkitWebViewBaseRenderHostFileDescriptor): acceleratedBackingStore member can't be nullptr now.
+        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
+        (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
+        (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
+        (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
+        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
+        * UIProcess/gtk/AcceleratedBackingStore.cpp:
+        (WebKit::AcceleratedBackingStore::create): Add an assert to ensure we create an AcceleratedBackingStore.
+        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
+        * UIProcess/gtk/AcceleratedBackingStoreX11.h:
+        * UIProcess/gtk/HardwareAccelerationManager.cpp:
+        (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
+        * WebProcess/WebPage/AcceleratedSurface.cpp:
+        (WebKit::AcceleratedSurface::create): Add an assert to ensure we create an AcceleratedSurface.
+        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
+        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
+        (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
+        (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
+        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
+        (WebKit::LayerTreeHost::LayerTreeHost): m_surface can't be nullptr now.
+        (WebKit::LayerTreeHost::sizeDidChange): Ditto.
+        (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
+        (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing): Ditto.
+        (WebKit::LayerTreeHost::didDestroyGLContext): Ditto.
+        (WebKit::LayerTreeHost::willRenderFrame): Ditto.
+        (WebKit::LayerTreeHost::didRenderFrame): Ditto.
+        (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
+        * WebProcess/WebPage/DrawingArea.h:
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::nativeWindowHandle): Deleted.
+        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
+        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
+
 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE][GTK] bubblewrap sandbox should grant access to web extensions directory
index 530da86..e84d52f 100644 (file)
 namespace WebKit {
 using namespace WebCore;
 
-Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
+Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, TextureMapper::PaintFlags paintFlags)
 {
-    return adoptRef(*new ThreadedCompositor(client, displayRefreshMonitorClient, displayID, viewportSize, scaleFactor, doFrameSync, paintFlags));
+    return adoptRef(*new ThreadedCompositor(client, displayRefreshMonitorClient, displayID, viewportSize, scaleFactor, paintFlags));
 }
 
-ThreadedCompositor::ThreadedCompositor(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
+ThreadedCompositor::ThreadedCompositor(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, TextureMapper::PaintFlags paintFlags)
     : m_client(client)
-    , m_doFrameSync(doFrameSync)
     , m_paintFlags(paintFlags)
     , m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); }))
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
@@ -88,14 +87,8 @@ void ThreadedCompositor::createGLContext()
     ASSERT(m_nativeSurfaceHandle);
 
     m_context = GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle), &PlatformDisplay::sharedDisplayForCompositing());
-    if (!m_context)
-        return;
-
-    if (!m_context->makeContextCurrent())
-        return;
-
-    if (m_doFrameSync == ShouldDoFrameSync::No)
-        m_context->swapInterval(0);
+    if (m_context)
+        m_context->makeContextCurrent();
 }
 
 void ThreadedCompositor::invalidate()
@@ -139,22 +132,6 @@ void ThreadedCompositor::resume()
     m_compositingRunLoop->resume();
 }
 
-void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
-    m_compositingRunLoop->stopUpdates();
-    m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this), handle] {
-        // A new native handle can't be set without destroying the previous one first if any.
-        ASSERT(!!handle ^ !!m_nativeSurfaceHandle);
-        m_nativeSurfaceHandle = handle;
-
-        m_scene->setActive(!!m_nativeSurfaceHandle);
-        if (m_nativeSurfaceHandle)
-            createGLContext();
-        else
-            m_context = nullptr;
-    });
-}
-
 void ThreadedCompositor::setScaleFactor(float scale)
 {
     LockHolder locker(m_attributes.lock);
index 7e16738..66fe3f1 100644 (file)
@@ -61,12 +61,9 @@ public:
         virtual void didRenderFrame() = 0;
     };
 
-    enum class ShouldDoFrameSync { No, Yes };
-
-    static Ref<ThreadedCompositor> create(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0);
+    static Ref<ThreadedCompositor> create(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, WebCore::TextureMapper::PaintFlags);
     virtual ~ThreadedCompositor();
 
-    void setNativeSurfaceHandleForCompositing(uint64_t);
     void setScaleFactor(float);
     void setScrollPosition(const WebCore::IntPoint&, float scale);
     void setViewportSize(const WebCore::IntSize&, float scale);
@@ -87,7 +84,7 @@ public:
     void resume();
 
 private:
-    ThreadedCompositor(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);
+    ThreadedCompositor(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, WebCore::TextureMapper::PaintFlags);
 
     // CoordinatedGraphicsSceneClient
     void updateViewport() override;
@@ -102,7 +99,6 @@ private:
     std::unique_ptr<WebCore::GLContext> m_context;
 
     uint64_t m_nativeSurfaceHandle;
-    ShouldDoFrameSync m_doFrameSync;
     WebCore::TextureMapper::PaintFlags m_paintFlags { 0 };
     bool m_inForceRepaint { false };
     unsigned m_suspendedCount { 0 };
index c9add07..b23cad1 100644 (file)
@@ -425,25 +425,12 @@ static void webkitWebViewBaseRealize(GtkWidget* widget)
     gtk_widget_set_window(widget, window);
     gdk_window_set_user_data(window, widget);
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
-        if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()))
-            drawingArea->setNativeSurfaceHandleForCompositing(GDK_WINDOW_XID(window));
-    }
-#endif
-
     gtk_im_context_set_client_window(priv->inputMethodFilter.context(), window);
 }
 
 static void webkitWebViewBaseUnrealize(GtkWidget* widget)
 {
     WebKitWebViewBase* webView = WEBKIT_WEB_VIEW_BASE(widget);
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
-        if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webView->priv->pageProxy->drawingArea()))
-            drawingArea->destroyNativeSurfaceHandleForCompositing();
-    }
-#endif
     gtk_im_context_set_client_window(webView->priv->inputMethodFilter.context(), nullptr);
 
     GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->unrealize(widget);
@@ -602,7 +589,7 @@ static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
     if (showingNavigationSnapshot)
         cairo_push_group(cr);
 
-    if (webViewBase->priv->acceleratedBackingStore && drawingArea->isInAcceleratedCompositingMode())
+    if (drawingArea->isInAcceleratedCompositingMode())
         webViewBase->priv->acceleratedBackingStore->paint(cr, clipRect);
     else {
         WebCore::Region unpaintedRegion; // This is simply unused.
@@ -1658,27 +1645,22 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)
 
 void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext)
 {
-    if (webkitWebViewBase->priv->acceleratedBackingStore)
-        webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
+    webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
 }
 
 void webkitWebViewBaseUpdateAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext)
 {
-    if (webkitWebViewBase->priv->acceleratedBackingStore)
-        webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
+    webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
 }
 
 void webkitWebViewBaseExitAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase)
 {
-    if (webkitWebViewBase->priv->acceleratedBackingStore)
-        webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
+    webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
 }
 
 bool webkitWebViewBaseMakeGLContextCurrent(WebKitWebViewBase* webkitWebViewBase)
 {
-    if (webkitWebViewBase->priv->acceleratedBackingStore)
-        return webkitWebViewBase->priv->acceleratedBackingStore->makeContextCurrent();
-    return false;
+    return webkitWebViewBase->priv->acceleratedBackingStore->makeContextCurrent();
 }
 
 void webkitWebViewBaseDidRelaunchWebProcess(WebKitWebViewBase* webkitWebViewBase)
@@ -1687,43 +1669,13 @@ void webkitWebViewBaseDidRelaunchWebProcess(WebKitWebViewBase* webkitWebViewBase
     gtk_widget_queue_resize_no_redraw(GTK_WIDGET(webkitWebViewBase));
 
     WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
-
-#if PLATFORM(X11) && USE(TEXTURE_MAPPER_GL) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
-        return;
-
-    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
-    ASSERT(drawingArea);
-
-    if (!gtk_widget_get_realized(GTK_WIDGET(webkitWebViewBase)))
-        return;
-
-    uint64_t windowID = GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(webkitWebViewBase)));
-    drawingArea->setNativeSurfaceHandleForCompositing(windowID);
-#else
-    UNUSED_PARAM(webkitWebViewBase);
-#endif
-
     priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy);
     priv->viewGestureController->setSwipeGestureEnabled(priv->isBackForwardNavigationGestureEnabled);
 }
 
 void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase)
 {
-    if (webkitWebViewBase->priv->acceleratedBackingStore)
-        webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
-#if PLATFORM(X11) && USE(TEXTURE_MAPPER_GL) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
-        return;
-
-    if (!gtk_widget_get_realized(GTK_WIDGET(webkitWebViewBase)))
-        return;
-
-    WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
-    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
-    ASSERT(drawingArea);
-    drawingArea->destroyNativeSurfaceHandleForCompositing();
-#endif
+    webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
 }
 
 RefPtr<WebKit::ViewSnapshot> webkitWebViewBaseTakeViewSnapshot(WebKitWebViewBase* webkitWebViewBase)
@@ -1832,8 +1784,6 @@ void webkitWebViewBaseShowEmojiChooser(WebKitWebViewBase* webkitWebViewBase, con
 #if USE(WPE_RENDERER)
 int webkitWebViewBaseRenderHostFileDescriptor(WebKitWebViewBase* webkitWebViewBase)
 {
-    if (webkitWebViewBase->priv->acceleratedBackingStore)
-        return webkitWebViewBase->priv->acceleratedBackingStore->renderHostFileDescriptor();
-    return -1;
+    return webkitWebViewBase->priv->acceleratedBackingStore->renderHostFileDescriptor();
 }
 #endif
index 066e110..16fc396 100644 (file)
@@ -181,17 +181,9 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState(uint64_t ba
 
     if (m_nextBackingStoreStateID != m_currentBackingStoreStateID)
         sendUpdateBackingStoreState(RespondImmediately);
-    else {
+    else
         m_hasReceivedFirstUpdate = true;
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-        if (m_pendingNativeSurfaceHandleForCompositing) {
-            setNativeSurfaceHandleForCompositing(m_pendingNativeSurfaceHandleForCompositing);
-            m_pendingNativeSurfaceHandleForCompositing = 0;
-        }
-#endif
-    }
-
 #if !PLATFORM(WPE)
     if (isInAcceleratedCompositingMode()) {
         ASSERT(!m_backingStore);
@@ -374,27 +366,6 @@ void DrawingAreaProxyCoordinatedGraphics::discardBackingStore()
 }
 #endif
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-void DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
-    if (!m_hasReceivedFirstUpdate) {
-        m_pendingNativeSurfaceHandleForCompositing = handle;
-        return;
-    }
-    send(Messages::DrawingArea::SetNativeSurfaceHandleForCompositing(handle), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
-}
-
-void DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing()
-{
-    if (m_pendingNativeSurfaceHandleForCompositing) {
-        m_pendingNativeSurfaceHandleForCompositing = 0;
-        return;
-    }
-    bool handled;
-    sendSync(Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing(), Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing::Reply(handled));
-}
-#endif
-
 DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor(WebPageProxy& webPage)
     : m_timer(RunLoop::main(), this, &DrawingMonitor::stop)
 #if PLATFORM(GTK)
index c935c69..dfdd77f 100644 (file)
@@ -49,11 +49,6 @@ public:
 
     bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    void setNativeSurfaceHandleForCompositing(uint64_t);
-    void destroyNativeSurfaceHandleForCompositing();
-#endif
-
 private:
     // DrawingAreaProxy
     void sizeDidChange() override;
@@ -130,10 +125,6 @@ private:
     // For a new Drawing Area don't draw anything until the WebProcess has sent over the first content.
     bool m_hasReceivedFirstUpdate { false };
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };
-#endif
-
 #if !PLATFORM(WPE)
     bool m_isBackingStoreDiscardable { true };
     std::unique_ptr<BackingStore> m_backingStore;
index eb62d6d..d6f2876 100644 (file)
@@ -34,7 +34,7 @@
 #include "AcceleratedBackingStoreWayland.h"
 #endif
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 #include "AcceleratedBackingStoreX11.h"
 #endif
 
@@ -47,10 +47,11 @@ std::unique_ptr<AcceleratedBackingStore> AcceleratedBackingStore::create(WebPage
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland)
         return AcceleratedBackingStoreWayland::create(webPage);
 #endif
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
         return AcceleratedBackingStoreX11::create(webPage);
 #endif
+    RELEASE_ASSERT_NOT_REACHED();
     return nullptr;
 }
 
index eafacb7..a540732 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "AcceleratedBackingStoreX11.h"
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 
 #include "DrawingAreaProxyCoordinatedGraphics.h"
 #include "LayerTreeContext.h"
@@ -202,4 +202,4 @@ bool AcceleratedBackingStoreX11::paint(cairo_t* cr, const IntRect& clipRect)
 
 } // namespace WebKit
 
-#endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#endif // PLATFORM(X11)
index d9a7c2f..a8b3a92 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "AcceleratedBackingStore.h"
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 
 #include <WebCore/RefPtrCairo.h>
 #include <WebCore/XUniqueResource.h>
@@ -43,7 +43,7 @@ public:
     ~AcceleratedBackingStoreX11();
 
 private:
-    AcceleratedBackingStoreX11(WebPageProxy&);
+    explicit AcceleratedBackingStoreX11(WebPageProxy&);
 
     void update(const LayerTreeContext&) override;
     bool paint(cairo_t*, const WebCore::IntRect&) override;
@@ -54,4 +54,4 @@ private:
 
 } // namespace WebKit
 
-#endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#endif // PLATFORM(X11)
index c999827..ceceec3 100644 (file)
@@ -29,7 +29,7 @@
 #include <WebCore/NotImplemented.h>
 #include <WebCore/PlatformDisplay.h>
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 #include <WebCore/PlatformDisplayX11.h>
 #endif
 
@@ -65,7 +65,7 @@ HardwareAccelerationManager::HardwareAccelerationManager()
         return;
     }
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
         auto& display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay());
         Optional<int> damageBase, errorBase;
index 2bbddd7..1330671 100644 (file)
@@ -33,7 +33,7 @@
 #include "AcceleratedSurfaceWayland.h"
 #endif
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 #include "AcceleratedSurfaceX11.h"
 #endif
 
@@ -54,7 +54,7 @@ std::unique_ptr<AcceleratedSurface> AcceleratedSurface::create(WebPage& webPage,
         return AcceleratedSurfaceWayland::create(webPage, client);
 #endif
 #endif
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
         return AcceleratedSurfaceX11::create(webPage, client);
 #endif
@@ -62,6 +62,7 @@ std::unique_ptr<AcceleratedSurface> AcceleratedSurface::create(WebPage& webPage,
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::WPE)
         return AcceleratedSurfaceLibWPE::create(webPage, client);
 #endif
+    RELEASE_ASSERT_NOT_REACHED();
     return nullptr;
 }
 
index 072000e..30f66b0 100644 (file)
@@ -333,23 +333,6 @@ RefPtr<DisplayRefreshMonitor> DrawingAreaCoordinatedGraphics::createDisplayRefre
 }
 #endif
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-void DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
-    m_nativeSurfaceHandleForCompositing = handle;
-    if (m_layerTreeHost) {
-        m_webPage.corePage()->settings().setAcceleratedCompositingEnabled(true);
-        m_layerTreeHost->setNativeSurfaceHandleForCompositing(handle);
-    }
-}
-
-void DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing(bool& handled)
-{
-    handled = true;
-    setNativeSurfaceHandleForCompositing(0);
-}
-#endif
-
 void DrawingAreaCoordinatedGraphics::activityStateDidChange(OptionSet<ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&)
 {
     if (changed & ActivityState::IsVisible) {
@@ -567,10 +550,6 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay
             m_layerTreeHost->pauseRendering();
     }
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    if (m_nativeSurfaceHandleForCompositing)
-        m_layerTreeHost->setNativeSurfaceHandleForCompositing(m_nativeSurfaceHandleForCompositing);
-#endif
     if (!m_inUpdateBackingStoreState)
         m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
 
index e684f75..5af9d5e 100644 (file)
@@ -73,11 +73,6 @@ private:
     RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
 #endif
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    void setNativeSurfaceHandleForCompositing(uint64_t) override;
-    void destroyNativeSurfaceHandleForCompositing(bool&) override;
-#endif
-
     void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& /* callbackIDs */) override;
     void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
 
index e894bd1..880c4e3 100644 (file)
@@ -71,16 +71,12 @@ LayerTreeHost::LayerTreeHost(WebPage& webPage)
     scaledSize.scale(m_webPage.deviceScaleFactor());
     float scaleFactor = m_webPage.deviceScaleFactor() * m_viewportController.pageScaleFactor();
 
-    if (m_surface) {
-        TextureMapper::PaintFlags paintFlags = 0;
+    TextureMapper::PaintFlags paintFlags = 0;
+    if (m_surface->shouldPaintMirrored())
+        paintFlags |= TextureMapper::PaintingMirrored;
 
-        if (m_surface->shouldPaintMirrored())
-            paintFlags |= TextureMapper::PaintingMirrored;
-
-        m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor, ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags);
-        m_layerTreeContext.contextID = m_surface->surfaceID();
-    } else
-        m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor);
+    m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor, paintFlags);
+    m_layerTreeContext.contextID = m_surface->surfaceID();
 
     didChangeViewport();
 }
@@ -226,7 +222,7 @@ void LayerTreeHost::sizeDidChange(const IntSize& size)
         return;
     }
 
-    if (m_surface && m_surface->hostResize(size))
+    if (m_surface->hostResize(size))
         m_layerTreeContext.contextID = m_surface->surfaceID();
 
     m_coordinator.sizeDidChange(size);
@@ -335,15 +331,6 @@ void LayerTreeHost::setIsDiscardable(bool discardable)
         didChangeViewport();
 }
 
-#if PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-void LayerTreeHost::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
-    m_layerTreeContext.contextID = handle;
-    m_compositor->setNativeSurfaceHandleForCompositing(handle);
-    scheduleLayerFlush();
-}
-#endif
-
 void LayerTreeHost::deviceOrPageScaleFactorChanged()
 {
     if (m_isDiscardable) {
@@ -351,7 +338,7 @@ void LayerTreeHost::deviceOrPageScaleFactorChanged()
         return;
     }
 
-    if (m_surface && m_surface->hostResize(m_webPage.size()))
+    if (m_surface->hostResize(m_webPage.size()))
         m_layerTreeContext.contextID = m_surface->surfaceID();
 
     m_coordinator.deviceOrPageScaleFactorChanged();
@@ -386,29 +373,23 @@ void LayerTreeHost::frameComplete()
 
 uint64_t LayerTreeHost::nativeSurfaceHandleForCompositing()
 {
-    if (!m_surface)
-        return m_layerTreeContext.contextID;
-
     m_surface->initialize();
     return m_surface->window();
 }
 
 void LayerTreeHost::didDestroyGLContext()
 {
-    if (m_surface)
-        m_surface->finalize();
+    m_surface->finalize();
 }
 
 void LayerTreeHost::willRenderFrame()
 {
-    if (m_surface)
-        m_surface->willRenderFrame();
+    m_surface->willRenderFrame();
 }
 
 void LayerTreeHost::didRenderFrame()
 {
-    if (m_surface)
-        m_surface->didRenderFrame();
+    m_surface->didRenderFrame();
 }
 
 void LayerTreeHost::requestDisplayRefreshMonitorUpdate()
index 38f3b7f..cc3b691 100644 (file)
@@ -87,10 +87,6 @@ public:
 
     void setIsDiscardable(bool);
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK)
-    void setNativeSurfaceHandleForCompositing(uint64_t);
-#endif
-
     void deviceOrPageScaleFactorChanged();
 
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
index 8069a15..4da28bd 100644 (file)
@@ -162,14 +162,9 @@ protected:
     DrawingAreaIdentifier m_identifier;
     WebPage& m_webPage;
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    uint64_t m_nativeSurfaceHandleForCompositing { 0 };
-#endif
-
 private:
     // IPC::MessageReceiver.
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
-    void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
 
     // Message handlers.
     // FIXME: These should be pure virtual.
@@ -188,11 +183,6 @@ private:
     virtual void addTransactionCallbackID(WebKit::CallbackID) { ASSERT_NOT_REACHED(); }
 #endif
 
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    virtual void setNativeSurfaceHandleForCompositing(uint64_t) = 0;
-    virtual void destroyNativeSurfaceHandleForCompositing(bool&) = 0;
-#endif
-
     bool m_hasRemovedMessageReceiver { false };
 };
 
index 0233040..9da6ca5 100644 (file)
@@ -39,9 +39,4 @@ messages -> DrawingArea {
     
     AddTransactionCallbackID(WebKit::CallbackID callbackID)
 #endif
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    SetNativeSurfaceHandleForCompositing(uint64_t handle)
-    DestroyNativeSurfaceHandleForCompositing() -> (bool handled)
-#endif
 }
index 18a35ad..10a95e4 100644 (file)
@@ -972,10 +972,6 @@ public:
     void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
 #endif
 
-#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
-    uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
-#endif
-
     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
 
     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
@@ -1683,11 +1679,6 @@ private:
     GRefPtr<AtkObject> m_accessibilityObject;
 #endif
 
-#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
-    // Our view's window in the UI process.
-    uint64_t m_nativeWindowHandle { 0 };
-#endif
-
 #if !PLATFORM(IOS_FAMILY)
     RefPtr<PageBanner> m_headerBanner;
     RefPtr<PageBanner> m_footerBanner;
index 72e1ad9..e3ea844 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "AcceleratedSurfaceX11.h"
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 
 #include "WebPage.h"
 #include <WebCore/PlatformDisplayX11.h>
@@ -156,4 +156,4 @@ void AcceleratedSurfaceX11::didRenderFrame()
 
 } // namespace WebKit
 
-#endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#endif // PLATFORM(X11)
index d6cd42e..4de06a1 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#if PLATFORM(X11)
 
 #include "AcceleratedSurface.h"
 #include <WebCore/XUniqueResource.h>
@@ -64,4 +64,4 @@ private:
 
 } // namespace WebKit
 
-#endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
+#endif // PLATFORM(X11)
index 633ff28..fdb94a0 100644 (file)
@@ -90,7 +90,6 @@ WEBKIT_OPTION_DEFINE(USE_WPE_RENDERER "Whether to enable WPE rendering" PUBLIC O
 
 # Private options specific to the GTK+ port. Changing these options is
 # completely unsupported. They are intended for use only by WebKit developers.
-WEBKIT_OPTION_DEFINE(USE_REDIRECTED_XCOMPOSITE_WINDOW "Whether to use a Redirected XComposite Window for accelerated compositing in X11." PRIVATE ON)
 WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE OFF)
 
 # FIXME: Can we use cairo-glesv2 to avoid this conflict?
@@ -102,8 +101,6 @@ WEBKIT_OPTION_DEPEND(ENABLE_ASYNC_SCROLLING ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(ENABLE_GLES2 ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(ENABLE_PLUGIN_PROCESS_GTK2 ENABLE_X11_TARGET)
 WEBKIT_OPTION_DEPEND(ENABLE_WEBGL ENABLE_OPENGL)
-WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_OPENGL)
-WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_X11_TARGET)
 WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_WAYLAND_TARGET)