⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246308 in webkit


Ignore:
Timestamp:
Jun 11, 2019, 4:17:31 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[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.

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:
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r246285 r246308  
     12019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
     4        https://bugs.webkit.org/show_bug.cgi?id=198748
     5
     6        Reviewed by Žan Doberšek.
     7
     8        * Source/cmake/OptionsGTK.cmake: Remove USE_REDIRECTED_XCOMPOSITE_WINDOW build option.
     9
    1102019-06-10  Sam Weinig  <weinig@apple.com>
    211
  • trunk/Source/WebKit/ChangeLog

    r246305 r246308  
     12019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
     4        https://bugs.webkit.org/show_bug.cgi?id=198748
     5
     6        Reviewed by Žan Doberšek.
     7
     8        It's unused and untested, we kept that code path only because the redirected window caused performance issues in
     9        some drivers in embedded devices. Nowadays there are much better solutions for those cases like using WPE port
     10        or GTK port under wayland instead of X11.
     11
     12        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
     13        (WebKit::ThreadedCompositor::create): Remove the ShouldDoFrameSync parameter since it always receives Yes.
     14        (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto.
     15        (WebKit::ThreadedCompositor::createGLContext): Remove the code to handle the case of ShouldDoFrameSync being No,
     16        since it's always Yes.
     17        (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Deleted.
     18        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
     19        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     20        (webkitWebViewBaseRealize): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
     21        (webkitWebViewBaseUnrealize): Ditto.
     22        (webkitWebViewBaseDraw): acceleratedBackingStore member can't be nullptr now.
     23        (webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
     24        (webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
     25        (webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
     26        (webkitWebViewBaseMakeGLContextCurrent): Ditto.
     27        (webkitWebViewBaseDidRelaunchWebProcess): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
     28        (webkitWebViewBasePageClosed): Ditto.
     29        (webkitWebViewBaseRenderHostFileDescriptor): acceleratedBackingStore member can't be nullptr now.
     30        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
     31        (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
     32        (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
     33        (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
     34        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
     35        * UIProcess/gtk/AcceleratedBackingStore.cpp:
     36        (WebKit::AcceleratedBackingStore::create): Add an assert to ensure we create an AcceleratedBackingStore.
     37        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
     38        * UIProcess/gtk/AcceleratedBackingStoreX11.h:
     39        * UIProcess/gtk/HardwareAccelerationManager.cpp:
     40        (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
     41        * WebProcess/WebPage/AcceleratedSurface.cpp:
     42        (WebKit::AcceleratedSurface::create): Add an assert to ensure we create an AcceleratedSurface.
     43        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
     44        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
     45        (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
     46        (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
     47        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
     48        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
     49        (WebKit::LayerTreeHost::LayerTreeHost): m_surface can't be nullptr now.
     50        (WebKit::LayerTreeHost::sizeDidChange): Ditto.
     51        (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
     52        (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing): Ditto.
     53        (WebKit::LayerTreeHost::didDestroyGLContext): Ditto.
     54        (WebKit::LayerTreeHost::willRenderFrame): Ditto.
     55        (WebKit::LayerTreeHost::didRenderFrame): Ditto.
     56        (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
     57        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
     58        * WebProcess/WebPage/DrawingArea.h:
     59        * WebProcess/WebPage/DrawingArea.messages.in:
     60        * WebProcess/WebPage/WebPage.h:
     61        (WebKit::WebPage::nativeWindowHandle): Deleted.
     62        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
     63        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
     64
    1652019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
    266
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

    r245807 r246308  
    4646using namespace WebCore;
    4747
    48 Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
    49 {
    50     return adoptRef(*new ThreadedCompositor(client, displayRefreshMonitorClient, displayID, viewportSize, scaleFactor, doFrameSync, paintFlags));
    51 }
    52 
    53 ThreadedCompositor::ThreadedCompositor(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
     48Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, TextureMapper::PaintFlags paintFlags)
     49{
     50    return adoptRef(*new ThreadedCompositor(client, displayRefreshMonitorClient, displayID, viewportSize, scaleFactor, paintFlags));
     51}
     52
     53ThreadedCompositor::ThreadedCompositor(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, TextureMapper::PaintFlags paintFlags)
    5454    : m_client(client)
    55     , m_doFrameSync(doFrameSync)
    5655    , m_paintFlags(paintFlags)
    5756    , m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); }))
     
    8988
    9089    m_context = GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle), &PlatformDisplay::sharedDisplayForCompositing());
    91     if (!m_context)
    92         return;
    93 
    94     if (!m_context->makeContextCurrent())
    95         return;
    96 
    97     if (m_doFrameSync == ShouldDoFrameSync::No)
    98         m_context->swapInterval(0);
     90    if (m_context)
     91        m_context->makeContextCurrent();
    9992}
    10093
     
    140133}
    141134
    142 void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle)
    143 {
    144     m_compositingRunLoop->stopUpdates();
    145     m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this), handle] {
    146         // A new native handle can't be set without destroying the previous one first if any.
    147         ASSERT(!!handle ^ !!m_nativeSurfaceHandle);
    148         m_nativeSurfaceHandle = handle;
    149 
    150         m_scene->setActive(!!m_nativeSurfaceHandle);
    151         if (m_nativeSurfaceHandle)
    152             createGLContext();
    153         else
    154             m_context = nullptr;
    155     });
    156 }
    157 
    158135void ThreadedCompositor::setScaleFactor(float scale)
    159136{
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h

    r243865 r246308  
    6262    };
    6363
    64     enum class ShouldDoFrameSync { No, Yes };
    65 
    66     static Ref<ThreadedCompositor> create(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0);
     64    static Ref<ThreadedCompositor> create(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, WebCore::TextureMapper::PaintFlags);
    6765    virtual ~ThreadedCompositor();
    6866
    69     void setNativeSurfaceHandleForCompositing(uint64_t);
    7067    void setScaleFactor(float);
    7168    void setScrollPosition(const WebCore::IntPoint&, float scale);
     
    8885
    8986private:
    90     ThreadedCompositor(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);
     87    ThreadedCompositor(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, WebCore::TextureMapper::PaintFlags);
    9188
    9289    // CoordinatedGraphicsSceneClient
     
    103100
    104101    uint64_t m_nativeSurfaceHandle;
    105     ShouldDoFrameSync m_doFrameSync;
    106102    WebCore::TextureMapper::PaintFlags m_paintFlags { 0 };
    107103    bool m_inForceRepaint { false };
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r245807 r246308  
    426426    gdk_window_set_user_data(window, widget);
    427427
    428 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    429     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
    430         if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()))
    431             drawingArea->setNativeSurfaceHandleForCompositing(GDK_WINDOW_XID(window));
    432     }
    433 #endif
    434 
    435428    gtk_im_context_set_client_window(priv->inputMethodFilter.context(), window);
    436429}
     
    439432{
    440433    WebKitWebViewBase* webView = WEBKIT_WEB_VIEW_BASE(widget);
    441 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    442     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
    443         if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webView->priv->pageProxy->drawingArea()))
    444             drawingArea->destroyNativeSurfaceHandleForCompositing();
    445     }
    446 #endif
    447434    gtk_im_context_set_client_window(webView->priv->inputMethodFilter.context(), nullptr);
    448435
     
    603590        cairo_push_group(cr);
    604591
    605     if (webViewBase->priv->acceleratedBackingStore && drawingArea->isInAcceleratedCompositingMode())
     592    if (drawingArea->isInAcceleratedCompositingMode())
    606593        webViewBase->priv->acceleratedBackingStore->paint(cr, clipRect);
    607594    else {
     
    16591646void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext)
    16601647{
    1661     if (webkitWebViewBase->priv->acceleratedBackingStore)
    1662         webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
     1648    webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
    16631649}
    16641650
    16651651void webkitWebViewBaseUpdateAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext)
    16661652{
    1667     if (webkitWebViewBase->priv->acceleratedBackingStore)
    1668         webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
     1653    webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext);
    16691654}
    16701655
    16711656void webkitWebViewBaseExitAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase)
    16721657{
    1673     if (webkitWebViewBase->priv->acceleratedBackingStore)
    1674         webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
     1658    webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
    16751659}
    16761660
    16771661bool webkitWebViewBaseMakeGLContextCurrent(WebKitWebViewBase* webkitWebViewBase)
    16781662{
    1679     if (webkitWebViewBase->priv->acceleratedBackingStore)
    1680         return webkitWebViewBase->priv->acceleratedBackingStore->makeContextCurrent();
    1681     return false;
     1663    return webkitWebViewBase->priv->acceleratedBackingStore->makeContextCurrent();
    16821664}
    16831665
     
    16881670
    16891671    WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
    1690 
    1691 #if PLATFORM(X11) && USE(TEXTURE_MAPPER_GL) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    1692     if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
    1693         return;
    1694 
    1695     auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
    1696     ASSERT(drawingArea);
    1697 
    1698     if (!gtk_widget_get_realized(GTK_WIDGET(webkitWebViewBase)))
    1699         return;
    1700 
    1701     uint64_t windowID = GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(webkitWebViewBase)));
    1702     drawingArea->setNativeSurfaceHandleForCompositing(windowID);
    1703 #else
    1704     UNUSED_PARAM(webkitWebViewBase);
    1705 #endif
    1706 
    17071672    priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy);
    17081673    priv->viewGestureController->setSwipeGestureEnabled(priv->isBackForwardNavigationGestureEnabled);
     
    17111676void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase)
    17121677{
    1713     if (webkitWebViewBase->priv->acceleratedBackingStore)
    1714         webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
    1715 #if PLATFORM(X11) && USE(TEXTURE_MAPPER_GL) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    1716     if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
    1717         return;
    1718 
    1719     if (!gtk_widget_get_realized(GTK_WIDGET(webkitWebViewBase)))
    1720         return;
    1721 
    1722     WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
    1723     auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
    1724     ASSERT(drawingArea);
    1725     drawingArea->destroyNativeSurfaceHandleForCompositing();
    1726 #endif
     1678    webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext());
    17271679}
    17281680
     
    18331785int webkitWebViewBaseRenderHostFileDescriptor(WebKitWebViewBase* webkitWebViewBase)
    18341786{
    1835     if (webkitWebViewBase->priv->acceleratedBackingStore)
    1836         return webkitWebViewBase->priv->acceleratedBackingStore->renderHostFileDescriptor();
    1837     return -1;
    1838 }
    1839 #endif
     1787    return webkitWebViewBase->priv->acceleratedBackingStore->renderHostFileDescriptor();
     1788}
     1789#endif
  • trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp

    r245807 r246308  
    182182    if (m_nextBackingStoreStateID != m_currentBackingStoreStateID)
    183183        sendUpdateBackingStoreState(RespondImmediately);
    184     else {
     184    else
    185185        m_hasReceivedFirstUpdate = true;
    186 
    187 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    188         if (m_pendingNativeSurfaceHandleForCompositing) {
    189             setNativeSurfaceHandleForCompositing(m_pendingNativeSurfaceHandleForCompositing);
    190             m_pendingNativeSurfaceHandleForCompositing = 0;
    191         }
    192 #endif
    193     }
    194186
    195187#if !PLATFORM(WPE)
     
    375367#endif
    376368
    377 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    378 void DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing(uint64_t handle)
    379 {
    380     if (!m_hasReceivedFirstUpdate) {
    381         m_pendingNativeSurfaceHandleForCompositing = handle;
    382         return;
    383     }
    384     send(Messages::DrawingArea::SetNativeSurfaceHandleForCompositing(handle), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
    385 }
    386 
    387 void DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing()
    388 {
    389     if (m_pendingNativeSurfaceHandleForCompositing) {
    390         m_pendingNativeSurfaceHandleForCompositing = 0;
    391         return;
    392     }
    393     bool handled;
    394     sendSync(Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing(), Messages::DrawingArea::DestroyNativeSurfaceHandleForCompositing::Reply(handled));
    395 }
    396 #endif
    397 
    398369DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor(WebPageProxy& webPage)
    399370    : m_timer(RunLoop::main(), this, &DrawingMonitor::stop)
  • trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h

    r243505 r246308  
    4949
    5050    bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
    51 
    52 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    53     void setNativeSurfaceHandleForCompositing(uint64_t);
    54     void destroyNativeSurfaceHandleForCompositing();
    55 #endif
    5651
    5752private:
     
    131126    bool m_hasReceivedFirstUpdate { false };
    132127
    133 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    134     uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };
    135 #endif
    136 
    137128#if !PLATFORM(WPE)
    138129    bool m_isBackingStoreDiscardable { true };
  • trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp

    r242082 r246308  
    3535#endif
    3636
    37 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     37#if PLATFORM(X11)
    3838#include "AcceleratedBackingStoreX11.h"
    3939#endif
     
    4848        return AcceleratedBackingStoreWayland::create(webPage);
    4949#endif
    50 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     50#if PLATFORM(X11)
    5151    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
    5252        return AcceleratedBackingStoreX11::create(webPage);
    5353#endif
     54    RELEASE_ASSERT_NOT_REACHED();
    5455    return nullptr;
    5556}
  • trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp

    r242346 r246308  
    2727#include "AcceleratedBackingStoreX11.h"
    2828
    29 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     29#if PLATFORM(X11)
    3030
    3131#include "DrawingAreaProxyCoordinatedGraphics.h"
     
    203203} // namespace WebKit
    204204
    205 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
     205#endif // PLATFORM(X11)
  • trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h

    r205116 r246308  
    2828#include "AcceleratedBackingStore.h"
    2929
    30 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     30#if PLATFORM(X11)
    3131
    3232#include <WebCore/RefPtrCairo.h>
     
    4444
    4545private:
    46     AcceleratedBackingStoreX11(WebPageProxy&);
     46    explicit AcceleratedBackingStoreX11(WebPageProxy&);
    4747
    4848    void update(const LayerTreeContext&) override;
     
    5555} // namespace WebKit
    5656
    57 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
     57#endif // PLATFORM(X11)
  • trunk/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp

    r245807 r246308  
    3030#include <WebCore/PlatformDisplay.h>
    3131
    32 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     32#if PLATFORM(X11)
    3333#include <WebCore/PlatformDisplayX11.h>
    3434#endif
     
    6666    }
    6767
    68 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     68#if PLATFORM(X11)
    6969    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
    7070        auto& display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay());
  • trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp

    r245807 r246308  
    3434#endif
    3535
    36 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     36#if PLATFORM(X11)
    3737#include "AcceleratedSurfaceX11.h"
    3838#endif
     
    5555#endif
    5656#endif
    57 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     57#if PLATFORM(X11)
    5858    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
    5959        return AcceleratedSurfaceX11::create(webPage, client);
     
    6363        return AcceleratedSurfaceLibWPE::create(webPage, client);
    6464#endif
     65    RELEASE_ASSERT_NOT_REACHED();
    6566    return nullptr;
    6667}
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp

    r246030 r246308  
    334334#endif
    335335
    336 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    337 void DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing(uint64_t handle)
    338 {
    339     m_nativeSurfaceHandleForCompositing = handle;
    340     if (m_layerTreeHost) {
    341         m_webPage.corePage()->settings().setAcceleratedCompositingEnabled(true);
    342         m_layerTreeHost->setNativeSurfaceHandleForCompositing(handle);
    343     }
    344 }
    345 
    346 void DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing(bool& handled)
    347 {
    348     handled = true;
    349     setNativeSurfaceHandleForCompositing(0);
    350 }
    351 #endif
    352 
    353336void DrawingAreaCoordinatedGraphics::activityStateDidChange(OptionSet<ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&)
    354337{
     
    568551    }
    569552
    570 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    571     if (m_nativeSurfaceHandleForCompositing)
    572         m_layerTreeHost->setNativeSurfaceHandleForCompositing(m_nativeSurfaceHandleForCompositing);
    573 #endif
    574553    if (!m_inUpdateBackingStoreState)
    575554        m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h

    r242346 r246308  
    7272#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    7373    RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
    74 #endif
    75 
    76 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    77     void setNativeSurfaceHandleForCompositing(uint64_t) override;
    78     void destroyNativeSurfaceHandleForCompositing(bool&) override;
    7974#endif
    8075
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp

    r246030 r246308  
    7272    float scaleFactor = m_webPage.deviceScaleFactor() * m_viewportController.pageScaleFactor();
    7373
    74     if (m_surface) {
    75         TextureMapper::PaintFlags paintFlags = 0;
    76 
    77         if (m_surface->shouldPaintMirrored())
    78             paintFlags |= TextureMapper::PaintingMirrored;
    79 
    80         m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor, ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags);
    81         m_layerTreeContext.contextID = m_surface->surfaceID();
    82     } else
    83         m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor);
     74    TextureMapper::PaintFlags paintFlags = 0;
     75    if (m_surface->shouldPaintMirrored())
     76        paintFlags |= TextureMapper::PaintingMirrored;
     77
     78    m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor, paintFlags);
     79    m_layerTreeContext.contextID = m_surface->surfaceID();
    8480
    8581    didChangeViewport();
     
    227223    }
    228224
    229     if (m_surface && m_surface->hostResize(size))
     225    if (m_surface->hostResize(size))
    230226        m_layerTreeContext.contextID = m_surface->surfaceID();
    231227
     
    336332}
    337333
    338 #if PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    339 void LayerTreeHost::setNativeSurfaceHandleForCompositing(uint64_t handle)
    340 {
    341     m_layerTreeContext.contextID = handle;
    342     m_compositor->setNativeSurfaceHandleForCompositing(handle);
    343     scheduleLayerFlush();
    344 }
    345 #endif
    346 
    347334void LayerTreeHost::deviceOrPageScaleFactorChanged()
    348335{
     
    352339    }
    353340
    354     if (m_surface && m_surface->hostResize(m_webPage.size()))
     341    if (m_surface->hostResize(m_webPage.size()))
    355342        m_layerTreeContext.contextID = m_surface->surfaceID();
    356343
     
    387374uint64_t LayerTreeHost::nativeSurfaceHandleForCompositing()
    388375{
    389     if (!m_surface)
    390         return m_layerTreeContext.contextID;
    391 
    392376    m_surface->initialize();
    393377    return m_surface->window();
     
    396380void LayerTreeHost::didDestroyGLContext()
    397381{
    398     if (m_surface)
    399         m_surface->finalize();
     382    m_surface->finalize();
    400383}
    401384
    402385void LayerTreeHost::willRenderFrame()
    403386{
    404     if (m_surface)
    405         m_surface->willRenderFrame();
     387    m_surface->willRenderFrame();
    406388}
    407389
    408390void LayerTreeHost::didRenderFrame()
    409391{
    410     if (m_surface)
    411         m_surface->didRenderFrame();
     392    m_surface->didRenderFrame();
    412393}
    413394
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h

    r243603 r246308  
    8787
    8888    void setIsDiscardable(bool);
    89 
    90 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK)
    91     void setNativeSurfaceHandleForCompositing(uint64_t);
    92 #endif
    9389
    9490    void deviceOrPageScaleFactorChanged();
  • trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h

    r244291 r246308  
    163163    WebPage& m_webPage;
    164164
    165 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    166     uint64_t m_nativeSurfaceHandleForCompositing { 0 };
    167 #endif
    168 
    169165private:
    170166    // IPC::MessageReceiver.
    171167    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
    172     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
    173168
    174169    // Message handlers.
     
    189184#endif
    190185
    191 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    192     virtual void setNativeSurfaceHandleForCompositing(uint64_t) = 0;
    193     virtual void destroyNativeSurfaceHandleForCompositing(bool&) = 0;
    194 #endif
    195 
    196186    bool m_hasRemovedMessageReceiver { false };
    197187};
  • trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in

    r239427 r246308  
    4040    AddTransactionCallbackID(WebKit::CallbackID callbackID)
    4141#endif
    42 
    43 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    44     SetNativeSurfaceHandleForCompositing(uint64_t handle)
    45     DestroyNativeSurfaceHandleForCompositing() -> (bool handled)
    46 #endif
    4742}
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r246142 r246308  
    973973#endif
    974974
    975 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
    976     uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
    977 #endif
    978 
    979975    bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
    980976
     
    16841680#endif
    16851681
    1686 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
    1687     // Our view's window in the UI process.
    1688     uint64_t m_nativeWindowHandle { 0 };
    1689 #endif
    1690 
    16911682#if !PLATFORM(IOS_FAMILY)
    16921683    RefPtr<PageBanner> m_headerBanner;
  • trunk/Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp

    r237410 r246308  
    2727#include "AcceleratedSurfaceX11.h"
    2828
    29 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     29#if PLATFORM(X11)
    3030
    3131#include "WebPage.h"
     
    157157} // namespace WebKit
    158158
    159 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
     159#endif // PLATFORM(X11)
  • trunk/Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h

    r237410 r246308  
    2626#pragma once
    2727
    28 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     28#if PLATFORM(X11)
    2929
    3030#include "AcceleratedSurface.h"
     
    6565} // namespace WebKit
    6666
    67 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)
     67#endif // PLATFORM(X11)
  • trunk/Source/cmake/OptionsGTK.cmake

    r246033 r246308  
    9191# Private options specific to the GTK+ port. Changing these options is
    9292# completely unsupported. They are intended for use only by WebKit developers.
    93 WEBKIT_OPTION_DEFINE(USE_REDIRECTED_XCOMPOSITE_WINDOW "Whether to use a Redirected XComposite Window for accelerated compositing in X11." PRIVATE ON)
    9493WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE OFF)
    9594
     
    103102WEBKIT_OPTION_DEPEND(ENABLE_PLUGIN_PROCESS_GTK2 ENABLE_X11_TARGET)
    104103WEBKIT_OPTION_DEPEND(ENABLE_WEBGL ENABLE_OPENGL)
    105 WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_OPENGL)
    106 WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_X11_TARGET)
    107104WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_OPENGL)
    108105WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_WAYLAND_TARGET)
Note: See TracChangeset for help on using the changeset viewer.