Changeset 246308 in webkit
- Timestamp:
- Jun 11, 2019, 4:17:31 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
-
ChangeLog (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (modified) (3 diffs)
-
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (modified) (3 diffs)
-
Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (modified) (7 diffs)
-
Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h (modified) (3 diffs)
-
Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp (modified) (3 diffs)
-
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp (modified) (6 diffs)
-
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/DrawingArea.h (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.h (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h (modified) (2 diffs)
-
Source/cmake/OptionsGTK.cmake (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r246285 r246308 1 2019-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 1 10 2019-06-10 Sam Weinig <weinig@apple.com> 2 11 -
trunk/Source/WebKit/ChangeLog
r246305 r246308 1 2019-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 1 65 2019-06-11 Michael Catanzaro <mcatanzaro@igalia.com> 2 66 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r245807 r246308 46 46 using namespace WebCore; 47 47 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)48 Ref<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 53 ThreadedCompositor::ThreadedCompositor(Client& client, ThreadedDisplayRefreshMonitor::Client& displayRefreshMonitorClient, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, TextureMapper::PaintFlags paintFlags) 54 54 : m_client(client) 55 , m_doFrameSync(doFrameSync)56 55 , m_paintFlags(paintFlags) 57 56 , m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); })) … … 89 88 90 89 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(); 99 92 } 100 93 … … 140 133 } 141 134 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 else154 m_context = nullptr;155 });156 }157 158 135 void ThreadedCompositor::setScaleFactor(float scale) 159 136 { -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
r243865 r246308 62 62 }; 63 63 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); 67 65 virtual ~ThreadedCompositor(); 68 66 69 void setNativeSurfaceHandleForCompositing(uint64_t);70 67 void setScaleFactor(float); 71 68 void setScrollPosition(const WebCore::IntPoint&, float scale); … … 88 85 89 86 private: 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); 91 88 92 89 // CoordinatedGraphicsSceneClient … … 103 100 104 101 uint64_t m_nativeSurfaceHandle; 105 ShouldDoFrameSync m_doFrameSync;106 102 WebCore::TextureMapper::PaintFlags m_paintFlags { 0 }; 107 103 bool m_inForceRepaint { false }; -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
r245807 r246308 426 426 gdk_window_set_user_data(window, widget); 427 427 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 #endif434 435 428 gtk_im_context_set_client_window(priv->inputMethodFilter.context(), window); 436 429 } … … 439 432 { 440 433 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 #endif447 434 gtk_im_context_set_client_window(webView->priv->inputMethodFilter.context(), nullptr); 448 435 … … 603 590 cairo_push_group(cr); 604 591 605 if ( webViewBase->priv->acceleratedBackingStore &&drawingArea->isInAcceleratedCompositingMode())592 if (drawingArea->isInAcceleratedCompositingMode()) 606 593 webViewBase->priv->acceleratedBackingStore->paint(cr, clipRect); 607 594 else { … … 1659 1646 void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext) 1660 1647 { 1661 if (webkitWebViewBase->priv->acceleratedBackingStore) 1662 webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext); 1648 webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext); 1663 1649 } 1664 1650 1665 1651 void webkitWebViewBaseUpdateAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext) 1666 1652 { 1667 if (webkitWebViewBase->priv->acceleratedBackingStore) 1668 webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext); 1653 webkitWebViewBase->priv->acceleratedBackingStore->update(layerTreeContext); 1669 1654 } 1670 1655 1671 1656 void webkitWebViewBaseExitAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase) 1672 1657 { 1673 if (webkitWebViewBase->priv->acceleratedBackingStore) 1674 webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext()); 1658 webkitWebViewBase->priv->acceleratedBackingStore->update(LayerTreeContext()); 1675 1659 } 1676 1660 1677 1661 bool webkitWebViewBaseMakeGLContextCurrent(WebKitWebViewBase* webkitWebViewBase) 1678 1662 { 1679 if (webkitWebViewBase->priv->acceleratedBackingStore) 1680 return webkitWebViewBase->priv->acceleratedBackingStore->makeContextCurrent(); 1681 return false; 1663 return webkitWebViewBase->priv->acceleratedBackingStore->makeContextCurrent(); 1682 1664 } 1683 1665 … … 1688 1670 1689 1671 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 #else1704 UNUSED_PARAM(webkitWebViewBase);1705 #endif1706 1707 1672 priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy); 1708 1673 priv->viewGestureController->setSwipeGestureEnabled(priv->isBackForwardNavigationGestureEnabled); … … 1711 1676 void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) 1712 1677 { 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()); 1727 1679 } 1728 1680 … … 1833 1785 int webkitWebViewBaseRenderHostFileDescriptor(WebKitWebViewBase* webkitWebViewBase) 1834 1786 { 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 182 182 if (m_nextBackingStoreStateID != m_currentBackingStoreStateID) 183 183 sendUpdateBackingStoreState(RespondImmediately); 184 else {184 else 185 185 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 #endif193 }194 186 195 187 #if !PLATFORM(WPE) … … 375 367 #endif 376 368 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 #endif397 398 369 DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor(WebPageProxy& webPage) 399 370 : m_timer(RunLoop::main(), this, &DrawingMonitor::stop) -
trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
r243505 r246308 49 49 50 50 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 #endif56 51 57 52 private: … … 131 126 bool m_hasReceivedFirstUpdate { false }; 132 127 133 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)134 uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };135 #endif136 137 128 #if !PLATFORM(WPE) 138 129 bool m_isBackingStoreDiscardable { true }; -
trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp
r242082 r246308 35 35 #endif 36 36 37 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)37 #if PLATFORM(X11) 38 38 #include "AcceleratedBackingStoreX11.h" 39 39 #endif … … 48 48 return AcceleratedBackingStoreWayland::create(webPage); 49 49 #endif 50 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)50 #if PLATFORM(X11) 51 51 if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) 52 52 return AcceleratedBackingStoreX11::create(webPage); 53 53 #endif 54 RELEASE_ASSERT_NOT_REACHED(); 54 55 return nullptr; 55 56 } -
trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
r242346 r246308 27 27 #include "AcceleratedBackingStoreX11.h" 28 28 29 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)29 #if PLATFORM(X11) 30 30 31 31 #include "DrawingAreaProxyCoordinatedGraphics.h" … … 203 203 } // namespace WebKit 204 204 205 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)205 #endif // PLATFORM(X11) -
trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h
r205116 r246308 28 28 #include "AcceleratedBackingStore.h" 29 29 30 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)30 #if PLATFORM(X11) 31 31 32 32 #include <WebCore/RefPtrCairo.h> … … 44 44 45 45 private: 46 AcceleratedBackingStoreX11(WebPageProxy&);46 explicit AcceleratedBackingStoreX11(WebPageProxy&); 47 47 48 48 void update(const LayerTreeContext&) override; … … 55 55 } // namespace WebKit 56 56 57 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)57 #endif // PLATFORM(X11) -
trunk/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp
r245807 r246308 30 30 #include <WebCore/PlatformDisplay.h> 31 31 32 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)32 #if PLATFORM(X11) 33 33 #include <WebCore/PlatformDisplayX11.h> 34 34 #endif … … 66 66 } 67 67 68 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)68 #if PLATFORM(X11) 69 69 if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) { 70 70 auto& display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()); -
trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp
r245807 r246308 34 34 #endif 35 35 36 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)36 #if PLATFORM(X11) 37 37 #include "AcceleratedSurfaceX11.h" 38 38 #endif … … 55 55 #endif 56 56 #endif 57 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)57 #if PLATFORM(X11) 58 58 if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) 59 59 return AcceleratedSurfaceX11::create(webPage, client); … … 63 63 return AcceleratedSurfaceLibWPE::create(webPage, client); 64 64 #endif 65 RELEASE_ASSERT_NOT_REACHED(); 65 66 return nullptr; 66 67 } -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
r246030 r246308 334 334 #endif 335 335 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 #endif352 353 336 void DrawingAreaCoordinatedGraphics::activityStateDidChange(OptionSet<ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&) 354 337 { … … 568 551 } 569 552 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 #endif574 553 if (!m_inUpdateBackingStoreState) 575 554 m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true); -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
r242346 r246308 72 72 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 73 73 RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override; 74 #endif75 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;79 74 #endif 80 75 -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
r246030 r246308 72 72 float scaleFactor = m_webPage.deviceScaleFactor() * m_viewportController.pageScaleFactor(); 73 73 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(); 84 80 85 81 didChangeViewport(); … … 227 223 } 228 224 229 if (m_surface && m_surface->hostResize(size))225 if (m_surface->hostResize(size)) 230 226 m_layerTreeContext.contextID = m_surface->surfaceID(); 231 227 … … 336 332 } 337 333 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 #endif346 347 334 void LayerTreeHost::deviceOrPageScaleFactorChanged() 348 335 { … … 352 339 } 353 340 354 if (m_surface && m_surface->hostResize(m_webPage.size()))341 if (m_surface->hostResize(m_webPage.size())) 355 342 m_layerTreeContext.contextID = m_surface->surfaceID(); 356 343 … … 387 374 uint64_t LayerTreeHost::nativeSurfaceHandleForCompositing() 388 375 { 389 if (!m_surface)390 return m_layerTreeContext.contextID;391 392 376 m_surface->initialize(); 393 377 return m_surface->window(); … … 396 380 void LayerTreeHost::didDestroyGLContext() 397 381 { 398 if (m_surface) 399 m_surface->finalize(); 382 m_surface->finalize(); 400 383 } 401 384 402 385 void LayerTreeHost::willRenderFrame() 403 386 { 404 if (m_surface) 405 m_surface->willRenderFrame(); 387 m_surface->willRenderFrame(); 406 388 } 407 389 408 390 void LayerTreeHost::didRenderFrame() 409 391 { 410 if (m_surface) 411 m_surface->didRenderFrame(); 392 m_surface->didRenderFrame(); 412 393 } 413 394 -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
r243603 r246308 87 87 88 88 void setIsDiscardable(bool); 89 90 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK)91 void setNativeSurfaceHandleForCompositing(uint64_t);92 #endif93 89 94 90 void deviceOrPageScaleFactorChanged(); -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h
r244291 r246308 163 163 WebPage& m_webPage; 164 164 165 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)166 uint64_t m_nativeSurfaceHandleForCompositing { 0 };167 #endif168 169 165 private: 170 166 // IPC::MessageReceiver. 171 167 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; 172 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;173 168 174 169 // Message handlers. … … 189 184 #endif 190 185 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 #endif195 196 186 bool m_hasRemovedMessageReceiver { false }; 197 187 }; -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
r239427 r246308 40 40 AddTransactionCallbackID(WebKit::CallbackID callbackID) 41 41 #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 #endif47 42 } -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r246142 r246308 973 973 #endif 974 974 975 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)976 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }977 #endif978 979 975 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&); 980 976 … … 1684 1680 #endif 1685 1681 1686 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)1687 // Our view's window in the UI process.1688 uint64_t m_nativeWindowHandle { 0 };1689 #endif1690 1691 1682 #if !PLATFORM(IOS_FAMILY) 1692 1683 RefPtr<PageBanner> m_headerBanner; -
trunk/Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp
r237410 r246308 27 27 #include "AcceleratedSurfaceX11.h" 28 28 29 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)29 #if PLATFORM(X11) 30 30 31 31 #include "WebPage.h" … … 157 157 } // namespace WebKit 158 158 159 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)159 #endif // PLATFORM(X11) -
trunk/Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h
r237410 r246308 26 26 #pragma once 27 27 28 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)28 #if PLATFORM(X11) 29 29 30 30 #include "AcceleratedSurface.h" … … 65 65 } // namespace WebKit 66 66 67 #endif // USE(REDIRECTED_XCOMPOSITE_WINDOW)67 #endif // PLATFORM(X11) -
trunk/Source/cmake/OptionsGTK.cmake
r246033 r246308 91 91 # Private options specific to the GTK+ port. Changing these options is 92 92 # 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)94 93 WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE OFF) 95 94 … … 103 102 WEBKIT_OPTION_DEPEND(ENABLE_PLUGIN_PROCESS_GTK2 ENABLE_X11_TARGET) 104 103 WEBKIT_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)107 104 WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_OPENGL) 108 105 WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_WAYLAND_TARGET)
Note:
See TracChangeset
for help on using the changeset viewer.