From ab213d694625a9f7eb183d63b24ccf2931456cfc Mon Sep 17 00:00:00 2001 From: "yoon@igalia.com" Date: Thu, 8 Jan 2015 04:29:24 +0000 Subject: [PATCH] [GTK][ThreadedCompositor] Add support for threaded compositor. https://bugs.webkit.org/show_bug.cgi?id=118265 Reviewed by Martin Robinson. .: Added the ENABLE_THREADED_COMPOSITOR feature flag to the cmake and autotools build systems. The feature is disabled by default. And remove deprecated the WTF_USE_TILED_BACKING_STORE feature flag from the feature flags. * Source/cmake/OptionsEfl.cmake: * Source/cmake/OptionsGTK.cmake: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: Source/WebCore: * PlatformGTK.cmake: Adds CoodinatedGraphics and threaded compositor related classes to support threaded compositor * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: * platform/graphics/texmap/coordinated/CoordinatedTile.h: This class should be guarded by COORDINATED_GRAPHICS instead of TILED_BACKING_STORE Source/WebKit2: This patch introduces a threaded compositor for WebKitGTK+. It is disabled as a default because it is a initial implementation. The threaded compositor can be enabled using --threaded-compositor option at compile time. No new tests, this is an experimental feature. * PlatformGTK.cmake: Adds CoodinatedGraphics and threaded compositor related classes to support threaded compositor * Shared/DrawingAreaInfo.h: Use DrawingAreaImpl for threaded compositor * UIProcess/API/gtk/WebKitSettings.cpp: (_WebKitSettingsPrivate::_WebKitSettingsPrivate): Modified to use forceCompositingMode when the threaded compositor used. If we does not set this mode here, it cannot draw the root content layer. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: Added. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: Added. (WebKit::ThreadedCoordinatedLayerTreeHost::rootLayer): Implements ThreadedCoordinatedLayerTreeHost to use the threaded compositor. It is basically similar with CoordinatedLayerTreeHost but it uses ThreadedCompositor instead of IPC. * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): (WebKit::DrawingArea::DrawingArea): * WebProcess/WebPage/DrawingArea.h: COORDINATED_GRAPHICS_MULTIPROCESS is introduced to classify IPC specific codes from Coordinated Graphics. And COORDINATED_GRAPHICS_THREADED is used to guard the threaded compositor specific codes. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): Modified to use forceCompositingMode when the threaded compositor used. If we does not set this mode here, it will crash because of PageOverlay. (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): (WebKit::DrawingAreaImpl::updateBackingStoreState): Modified to handle contents / viewport size changes for threaded compositor. (WebKit::DrawingAreaImpl::attachViewOverlayGraphicsLayer): Added to support Overlay layer in the threaded compositor. (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): Push the surface handle for compositing to the threaded compositor. * WebProcess/WebPage/DrawingAreaImpl.h: Use COORDINATED_GRAPIHCS_THREADED to guard the threaded compositor related codes. * WebProcess/WebPage/LayerTreeHost.cpp: Ditto. * WebProcess/WebPage/LayerTreeHost.h: Ditto. * WebProcess/WebPage/WebPage.cpp: Ditto. * WebProcess/WebPage/WebPage.h: Ditto. * WebProcess/WebPage/WebPage.messages.in: Ditto. * WebProcess/gtk/WebProcessMainGtk.cpp: Modified to call XInitThreads to use thread-safe xlib. Tools: Added the ENABLE_THREADED_COMPOSITOR feature flag to the cmake and autotools build systems. The feature is disabled by default. And remove deprecated the WTF_USE_TILED_BACKING_STORE feature flag from the feature flags. * Scripts/webkitperl/FeatureList.pm: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@178095 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- ChangeLog | 17 + Source/WebCore/ChangeLog | 16 + Source/WebCore/PlatformGTK.cmake | 25 ++ .../texmap/coordinated/CoordinatedTile.cpp | 4 +- .../texmap/coordinated/CoordinatedTile.h | 4 +- Source/WebKit2/ChangeLog | 72 +++++ Source/WebKit2/PlatformGTK.cmake | 22 +- Source/WebKit2/Shared/DrawingAreaInfo.h | 2 +- .../UIProcess/API/gtk/WebKitSettings.cpp | 4 + .../CoordinatedLayerTreeHostProxy.h | 4 +- Source/WebKit2/UIProcess/PageClient.h | 4 +- Source/WebKit2/UIProcess/WebPageProxy.cpp | 8 +- Source/WebKit2/UIProcess/WebPageProxy.h | 10 +- .../UIProcess/WebPageProxy.messages.in | 7 +- .../WebCoreSupport/WebChromeClient.cpp | 2 + .../CoordinatedDrawingArea.cpp | 2 + .../CoordinatedDrawingArea.h | 2 + .../ThreadedCoordinatedLayerTreeHost.cpp | 300 ++++++++++++++++++ .../ThreadedCoordinatedLayerTreeHost.h | 157 +++++++++ .../WebProcess/WebPage/DrawingArea.cpp | 7 +- .../WebKit2/WebProcess/WebPage/DrawingArea.h | 2 +- .../WebProcess/WebPage/DrawingAreaImpl.cpp | 46 +++ .../WebProcess/WebPage/DrawingAreaImpl.h | 3 + .../WebProcess/WebPage/LayerTreeHost.cpp | 12 +- .../WebProcess/WebPage/LayerTreeHost.h | 11 +- Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 21 +- Source/WebKit2/WebProcess/WebPage/WebPage.h | 4 +- .../WebProcess/WebPage/WebPage.messages.in | 4 +- .../WebProcess/gtk/WebProcessMainGtk.cpp | 7 + Source/cmake/OptionsEfl.cmake | 3 +- Source/cmake/OptionsGTK.cmake | 8 +- Source/cmake/WebKitFeatures.cmake | 2 +- Source/cmakeconfig.h.cmake | 1 - Tools/ChangeLog | 14 + Tools/Scripts/webkitperl/FeatureList.pm | 5 +- 35 files changed, 760 insertions(+), 52 deletions(-) create mode 100644 Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp create mode 100644 Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h diff --git a/ChangeLog b/ChangeLog index d6a1453fdb9ad..a885f35fcd6db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2015-01-07 Gwang Yoon Hwang + + [GTK][ThreadedCompositor] Add support for threaded compositor. + https://bugs.webkit.org/show_bug.cgi?id=118265 + + Reviewed by Martin Robinson. + + Added the ENABLE_THREADED_COMPOSITOR feature flag to the cmake and + autotools build systems. The feature is disabled by default. + And remove deprecated the WTF_USE_TILED_BACKING_STORE feature flag + from the feature flags. + + * Source/cmake/OptionsEfl.cmake: + * Source/cmake/OptionsGTK.cmake: + * Source/cmake/WebKitFeatures.cmake: + * Source/cmakeconfig.h.cmake: + 2014-12-23 Alexey Proskuryakov Simplify building with ASan diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index b87a41a6521a4..3f61f583f3ee7 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2015-01-07 Gwang Yoon Hwang + + [GTK][ThreadedCompositor] Add support for threaded compositor. + https://bugs.webkit.org/show_bug.cgi?id=118265 + + Reviewed by Martin Robinson. + + * PlatformGTK.cmake: + Adds CoodinatedGraphics and threaded compositor related classes to + support threaded compositor + + * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: + * platform/graphics/texmap/coordinated/CoordinatedTile.h: + This class should be guarded by COORDINATED_GRAPHICS instead of + TILED_BACKING_STORE + 2015-01-07 Daniel Bates [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT diff --git a/Source/WebCore/PlatformGTK.cmake b/Source/WebCore/PlatformGTK.cmake index f2f64efab89f6..ed95299863392 100644 --- a/Source/WebCore/PlatformGTK.cmake +++ b/Source/WebCore/PlatformGTK.cmake @@ -374,6 +374,31 @@ if (ENABLE_TEXTURE_MAPPER) ) endif () +if (ENABLE_THREADED_COMPOSITOR) + list(APPEND WebCore_INCLUDE_DIRECTORIES + "${WEBCORE_DIR}/page/scrolling/coordinatedgraphics" + "${WEBCORE_DIR}/platform/graphics/texmap/coordinated" + "${WEBCORE_DIR}/platform/graphics/texmap/threadedcompositor" + ) + list(APPEND WebCore_SOURCES + page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp + page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp + page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp + page/scrolling/ScrollingStateStickyNode.cpp + page/scrolling/ScrollingThread.cpp + page/scrolling/ScrollingTreeNode.cpp + page/scrolling/ScrollingTreeScrollingNode.cpp + platform/graphics/TiledBackingStore.cpp + platform/graphics/texmap/coordinated/AreaAllocator.cpp + platform/graphics/texmap/coordinated/CompositingCoordinator.cpp + platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp + platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp + platform/graphics/texmap/coordinated/CoordinatedSurface.cpp + platform/graphics/texmap/coordinated/CoordinatedTile.cpp + platform/graphics/texmap/coordinated/UpdateAtlas.cpp + ) +endif () + if (WTF_USE_EGL) list(APPEND WebCore_LIBRARIES ${EGL_LIBRARY} diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.cpp index b24f48d236191..dd32c23491973 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.cpp +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.cpp @@ -26,7 +26,7 @@ #include "config.h" #include "CoordinatedTile.h" -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS) #include "GraphicsContext.h" #include "ImageBuffer.h" @@ -141,4 +141,4 @@ void CoordinatedTileBackend::paintCheckerPattern(GraphicsContext*, const FloatRe } // namespace WebCore -#endif // USE(TILED_BACKING_STORE) +#endif // USE(COORDINATED_GRAPHICS) diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h index d845ce5df5831..b79709f3ba64c 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h @@ -26,7 +26,7 @@ #ifndef CoordinatedTile_h #define CoordinatedTile_h -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS) #include "CoordinatedSurface.h" #include "IntRect.h" @@ -91,6 +91,6 @@ class CoordinatedTileBackend : public TiledBackingStoreBackend { } // namespace WebCore -#endif // USE(TILED_BACKING_STORE) +#endif // USE(COORDINATED_GRAPHICS) #endif // CoordinatedTile_h diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 0974502dfded8..4b3df27125cba 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,75 @@ +2015-01-07 Gwang Yoon Hwang + + [GTK][ThreadedCompositor] Add support for threaded compositor. + https://bugs.webkit.org/show_bug.cgi?id=118265 + + Reviewed by Martin Robinson. + + This patch introduces a threaded compositor for WebKitGTK+. + It is disabled as a default because it is a initial implementation. + The threaded compositor can be enabled using --threaded-compositor + option at compile time. + + No new tests, this is an experimental feature. + + * PlatformGTK.cmake: + Adds CoodinatedGraphics and threaded compositor related classes to + support threaded compositor + + * Shared/DrawingAreaInfo.h: + Use DrawingAreaImpl for threaded compositor + + * UIProcess/API/gtk/WebKitSettings.cpp: + (_WebKitSettingsPrivate::_WebKitSettingsPrivate): + Modified to use forceCompositingMode when the threaded compositor used. + If we does not set this mode here, it cannot draw the root content layer. + + * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: Added. + * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: Added. + (WebKit::ThreadedCoordinatedLayerTreeHost::rootLayer): + Implements ThreadedCoordinatedLayerTreeHost to use the threaded + compositor. It is basically similar with CoordinatedLayerTreeHost but it uses ThreadedCompositor instead of IPC. + + * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::contentsSizeChanged): + * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: + * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: + * WebProcess/WebPage/DrawingArea.cpp: + (WebKit::DrawingArea::create): + (WebKit::DrawingArea::DrawingArea): + * WebProcess/WebPage/DrawingArea.h: + COORDINATED_GRAPHICS_MULTIPROCESS is introduced to classify IPC specific codes + from Coordinated Graphics. + And COORDINATED_GRAPHICS_THREADED is used to guard the threaded + compositor specific codes. + + * WebProcess/WebPage/DrawingAreaImpl.cpp: + (WebKit::DrawingAreaImpl::DrawingAreaImpl): + Modified to use forceCompositingMode when the threaded compositor used. + If we does not set this mode here, it will crash because of PageOverlay. + (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): + (WebKit::DrawingAreaImpl::updateBackingStoreState): + Modified to handle contents / viewport size changes for threaded compositor. + (WebKit::DrawingAreaImpl::attachViewOverlayGraphicsLayer): + Added to support Overlay layer in the threaded compositor. + (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): + Push the surface handle for compositing to the threaded compositor. + + * WebProcess/WebPage/DrawingAreaImpl.h: Use COORDINATED_GRAPIHCS_THREADED to guard the threaded compositor related codes. + * WebProcess/WebPage/LayerTreeHost.cpp: Ditto. + * WebProcess/WebPage/LayerTreeHost.h: Ditto. + * WebProcess/WebPage/WebPage.cpp: Ditto. + * WebProcess/WebPage/WebPage.h: Ditto. + * WebProcess/WebPage/WebPage.messages.in: Ditto. + + * WebProcess/gtk/WebProcessMainGtk.cpp: + Modified to call XInitThreads to use thread-safe xlib. + 2015-01-07 Daniel Bates [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake index b86205c60355c..babe27d7e9479 100644 --- a/Source/WebKit2/PlatformGTK.cmake +++ b/Source/WebKit2/PlatformGTK.cmake @@ -311,7 +311,6 @@ list(APPEND WebKit2_SOURCES WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp - WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp WebProcess/WebPage/gtk/PrinterListGtk.cpp WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp WebProcess/WebPage/gtk/WebPageGtk.cpp @@ -742,6 +741,27 @@ list(APPEND PluginProcess_SOURCES PluginProcess/EntryPoint/unix/PluginProcessMain.cpp ) +if (ENABLE_THREADED_COMPOSITOR) + list(APPEND WebKit2_SOURCES + Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp + Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp + Shared/CoordinatedGraphics/SimpleViewportController.cpp + Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp + Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp + WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp + ) + list(APPEND WebKit2_INCLUDE_DIRECTORIES + "${WEBCORE_DIR}/platform/graphics/texmap/coordinated" + "${WEBKIT2_DIR}/Shared/CoordinatedGraphics" + "${WEBKIT2_DIR}/Shared/CoordinatedGraphics/threadedcompositor" + "${WEBKIT2_DIR}/WebProcess/WebPage/CoordinatedGraphics" + ) +else (ENABLE_THREADED_COMPOSITOR) + list(APPEND WebKit2_SOURCES + WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp + ) +endif () + # Commands for building the built-in injected bundle. include_directories( "${WEBKIT2_DIR}/Platform" diff --git a/Source/WebKit2/Shared/DrawingAreaInfo.h b/Source/WebKit2/Shared/DrawingAreaInfo.h index 86877aa6cde4d..1b6da52e4d4bb 100644 --- a/Source/WebKit2/Shared/DrawingAreaInfo.h +++ b/Source/WebKit2/Shared/DrawingAreaInfo.h @@ -35,7 +35,7 @@ enum DrawingAreaType { #endif DrawingAreaTypeRemoteLayerTree, #else -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) DrawingAreaTypeCoordinated #else DrawingAreaTypeImpl, diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp index d969c5b8d8560..76f3b735d7fca 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp @@ -54,6 +54,10 @@ struct _WebKitSettingsPrivate { fantasyFontFamily = preferences->fantasyFontFamily().utf8(); pictographFontFamily = preferences->pictographFontFamily().utf8(); defaultCharset = preferences->defaultTextEncodingName().utf8(); + +#if USE(COORDINATED_GRAPHICS_THREADED) + preferences->setForceCompositingMode(true); +#endif } RefPtr preferences; diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h index d69fa17b184f6..0465b69ff9451 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h @@ -21,7 +21,7 @@ #ifndef CoordinatedLayerTreeHostProxy_h #define CoordinatedLayerTreeHostProxy_h -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) #include "CoordinatedGraphicsArgumentCoders.h" #include "CoordinatedGraphicsScene.h" @@ -69,6 +69,6 @@ class CoordinatedLayerTreeHostProxy : public CoordinatedGraphicsSceneClient, pub } // namespace WebKit -#endif // USE(COORDINATED_GRAPHICS) +#endif // USE(COORDINATED_GRAPHICS_MULTIPROCESS) #endif // CoordinatedLayerTreeHostProxy_h diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h index 67cb27e348a0d..bd1827b67417a 100644 --- a/Source/WebKit2/UIProcess/PageClient.h +++ b/Source/WebKit2/UIProcess/PageClient.h @@ -138,12 +138,10 @@ class PageClient { virtual void didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) = 0; -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) virtual void pageDidRequestScroll(const WebCore::IntPoint&) = 0; virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) = 0; virtual void pageTransitionViewportReady() = 0; -#endif -#if USE(COORDINATED_GRAPHICS) virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0; #endif diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp index bbb8b94ef76ca..f1d217073e7fc 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp @@ -109,7 +109,7 @@ #include "RemoteScrollingCoordinatorProxy.h" #endif -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) #include "CoordinatedLayerTreeHostProxyMessages.h" #endif @@ -1372,7 +1372,7 @@ void WebPageProxy::didCommitLayerTree(const RemoteLayerTreeTransaction&) } #endif -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void WebPageProxy::commitPageTransitionViewport() { if (!isValid()) @@ -3280,7 +3280,7 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t f shouldClose = m_uiClient->runBeforeUnloadConfirmPanel(this, message, frame); } -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void WebPageProxy::pageDidRequestScroll(const IntPoint& point) { m_pageClient.pageDidRequestScroll(point); @@ -3396,7 +3396,7 @@ void WebPageProxy::handleDownloadRequest(DownloadProxy* download) m_pageClient.handleDownloadRequest(download); } -#if PLATFORM(EFL) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void WebPageProxy::didChangeContentSize(const IntSize& size) { m_pageClient.didChangeContentSize(size); diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index ede33224276f0..f39e68a3b7a35 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -475,7 +475,7 @@ class WebPageProxy : public API::ObjectImpl void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&); -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect); #endif #if PLATFORM(EFL) @@ -547,7 +547,7 @@ class WebPageProxy : public API::ObjectImpl #if PLATFORM(GTK) PlatformWidget viewWidget(); #endif -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void commitPageTransitionViewport(); #endif @@ -1107,14 +1107,10 @@ class WebPageProxy : public API::ObjectImpl void clearNotifications(const Vector& notificationIDs); void didDestroyNotification(uint64_t notificationID); -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void pageDidRequestScroll(const WebCore::IntPoint&); void pageTransitionViewportReady(); -#endif -#if USE(COORDINATED_GRAPHICS) void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&); -#endif -#if PLATFORM(EFL) void didChangeContentSize(const WebCore::IntSize&); #endif diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in index 38a524ec68755..bf9ddae6ae0bb 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in @@ -95,15 +95,10 @@ messages -> WebPageProxy { HandleInputMethodKeydown() -> (bool handled) #endif -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) PageDidRequestScroll(WebCore::IntPoint point) PageTransitionViewportReady() -#endif -#if USE(COORDINATED_GRAPHICS) DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area) -#endif - -#if PLATFORM(EFL) DidChangeContentSize(WebCore::IntSize newSize) #endif diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp index 4d54bac06ddf8..e39dc4a1e7029 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp @@ -520,7 +520,9 @@ void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) con #if USE(COORDINATED_GRAPHICS) if (m_page->useFixedLayout()) m_page->drawingArea()->layerTreeHost()->sizeDidChange(size); +#endif +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) m_page->send(Messages::WebPageProxy::DidChangeContentSize(size)); #endif diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp index 7f3e1ecf3b598..8b92f39d98547 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp @@ -600,11 +600,13 @@ void CoordinatedDrawingArea::display(UpdateInfo& updateInfo) m_displayTimer.stop(); } +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void CoordinatedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder) { if (m_layerTreeHost) m_layerTreeHost->didReceiveCoordinatedLayerTreeHostMessage(connection, decoder); } +#endif void CoordinatedDrawingArea::attachViewOverlayGraphicsLayer(WebCore::Frame* frame, WebCore::GraphicsLayer* viewOverlayRootLayer) { diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h index cc63957246fad..14d2b56d52454 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h @@ -64,7 +64,9 @@ class CoordinatedDrawingArea : public DrawingArea { virtual void scheduleCompositingLayerFlush() override; virtual void scheduleCompositingLayerFlushImmediately() override; +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&, IPC::MessageDecoder&); +#endif virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override; diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp new file mode 100644 index 0000000000000..04419f1498993 --- /dev/null +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp @@ -0,0 +1,300 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2012 Company 100, Inc. + * Copyright (C) 2014 Igalia S.L. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "ThreadedCoordinatedLayerTreeHost.h" + +#if USE(COORDINATED_GRAPHICS_THREADED) + +#include "DrawingAreaImpl.h" +#include "NotImplemented.h" +#include "ThreadSafeCoordinatedSurface.h" +#include "WebPage.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace WebCore; + +namespace WebKit { + +PassRefPtr ThreadedCoordinatedLayerTreeHost::create(WebPage* webPage) +{ + return adoptRef(new ThreadedCoordinatedLayerTreeHost(webPage)); +} + +ThreadedCoordinatedLayerTreeHost::~ThreadedCoordinatedLayerTreeHost() +{ +} + +ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost(WebPage* webPage) + : LayerTreeHost(webPage) + , m_forceRepaintAsyncCallbackID(0) + , m_contentLayer(nullptr) + , m_viewOverlayRootLayer(nullptr) + , m_notifyAfterScheduledLayerFlush(false) + , m_isSuspended(false) + , m_isWaitingForRenderer(false) + , m_layerFlushTimer(RunLoop::main(), this, &ThreadedCoordinatedLayerTreeHost::performScheduledLayerFlush) + , m_layerFlushSchedulingEnabled(true) +{ + m_coordinator = std::make_unique(m_webPage->corePage(), this); + + m_coordinator->createRootLayer(m_webPage->size()); + + CoordinatedSurface::setFactory(createCoordinatedSurface); + + m_compositor = ThreadedCompositor::create(this); + scheduleLayerFlush(); +} + +PassRefPtr ThreadedCoordinatedLayerTreeHost::createCoordinatedSurface(const IntSize& size, CoordinatedSurface::Flags flags) +{ + return ThreadSafeCoordinatedSurface::create(size, flags); +} + +void ThreadedCoordinatedLayerTreeHost::scheduleLayerFlush() +{ + if (!m_layerFlushSchedulingEnabled) + return; + + if (!m_layerFlushTimer.isActive()) + m_layerFlushTimer.startOneShot(0); +} + +void ThreadedCoordinatedLayerTreeHost::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled) +{ + if (m_layerFlushSchedulingEnabled == layerFlushingEnabled) + return; + + m_layerFlushSchedulingEnabled = layerFlushingEnabled; + + if (m_layerFlushSchedulingEnabled) { + scheduleLayerFlush(); + return; + } + + cancelPendingLayerFlush(); +} + +void ThreadedCoordinatedLayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush) +{ + m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush; +} + +void ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer) +{ + m_contentLayer = graphicsLayer; + updateRootLayers(); +} + +void ThreadedCoordinatedLayerTreeHost::invalidate() +{ + notImplemented(); +} + +void ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect& rect) +{ + m_compositor->scrollTo(rect.location()); + scheduleLayerFlush(); +} + +void ThreadedCoordinatedLayerTreeHost::forceRepaint() +{ + notImplemented(); +} + +bool ThreadedCoordinatedLayerTreeHost::forceRepaintAsync(uint64_t callbackID) +{ + // We expect the UI process to not require a new repaint until the previous one has finished. + ASSERT(!m_forceRepaintAsyncCallbackID); + m_forceRepaintAsyncCallbackID = callbackID; + scheduleLayerFlush(); + return true; +} + +void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize& newSize) +{ + m_coordinator->sizeDidChange(newSize); + m_compositor->didChangeContentsSize(newSize); +} + +void ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged() +{ + m_coordinator->deviceOrPageScaleFactorChanged(); +} + +void ThreadedCoordinatedLayerTreeHost::pauseRendering() +{ + m_isSuspended = true; +} + +void ThreadedCoordinatedLayerTreeHost::resumeRendering() +{ + m_isSuspended = false; + scheduleLayerFlush(); +} + +GraphicsLayerFactory* ThreadedCoordinatedLayerTreeHost::graphicsLayerFactory() +{ + return m_coordinator.get(); +} + +void ThreadedCoordinatedLayerTreeHost::viewportSizeChanged(const WebCore::IntSize& size) +{ + m_compositor->didChangeViewportSize(size); +} + +void ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties(const WebCore::ViewportAttributes& attr) +{ + m_compositor->didChangeViewportAttribute(attr); +} + +void ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers() +{ + static_cast(m_webPage->drawingArea())->layerHostDidFlushLayers(); +} + +void ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged(float scale, const IntPoint& origin) +{ + m_webPage->scalePage(scale, origin); +} + +void ThreadedCoordinatedLayerTreeHost::updateRootLayers() +{ + if (!m_contentLayer && !m_viewOverlayRootLayer) + return; + + m_coordinator->setRootCompositingLayer(m_contentLayer, m_viewOverlayRootLayer); +} + +void ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer) +{ + m_viewOverlayRootLayer = viewOverlayRootLayer; + updateRootLayers(); +} + +#if PLATFORM(GTK) +void ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing(uint64_t handle) +{ + m_layerTreeContext.contextID = handle; + m_compositor->setNativeSurfaceHandleForCompositing(handle); +} +#endif + +#if ENABLE(REQUEST_ANIMATION_FRAME) +void ThreadedCoordinatedLayerTreeHost::scheduleAnimation() +{ + if (m_isWaitingForRenderer) + return; + + if (m_layerFlushTimer.isActive()) + return; + + m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime()); + scheduleLayerFlush(); +} +#endif + +void ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector, float scale) +{ + m_coordinator->setVisibleContentsRect(rect, trajectoryVector); + if (m_lastScrollPosition != roundedIntPoint(rect.location())) { + m_lastScrollPosition = roundedIntPoint(rect.location()); + + if (!m_webPage->corePage()->mainFrame().view()->useFixedLayout()) + m_webPage->corePage()->mainFrame().view()->notifyScrollPositionChanged(m_lastScrollPosition); + } + + if (m_lastScaleFactor != scale) { + m_lastScaleFactor = scale; + didScaleFactorChanged(m_lastScaleFactor, m_lastScrollPosition); + } + + scheduleLayerFlush(); +} + +void ThreadedCoordinatedLayerTreeHost::cancelPendingLayerFlush() +{ + m_layerFlushTimer.stop(); +} + +void ThreadedCoordinatedLayerTreeHost::performScheduledLayerFlush() +{ + if (m_isSuspended || m_isWaitingForRenderer) + return; + + m_coordinator->syncDisplayState(); + bool didSync = m_coordinator->flushPendingLayerChanges(); + + if (m_notifyAfterScheduledLayerFlush && didSync) { + compositorDidFlushLayers(); + m_notifyAfterScheduledLayerFlush = false; + } +} + +void ThreadedCoordinatedLayerTreeHost::purgeBackingStores() +{ + m_coordinator->purgeBackingStores(); +} + +void ThreadedCoordinatedLayerTreeHost::renderNextFrame() +{ + m_isWaitingForRenderer = false; + m_coordinator->renderNextFrame(); + scheduleLayerFlush(); +} + +void ThreadedCoordinatedLayerTreeHost::commitScrollOffset(uint32_t layerID, const IntSize& offset) +{ + m_coordinator->commitScrollOffset(layerID, offset); +} + +void ThreadedCoordinatedLayerTreeHost::notifyFlushRequired() +{ + scheduleLayerFlush(); +} + +void ThreadedCoordinatedLayerTreeHost::commitSceneState(const CoordinatedGraphicsState& state) +{ + m_isWaitingForRenderer = true; + m_compositor->updateSceneState(state); +} + +void ThreadedCoordinatedLayerTreeHost::paintLayerContents(const GraphicsLayer*, GraphicsContext&, const IntRect&) +{ +} + +} // namespace WebKit + +#endif // USE(COORDINATED_GRAPHICS) diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h new file mode 100644 index 0000000000000..66258938801bd --- /dev/null +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2013 Company 100, Inc. + * Copyright (C) 2014 Igalia S.L. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ThreadedCoordinatedLayerTreeHost_h +#define ThreadedCoordinatedLayerTreeHost_h + +#if USE(COORDINATED_GRAPHICS_THREADED) + +#include "LayerTreeContext.h" +#include "LayerTreeHost.h" +#include "ThreadedCompositor.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace WebCore { +class CoordinatedGraphicsLayerState; +class CoordinatedGraphicsState; +class CoordinatedSurface; +class GraphicsContext; +class GraphicsLayer; +class GraphicsLayerFactory; +class GraphicsLayerFactory; +} + +namespace WebKit { + +class WebPage; + +class ThreadedCoordinatedLayerTreeHost : public LayerTreeHost, public WebCore::CompositingCoordinator::Client, public ThreadedCompositor::Client { + WTF_MAKE_NONCOPYABLE(ThreadedCoordinatedLayerTreeHost); WTF_MAKE_FAST_ALLOCATED; +public: + static PassRefPtr create(WebPage*); + virtual ~ThreadedCoordinatedLayerTreeHost(); + + virtual const LayerTreeContext& layerTreeContext() override { return m_layerTreeContext; }; + + virtual void scheduleLayerFlush() override; + virtual void setLayerFlushSchedulingEnabled(bool) override; + virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool) override; + virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) override; + virtual void invalidate() override; + + virtual void setNonCompositedContentsNeedDisplay() override { }; + virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) override { }; + virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) override; + virtual void forceRepaint() override; + virtual bool forceRepaintAsync(uint64_t /*callbackID*/) override; + virtual void sizeDidChange(const WebCore::IntSize& newSize) override; + virtual void deviceOrPageScaleFactorChanged() override; + + virtual void pauseRendering() override; + virtual void resumeRendering() override; + + virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() override; + virtual void pageBackgroundTransparencyChanged() override { }; + + virtual void viewportSizeChanged(const WebCore::IntSize&) override; + virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) override; + +#if PLATFORM(GTK) + virtual void setNativeSurfaceHandleForCompositing(uint64_t) override; +#endif + +#if ENABLE(REQUEST_ANIMATION_FRAME) + virtual void scheduleAnimation() override; +#endif + + void setViewOverlayRootLayer(WebCore::GraphicsLayer*); + static PassRefPtr createCoordinatedSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags); + +protected: + explicit ThreadedCoordinatedLayerTreeHost(WebPage*); + +private: + + void compositorDidFlushLayers(); + void didScaleFactorChanged(float scale, const WebCore::IntPoint& origin); + + void updateRootLayers(); + + void cancelPendingLayerFlush(); + void performScheduledLayerFlush(); + + WebCore::GraphicsLayer* rootLayer() { return m_coordinator->rootLayer(); } + + // ThreadedCompositor::Client + virtual void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&, float) override; + virtual void purgeBackingStores() override; + virtual void renderNextFrame() override; + virtual void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset) override; + + // CompositingCoordinator::Client + virtual void didFlushRootLayer(const WebCore::FloatRect&) override { } + virtual void notifyFlushRequired() override; + virtual void commitSceneState(const WebCore::CoordinatedGraphicsState&) override; + virtual void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::IntRect& clipRect) override; + + LayerTreeContext m_layerTreeContext; + uint64_t m_forceRepaintAsyncCallbackID; + + WebCore::IntPoint m_prevScrollPosition; + + WebCore::GraphicsLayer* m_contentLayer; + WebCore::GraphicsLayer* m_viewOverlayRootLayer; + + std::unique_ptr m_coordinator; + RefPtr m_compositor; + + bool m_notifyAfterScheduledLayerFlush; + bool m_isSuspended; + bool m_isWaitingForRenderer; + + float m_lastScaleFactor; + WebCore::IntPoint m_lastScrollPosition; + + RunLoop::Timer m_layerFlushTimer; + bool m_layerFlushSchedulingEnabled; +}; + +} // namespace WebKit + +#endif // USE(COORDINATED_GRAPHICS_THREADED) + +#endif // ThreadedCoordinatedLayerTreeHost_h diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp index 6ecd72607e0af..e6ced9e23521e 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp +++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp @@ -39,7 +39,7 @@ #include "RemoteLayerTreeDrawingArea.h" #include "TiledCoreAnimationDrawingArea.h" #else -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) #include "CoordinatedDrawingArea.h" #else #include "DrawingAreaImpl.h" @@ -61,7 +61,7 @@ std::unique_ptr DrawingArea::create(WebPage& webPage, const WebPage case DrawingAreaTypeRemoteLayerTree: return std::make_unique(webPage, parameters); #else -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) case DrawingAreaTypeCoordinated: return std::make_unique(webPage, parameters); #else @@ -77,6 +77,9 @@ std::unique_ptr DrawingArea::create(WebPage& webPage, const WebPage DrawingArea::DrawingArea(DrawingAreaType type, WebPage& webPage) : m_type(type) , m_webPage(webPage) +#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) + , m_nativeSurfaceHandleForCompositing(0) +#endif { WebProcess::shared().addMessageReceiver(Messages::DrawingArea::messageReceiverName(), m_webPage.pageID(), *this); } diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h index eaa85ea4c8020..e453869560954 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h +++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h @@ -109,7 +109,7 @@ class DrawingArea : public IPC::MessageReceiver { virtual PassRefPtr createDisplayRefreshMonitor(PlatformDisplayID); #endif -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&, IPC::MessageDecoder&) = 0; #endif diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp index a772bfb0d1872..f71182ccf72dc 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp @@ -35,9 +35,14 @@ #include "WebPreferencesKeys.h" #include "WebProcess.h" #include +#include #include #include +#if USE(COORDINATED_GRAPHICS_THREADED) +#include "ThreadedCoordinatedLayerTreeHost.h" +#endif + using namespace WebCore; namespace WebKit { @@ -63,6 +68,11 @@ DrawingAreaImpl::DrawingAreaImpl(WebPage& webPage, const WebPageCreationParamete , m_displayTimer(RunLoop::main(), this, &DrawingAreaImpl::displayTimerFired) , m_exitCompositingTimer(RunLoop::main(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode) { + +#if USE(COORDINATED_GRAPHICS_THREADED) + webPage.corePage()->settings().setForceCompositingMode(true); +#endif + if (webPage.corePage()->settings().acceleratedDrawingEnabled() || webPage.corePage()->settings().forceCompositingMode()) m_alwaysUseCompositing = true; @@ -220,6 +230,16 @@ void DrawingAreaImpl::setPaintingEnabled(bool paintingEnabled) m_isPaintingEnabled = paintingEnabled; } +void DrawingAreaImpl::mainFrameContentSizeChanged(const WebCore::IntSize& newSize) +{ +#if USE(COORDINATED_GRAPHICS_THREADED) + if (m_layerTreeHost) + m_layerTreeHost->sizeDidChange(newSize); +#else + UNUSED_PARAM(newSize); +#endif +} + void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store) { m_webPage.corePage()->settings().setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey())); @@ -322,7 +342,11 @@ void DrawingAreaImpl::updateBackingStoreState(uint64_t stateID, bool respondImme m_webPage.scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset); if (m_layerTreeHost) { +#if USE(COORDINATED_GRAPHICS_THREADED) + m_layerTreeHost->viewportSizeChanged(m_webPage.size()); +#else m_layerTreeHost->sizeDidChange(m_webPage.size()); +#endif } else m_dirtyRegion = m_webPage.bounds(); } else { @@ -643,10 +667,32 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo) m_displayTimer.stop(); } +void DrawingAreaImpl::attachViewOverlayGraphicsLayer(WebCore::Frame* frame, WebCore::GraphicsLayer* viewOverlayRootLayer) +{ +#if USE(COORDINATED_GRAPHICS_THREADED) + if (!frame->isMainFrame()) + return; + + if (!m_layerTreeHost) + return; + + ThreadedCoordinatedLayerTreeHost* coordinatedLayerTreeHost = static_cast(m_layerTreeHost.get()); + coordinatedLayerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer); +#else + UNUSED_PARAM(frame); + UNUSED_PARAM(viewOverlayRootLayer); +#endif +} + #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) void DrawingAreaImpl::setNativeSurfaceHandleForCompositing(uint64_t handle) { m_nativeSurfaceHandleForCompositing = handle; + +#if USE(COORDINATED_GRAPHICS_THREADED) + if (m_layerTreeHost) + m_layerTreeHost->setNativeSurfaceHandleForCompositing(handle); +#endif } #endif diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h index a0a68aa35081e..0fbfa7aa31790 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h @@ -60,6 +60,7 @@ class DrawingAreaImpl : public DrawingArea { virtual bool forceRepaintAsync(uint64_t callbackID); virtual void setPaintingEnabled(bool); + virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) override; virtual void updatePreferences(const WebPreferencesStore&) override; virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() override; @@ -67,6 +68,8 @@ class DrawingAreaImpl : public DrawingArea { virtual void scheduleCompositingLayerFlush() override; virtual void scheduleCompositingLayerFlushImmediately() override; + virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*); + #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) virtual void setNativeSurfaceHandleForCompositing(uint64_t) override; #endif diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp index 593a1ca45d638..0f7c22ec01979 100644 --- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp +++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp @@ -26,11 +26,11 @@ #include "config.h" #include "LayerTreeHost.h" -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) #include "CoordinatedLayerTreeHost.h" -#endif - -#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) +#elif USE(COORDINATED_GRAPHICS_THREADED) +#include "ThreadedCoordinatedLayerTreeHost.h" +#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) #include "LayerTreeHostGtk.h" #endif @@ -40,8 +40,10 @@ namespace WebKit { PassRefPtr LayerTreeHost::create(WebPage* webPage) { -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) return CoordinatedLayerTreeHost::create(webPage); +#elif USE(COORDINATED_GRAPHICS_THREADED) + return ThreadedCoordinatedLayerTreeHost::create(webPage); #elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) return LayerTreeHostGtk::create(webPage); #else diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h index f9e1591ed0d23..810b05a232c5d 100644 --- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h +++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h @@ -43,6 +43,9 @@ class IntRect; class IntSize; class GraphicsLayer; class GraphicsLayerFactory; +#if USE(COORDINATED_GRAPHICS_THREADED) +class ViewportAttributes; +#endif } namespace WebKit { @@ -76,10 +79,16 @@ class LayerTreeHost : public RefCounted { virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return 0; } -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&, IPC::MessageDecoder&) = 0; #endif +#if USE(COORDINATED_GRAPHICS_THREADED) + virtual void setNativeSurfaceHandleForCompositing(uint64_t) = 0; + virtual void viewportSizeChanged(const WebCore::IntSize&) = 0; + virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) = 0; +#endif + #if USE(COORDINATED_GRAPHICS) && ENABLE(REQUEST_ANIMATION_FRAME) virtual void scheduleAnimation() = 0; #endif diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 15ce6383d2540..0a5a326facdf5 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -209,7 +209,7 @@ #include #endif -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) #include "CoordinatedLayerTreeHostMessages.h" #endif @@ -476,7 +476,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) WebProcess::shared().addMessageReceiver(Messages::WebPage::messageReceiverName(), m_pageID, *this); // FIXME: This should be done in the object constructors, and the objects themselves should be message receivers. -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) WebProcess::shared().addMessageReceiver(Messages::CoordinatedLayerTreeHost::messageReceiverName(), m_pageID, *this); #endif #if ENABLE(INSPECTOR) @@ -562,7 +562,7 @@ WebPage::~WebPage() WebProcess::shared().removeMessageReceiver(Messages::WebPage::messageReceiverName(), m_pageID); // FIXME: This should be done in the object destructors, and the objects themselves should be message receivers. -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) WebProcess::shared().removeMessageReceiver(Messages::CoordinatedLayerTreeHost::messageReceiverName(), m_pageID); #endif #if ENABLE(INSPECTOR) @@ -1311,7 +1311,12 @@ void WebPage::sendViewportAttributesChanged() // This also takes care of the relayout. setFixedLayoutSize(roundedIntSize(attr.layoutSize)); +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) send(Messages::WebPageProxy::DidChangeViewportProperties(attr)); +#else + if (m_drawingArea->layerTreeHost()) + m_drawingArea->layerTreeHost()->didChangeViewportProperties(attr); +#endif } #endif @@ -1796,7 +1801,11 @@ void WebPage::pageDidScroll() #if USE(TILED_BACKING_STORE) void WebPage::pageDidRequestScroll(const IntPoint& point) { +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) send(Messages::WebPageProxy::PageDidRequestScroll(point)); +#elif USE(COORDINATED_GRAPHICS_THREADED) + drawingArea()->scroll(IntRect(point, IntSize()), IntSize()); +#endif } #endif @@ -2370,7 +2379,7 @@ void WebPage::didStartPageTransition() void WebPage::didCompletePageTransition() { -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) // m_mainFrame can be null since r170163. if (m_mainFrame && m_mainFrame->coreFrame()->view()->delegatesScrolling()) { // Wait until the UI process sent us the visible rect it wants rendered. @@ -3534,7 +3543,7 @@ bool WebPage::windowAndWebPageAreFocused() const void WebPage::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder) { -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) if (decoder.messageReceiverName() == Messages::CoordinatedLayerTreeHost::messageReceiverName()) { if (m_drawingArea) m_drawingArea->didReceiveCoordinatedLayerTreeHostMessage(connection, decoder); @@ -4021,7 +4030,7 @@ bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) return platformCanHandleRequest(request); } -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void WebPage::commitPageTransitionViewport() { m_drawingArea->setLayerTreeStateIsFrozen(false); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index ca99f335f1957..144f5d1563598 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -587,7 +587,7 @@ class WebPage : public API::ObjectImpl, public IP void setThemePath(const String&); #endif -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void commitPageTransitionViewport(); #endif @@ -1023,7 +1023,7 @@ class WebPage : public API::ObjectImpl, public IP void hideFindUI(); void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount); -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area); #endif diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 0db1530e3593e..6a8a59bc1c2b2 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -315,7 +315,7 @@ messages -> WebPage LegacyReceiver { SetThemePath(String themePath) #endif -#if USE(TILED_BACKING_STORE) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) CommitPageTransitionViewport() #endif @@ -381,7 +381,7 @@ messages -> WebPage LegacyReceiver { SetComposition(String compositionString, Vector underlines, uint64_t cursorPosition) CancelComposition() #endif -#if USE(COORDINATED_GRAPHICS) +#if USE(COORDINATED_GRAPHICS_MULTIPROCESS) FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area) #endif diff --git a/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp b/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp index 58ea68f7d9078..e2b785be38d3f 100644 --- a/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp +++ b/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp @@ -34,6 +34,10 @@ #include #include +#if PLATFORM(X11) +#include +#endif + using namespace WebCore; namespace WebKit { @@ -47,6 +51,9 @@ class WebProcessMain final: public ChildProcessMainBase { sleep(30); #endif +#if USE(COORDINATED_GRAPHICS_THREADED) && PLATFORM(X11) + XInitThreads(); +#endif gtk_init(nullptr, nullptr); bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake index cb04500d93c13..135189047ef6b 100644 --- a/Source/cmake/OptionsEfl.cmake +++ b/Source/cmake/OptionsEfl.cmake @@ -118,7 +118,6 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_AUDIO ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_TIMING ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XHR_TIMEOUT ON) -WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE ON) if (ENABLE_LLINT_C_LOOP) message(STATUS "Force enabling LLINT C LOOP.") @@ -208,6 +207,8 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO) endif () add_definitions(-DWTF_USE_COORDINATED_GRAPHICS=1) +add_definitions(-DWTF_USE_COORDINATED_GRAPHICS_MULTIPROCESS=1) +add_definitions(-DWTF_USE_TILED_BACKING_STORE=1) add_definitions(-DWTF_USE_TEXTURE_MAPPER=1) diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake index 54cb003d4265c..c0a8ad5b1da48 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake @@ -172,7 +172,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_AUDIO ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_TIMING ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XHR_TIMEOUT ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS ON) -WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE OFF) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THREADED_COMPOSITOR OFF) WEBKIT_OPTION_END() if (LIBNOTIFY_FOUND) @@ -329,6 +329,12 @@ if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND)) if (GLX_FOUND) add_definitions(-DWTF_USE_GLX=1) endif () + + if (ENABLE_THREADED_COMPOSITOR) + add_definitions(-DWTF_USE_TILED_BACKING_STORE=1) + add_definitions(-DWTF_USE_COORDINATED_GRAPHICS=1) + add_definitions(-DWTF_USE_COORDINATED_GRAPHICS_THREADED=1) + endif () endif () if (ENABLE_GAMEPAD_DEPRECATED) diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake index cac9999820f52..1e30c2f03701d 100644 --- a/Source/cmake/WebKitFeatures.cmake +++ b/Source/cmake/WebKitFeatures.cmake @@ -149,7 +149,7 @@ macro(WEBKIT_OPTION_BEGIN) WEBKIT_OPTION_DEFINE(ENABLE_XHR_TIMEOUT "Toggle XHR timeout support" OFF) WEBKIT_OPTION_DEFINE(ENABLE_XSLT "Toggle XSLT support" ON) WEBKIT_OPTION_DEFINE(USE_SYSTEM_MALLOC "Toggle system allocator instead of TCmalloc" OFF) - WEBKIT_OPTION_DEFINE(WTF_USE_TILED_BACKING_STORE "Toggle Tiled Backing Store support" OFF) + WEBKIT_OPTION_DEFINE(ENABLE_THREADED_COMPOSITOR "Toggle threaded compositor support" OFF) WEBKIT_OPTION_DEPEND(ENABLE_ENCRYPTED_MEDIA_V2 ENABLE_VIDEO) WEBKIT_OPTION_DEPEND(ENABLE_MEDIA_CONTROLS_SCRIPT ENABLE_VIDEO) diff --git a/Source/cmakeconfig.h.cmake b/Source/cmakeconfig.h.cmake index 00d5f3188de48..43098aa88c3d8 100644 --- a/Source/cmakeconfig.h.cmake +++ b/Source/cmakeconfig.h.cmake @@ -139,7 +139,6 @@ #cmakedefine01 ENABLE_XSLT #cmakedefine01 USE_SYSTEM_MALLOC #cmakedefine01 WTF_USE_GEOCLUE2 -#cmakedefine01 WTF_USE_TILED_BACKING_STORE #cmakedefine01 HAVE_LLVM #cmakedefine01 HAVE_GTK_UNIX_PRINTING #cmakedefine01 WTF_CPU_ARM64_CORTEXA53 diff --git a/Tools/ChangeLog b/Tools/ChangeLog index c69147f54baff..4548df53dec03 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,17 @@ +2015-01-07 Gwang Yoon Hwang + + [GTK][ThreadedCompositor] Add support for threaded compositor. + https://bugs.webkit.org/show_bug.cgi?id=118265 + + Reviewed by Martin Robinson. + + Added the ENABLE_THREADED_COMPOSITOR feature flag to the cmake and + autotools build systems. The feature is disabled by default. + And remove deprecated the WTF_USE_TILED_BACKING_STORE feature flag + from the feature flags. + + * Scripts/webkitperl/FeatureList.pm: + 2015-01-07 Daniel Bates [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 51dd8be0061b1..463248d9ff739 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -128,7 +128,7 @@ my ( $systemMallocSupport, $templateElementSupport, $textAutosizingSupport, - $tiledBackingStoreSupport, + $threadedCompositorSupport, $threadedHTMLParserSupport, $touchEventsSupport, $touchSliderSupport, @@ -383,6 +383,9 @@ my @features = ( { option => "template-element", desc => "Toggle HTMLTemplateElement support", define => "ENABLE_TEMPLATE_ELEMENT", default => 1, value => \$templateElementSupport }, + { option => "threaded-compositor", desc => "Toggle threaded compositor support", + define => "ENABLE_THREADED_COMPOSITOR", default => 0, value => \$threadedCompositorSupport }, + { option => "text-autosizing", desc => "Toggle Text Autosizing support", define => "ENABLE_TEXT_AUTOSIZING", default => 0, value => \$textAutosizingSupport },