Remove ENABLE_THREADED_COMPOSITOR build option
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2017 07:12:17 +0000 (07:12 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2017 07:12:17 +0000 (07:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168606

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebCore:

* platform/TextureMapper.cmake:

Source/WebKit2:

Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.

* PlatformGTK.cmake:
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

12 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/TextureMapper.cmake
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp [deleted file]
Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h [deleted file]
Source/cmake/OptionsGTK.cmake
Source/cmake/WebKitFeatures.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm

index 4991bce..ac0d98f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Remove ENABLE_THREADED_COMPOSITOR build option
+        https://bugs.webkit.org/show_bug.cgi?id=168606
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/OptionsGTK.cmake:
+        * Source/cmake/WebKitFeatures.cmake:
+
 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
index cc3a9cb..1df4dd7 100644 (file)
@@ -1,3 +1,12 @@
+2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Remove ENABLE_THREADED_COMPOSITOR build option
+        https://bugs.webkit.org/show_bug.cgi?id=168606
+
+        Reviewed by Michael Catanzaro.
+
+        * platform/TextureMapper.cmake:
+
 2017-02-20  Alex Christensen  <achristensen@webkit.org>
 
         Fix some 32-bit builds after r212699
index 1091a46..09c2a99 100644 (file)
@@ -4,7 +4,6 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
 list(APPEND WebCore_SOURCES
     platform/graphics/texmap/BitmapTexture.cpp
     platform/graphics/texmap/BitmapTexturePool.cpp
-    platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
     platform/graphics/texmap/TextureMapper.cpp
     platform/graphics/texmap/TextureMapperAnimation.cpp
     platform/graphics/texmap/TextureMapperBackingStore.cpp
@@ -12,7 +11,6 @@ list(APPEND WebCore_SOURCES
     platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp
     platform/graphics/texmap/TextureMapperLayer.cpp
     platform/graphics/texmap/TextureMapperTile.cpp
-    platform/graphics/texmap/TextureMapperTiledBackingStore.cpp
 )
 
 if (USE_TEXTURE_MAPPER_GL)
@@ -33,17 +31,18 @@ if (USE_COORDINATED_GRAPHICS)
         page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
         page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
 
+        platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
+        platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
+
         platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
         platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
         platform/graphics/texmap/coordinated/CoordinatedSurface.cpp
         platform/graphics/texmap/coordinated/Tile.cpp
         platform/graphics/texmap/coordinated/TiledBackingStore.cpp
     )
-endif ()
-
-if (ENABLE_THREADED_COMPOSITOR)
+else ()
     list(APPEND WebCore_SOURCES
-        platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
-        platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
+        platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+        platform/graphics/texmap/TextureMapperBackingStore.cpp
     )
 endif ()
index 15edb64..be7f977 100644 (file)
@@ -1,3 +1,18 @@
+2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Remove ENABLE_THREADED_COMPOSITOR build option
+        https://bugs.webkit.org/show_bug.cgi?id=168606
+
+        Reviewed by Michael Catanzaro.
+
+        Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.
+
+        * PlatformGTK.cmake:
+        * WebProcess/WebPage/LayerTreeHost.cpp:
+        (WebKit::LayerTreeHost::create):
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.
+
 2017-02-20  Youenn Fablet  <youenn@apple.com>
 
         [WebRTC][Mac] Activate libwebrtc
index 21e231b..6fd3fde 100644 (file)
@@ -59,6 +59,14 @@ list(APPEND WebKit2_SOURCES
 
     Shared/Authentication/soup/AuthenticationManagerSoup.cpp
 
+    Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
+    Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
+    Shared/CoordinatedGraphics/SimpleViewportController.cpp
+
+    Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
+    Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
+    Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
+
     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
 
     Shared/Plugins/unix/PluginSearchPath.cpp
@@ -471,6 +479,13 @@ list(APPEND WebKit2_SOURCES
     WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
 
     WebProcess/WebPage/AcceleratedDrawingArea.cpp
+
+    WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
+    WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
+    WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
+    WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
+    WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp
+
     WebProcess/WebPage/DrawingAreaImpl.cpp
 
     WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
@@ -853,6 +868,8 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/NetworkProcess/unix"
     "${WEBKIT2_DIR}/Platform/IPC/glib"
     "${WEBKIT2_DIR}/Shared/API/c/gtk"
+    "${WEBKIT2_DIR}/Shared/CoordinatedGraphics"
+    "${WEBKIT2_DIR}/Shared/CoordinatedGraphics/threadedcompositor"
     "${WEBKIT2_DIR}/Shared/Plugins/unix"
     "${WEBKIT2_DIR}/Shared/glib"
     "${WEBKIT2_DIR}/Shared/gtk"
@@ -879,6 +896,7 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/WebProcess/unix"
     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/gtk"
     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/soup"
+    "${WEBKIT2_DIR}/WebProcess/WebPage/CoordinatedGraphics"
     "${WEBKIT2_DIR}/WebProcess/WebPage/atk"
     "${WEBKIT2_DIR}/WebProcess/WebPage/gtk"
 )
@@ -1180,33 +1198,6 @@ 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/CompositingRunLoop.cpp
-        Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
-        Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
-
-        WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
-        WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
-        WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
-        WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
-        WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp
-    )
-    list(APPEND WebKit2_INCLUDE_DIRECTORIES
-        "${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"
index dd6e129..8181a24 100644 (file)
@@ -31,8 +31,6 @@
 
 #if USE(COORDINATED_GRAPHICS_THREADED)
 #include "ThreadedCoordinatedLayerTreeHost.h"
-#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
-#include "LayerTreeHostGtk.h"
 #endif
 
 using namespace WebCore;
@@ -43,8 +41,6 @@ RefPtr<LayerTreeHost> LayerTreeHost::create(WebPage& webPage)
 {
 #if USE(COORDINATED_GRAPHICS_THREADED)
     return ThreadedCoordinatedLayerTreeHost::create(webPage);
-#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
-    return LayerTreeHostGtk::create(webPage);
 #else
     UNUSED_PARAM(webPage);
     return nullptr;
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
deleted file mode 100644 (file)
index 40bb07d..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2012 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 "LayerTreeHostGtk.h"
-
-#if USE(TEXTURE_MAPPER_GL)
-
-#include "AcceleratedSurface.h"
-#include "DrawingAreaImpl.h"
-#include "TextureMapperGL.h"
-#include "WebPage.h"
-#include "WebProcess.h"
-
-#if USE(OPENGL_ES_2)
-#include <GLES2/gl2.h>
-#else
-#include <GL/gl.h>
-#endif
-
-#include <WebCore/FrameView.h>
-#include <WebCore/GLContext.h>
-#include <WebCore/GraphicsLayerTextureMapper.h>
-#include <WebCore/MainFrame.h>
-#include <WebCore/Page.h>
-#include <WebCore/Settings.h>
-#include <gdk/gdk.h>
-#include <wtf/CurrentTime.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler(std::function<bool()> renderer)
-    : m_renderer(WTFMove(renderer))
-    , m_timer(RunLoop::main(), this, &LayerTreeHostGtk::RenderFrameScheduler::renderFrame)
-{
-    // We use a RunLoop timer because otherwise GTK+ event handling during dragging can starve WebCore timers, which have a lower priority.
-    // Use a higher priority than WebCore timers.
-    m_timer.setPriority(GDK_PRIORITY_REDRAW - 1);
-}
-
-LayerTreeHostGtk::RenderFrameScheduler::~RenderFrameScheduler()
-{
-}
-
-void LayerTreeHostGtk::RenderFrameScheduler::start()
-{
-    if (m_timer.isActive())
-        return;
-    m_fireTime = 0;
-    nextFrame();
-}
-
-void LayerTreeHostGtk::RenderFrameScheduler::stop()
-{
-    m_timer.stop();
-}
-
-static inline bool shouldSkipNextFrameBecauseOfContinousImmediateFlushes(double current, double lastImmediateFlushTime)
-{
-    // 100ms is about a perceptable delay in UI, so when scheduling layer flushes immediately for more than 100ms,
-    // we skip the next frame to ensure pending timers have a change to be fired.
-    static const double maxDurationOfImmediateFlushes = 0.100;
-    if (!lastImmediateFlushTime)
-        return false;
-    return lastImmediateFlushTime + maxDurationOfImmediateFlushes < current;
-}
-
-void LayerTreeHostGtk::RenderFrameScheduler::nextFrame()
-{
-    static const double targetFramerate = 1 / 60.0;
-    // When rendering layers takes more time than the target delay (0.016), we end up scheduling layer flushes
-    // immediately. Since the layer flush timer has a higher priority than WebCore timers, these are never
-    // fired while we keep scheduling layer flushes immediately.
-    double current = monotonicallyIncreasingTime();
-    double timeToNextFlush = std::max(targetFramerate - (current - m_fireTime), 0.0);
-    if (timeToNextFlush)
-        m_lastImmediateFlushTime = 0;
-    else if (!m_lastImmediateFlushTime)
-        m_lastImmediateFlushTime = current;
-
-    if (shouldSkipNextFrameBecauseOfContinousImmediateFlushes(current, m_lastImmediateFlushTime)) {
-        timeToNextFlush = targetFramerate;
-        m_lastImmediateFlushTime = 0;
-    }
-
-    m_timer.startOneShot(timeToNextFlush);
-}
-
-void LayerTreeHostGtk::RenderFrameScheduler::renderFrame()
-{
-    m_fireTime = monotonicallyIncreasingTime();
-    if (!m_renderer() || m_timer.isActive())
-        return;
-    nextFrame();
-}
-
-Ref<LayerTreeHostGtk> LayerTreeHostGtk::create(WebPage& webPage)
-{
-    return adoptRef(*new LayerTreeHostGtk(webPage));
-}
-
-LayerTreeHostGtk::LayerTreeHostGtk(WebPage& webPage)
-    : LayerTreeHost(webPage)
-    , m_surface(AcceleratedSurface::create(webPage))
-    , m_renderFrameScheduler(std::bind(&LayerTreeHostGtk::renderFrame, this))
-{
-    m_rootLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-    m_rootLayer->setDrawsContent(false);
-    m_rootLayer->setSize(m_webPage.size());
-
-    m_scaleMatrix.makeIdentity();
-    m_scaleMatrix.scale(m_webPage.deviceScaleFactor() * m_webPage.pageScaleFactor());
-    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setAnchorPoint(FloatPoint3D());
-    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTransform(m_scaleMatrix);
-
-    // The non-composited contents are a child of the root layer.
-    m_nonCompositedContentLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-    m_nonCompositedContentLayer->setDrawsContent(true);
-    m_nonCompositedContentLayer->setContentsOpaque(m_webPage.drawsBackground());
-    m_nonCompositedContentLayer->setSize(m_webPage.size());
-    if (m_webPage.corePage()->settings().acceleratedDrawingEnabled())
-        m_nonCompositedContentLayer->setAcceleratesDrawing(true);
-
-#ifndef NDEBUG
-    m_rootLayer->setName("LayerTreeHost root layer");
-    m_nonCompositedContentLayer->setName("LayerTreeHost non-composited content");
-#endif
-
-    m_rootLayer->addChild(m_nonCompositedContentLayer.get());
-    m_nonCompositedContentLayer->setNeedsDisplay();
-
-    if (m_surface) {
-        createTextureMapper();
-        m_layerTreeContext.contextID = m_surface->surfaceID();
-    }
-}
-
-bool LayerTreeHostGtk::makeContextCurrent()
-{
-    uint64_t nativeHandle = m_surface ? m_surface->window() : m_layerTreeContext.contextID;
-    if (!nativeHandle) {
-        m_context = nullptr;
-        return false;
-    }
-
-    if (m_context)
-        return m_context->makeContextCurrent();
-
-    m_context = GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(nativeHandle), &PlatformDisplay::sharedDisplayForCompositing());
-    if (!m_context)
-        return false;
-
-    if (!m_context->makeContextCurrent())
-        return false;
-
-    // Do not do frame sync when rendering offscreen in the web process to ensure that SwapBuffers never blocks.
-    // Rendering to the actual screen will happen later anyway since the UI process schedules a redraw for every update,
-    // the compositor will take care of syncing to vblank.
-    if (m_surface)
-        m_context->swapInterval(0);
-
-    return true;
-}
-
-LayerTreeHostGtk::~LayerTreeHostGtk()
-{
-    ASSERT(!m_rootLayer);
-    cancelPendingLayerFlush();
-}
-
-void LayerTreeHostGtk::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
-{
-    m_nonCompositedContentLayer->removeAllChildren();
-
-    // Add the accelerated layer tree hierarchy.
-    if (graphicsLayer)
-        m_nonCompositedContentLayer->addChild(graphicsLayer);
-
-    scheduleLayerFlush();
-}
-
-void LayerTreeHostGtk::invalidate()
-{
-    // This can trigger destruction of GL objects so let's make sure that
-    // we have the right active context
-    if (m_context)
-        m_context->makeContextCurrent();
-
-    cancelPendingLayerFlush();
-    m_rootLayer = nullptr;
-    m_nonCompositedContentLayer = nullptr;
-    m_textureMapper = nullptr;
-
-    m_context = nullptr;
-    LayerTreeHost::invalidate();
-
-    m_surface = nullptr;
-}
-
-void LayerTreeHostGtk::setNonCompositedContentsNeedDisplay()
-{
-    m_nonCompositedContentLayer->setNeedsDisplay();
-    scheduleLayerFlush();
-}
-
-void LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect(const IntRect& rect)
-{
-    m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
-    scheduleLayerFlush();
-}
-
-void LayerTreeHostGtk::scrollNonCompositedContents(const IntRect& scrollRect)
-{
-    setNonCompositedContentsNeedDisplayInRect(scrollRect);
-}
-
-void LayerTreeHostGtk::sizeDidChange(const IntSize& newSize)
-{
-    if (m_rootLayer->size() == newSize)
-        return;
-    m_rootLayer->setSize(newSize);
-
-    // If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed
-    // for those newly exposed areas.
-    FloatSize oldSize = m_nonCompositedContentLayer->size();
-    m_nonCompositedContentLayer->setSize(newSize);
-
-    if (newSize.width() > oldSize.width()) {
-        float height = std::min(static_cast<float>(newSize.height()), oldSize.height());
-        m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height));
-    }
-
-    if (newSize.height() > oldSize.height())
-        m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height()));
-    m_nonCompositedContentLayer->setNeedsDisplay();
-
-    if (m_surface && m_surface->resize(newSize))
-        m_layerTreeContext.contextID = m_surface->surfaceID();
-
-    compositeLayersToContext(ForResize);
-}
-
-void LayerTreeHostGtk::deviceOrPageScaleFactorChanged()
-{
-    if (m_surface && m_surface->resize(m_webPage.size()))
-        m_layerTreeContext.contextID = m_surface->surfaceID();
-
-    // Other layers learn of the scale factor change via WebPage::setDeviceScaleFactor.
-    m_nonCompositedContentLayer->deviceOrPageScaleFactorChanged();
-
-    m_scaleMatrix.makeIdentity();
-    m_scaleMatrix.scale(m_webPage.deviceScaleFactor() * m_webPage.pageScaleFactor());
-    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTransform(m_scaleMatrix);
-}
-
-void LayerTreeHostGtk::forceRepaint()
-{
-    scheduleLayerFlush();
-}
-
-void LayerTreeHostGtk::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect)
-{
-    if (graphicsLayer == m_nonCompositedContentLayer.get())
-        m_webPage.drawRect(graphicsContext, enclosingIntRect(clipRect));
-}
-
-float LayerTreeHostGtk::deviceScaleFactor() const
-{
-    return m_webPage.deviceScaleFactor();
-}
-
-float LayerTreeHostGtk::pageScaleFactor() const
-{
-    return m_webPage.pageScaleFactor();
-}
-
-bool LayerTreeHostGtk::renderFrame()
-{
-    flushAndRenderLayers();
-    return downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().descendantsOrSelfHaveRunningAnimations();
-}
-
-bool LayerTreeHostGtk::flushPendingLayerChanges()
-{
-    m_rootLayer->flushCompositingStateForThisLayerOnly();
-    m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly();
-
-    if (!m_webPage.corePage()->mainFrame().view()->flushCompositingStateIncludingSubframes())
-        return false;
-
-    if (m_viewOverlayRootLayer)
-        m_viewOverlayRootLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size()));
-
-    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers();
-    return true;
-}
-
-void LayerTreeHostGtk::compositeLayersToContext(CompositePurpose purpose)
-{
-    if (!makeContextCurrent())
-        return;
-
-    // The window size may be out of sync with the page size at this point, and getting
-    // the viewport parameters incorrect, means that the content will be misplaced. Thus
-    // we set the viewport parameters directly from the window size.
-    IntSize contextSize = m_context->defaultFrameBufferSize();
-    glViewport(0, 0, contextSize.width(), contextSize.height());
-    if (purpose == ForResize || !m_webPage.drawsBackground()) {
-        glClearColor(0, 0, 0, 0);
-        glClear(GL_COLOR_BUFFER_BIT);
-    }
-
-    ASSERT(m_textureMapper);
-
-    TextureMapper::PaintFlags paintFlags = 0;
-
-    if (m_surface && m_surface->shouldPaintMirrored())
-        paintFlags |= TextureMapper::PaintingMirrored;
-
-    m_textureMapper->beginPainting(paintFlags);
-    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint();
-    m_textureMapper->endPainting();
-
-    m_context->swapBuffers();
-}
-
-void LayerTreeHostGtk::flushAndRenderLayers()
-{
-    {
-        RefPtr<LayerTreeHostGtk> protect(this);
-        m_webPage.layoutIfNeeded();
-
-        if (!m_isValid)
-            return;
-    }
-
-    if (!makeContextCurrent())
-        return;
-
-    if (!flushPendingLayerChanges())
-        return;
-
-    // Our model is very simple. We always composite and render the tree immediately after updating it.
-    compositeLayersToContext();
-
-    if (m_notifyAfterScheduledLayerFlush) {
-        // Let the drawing area know that we've done a flush of the layer changes.
-        m_webPage.drawingArea()->layerHostDidFlushLayers();
-        m_notifyAfterScheduledLayerFlush = false;
-    }
-}
-
-void LayerTreeHostGtk::scheduleLayerFlush()
-{
-    if (!m_layerFlushSchedulingEnabled || !m_textureMapper)
-        return;
-
-    m_renderFrameScheduler.start();
-}
-
-void LayerTreeHostGtk::pageBackgroundTransparencyChanged()
-{
-    m_nonCompositedContentLayer->setContentsOpaque(m_webPage.drawsBackground());
-}
-
-void LayerTreeHostGtk::cancelPendingLayerFlush()
-{
-    m_renderFrameScheduler.stop();
-}
-
-void LayerTreeHostGtk::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer)
-{
-    LayerTreeHost::setViewOverlayRootLayer(viewOverlayRootLayer);
-    if (m_viewOverlayRootLayer)
-        m_rootLayer->addChild(m_viewOverlayRootLayer);
-}
-
-void LayerTreeHostGtk::createTextureMapper()
-{
-    // The creation of the TextureMapper needs an active OpenGL context.
-    if (!makeContextCurrent())
-        return;
-
-    ASSERT(m_isValid);
-    ASSERT(!m_textureMapper);
-    m_textureMapper = TextureMapper::create();
-    static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
-    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());
-}
-
-#if PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-void LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(uint64_t handle)
-{
-    cancelPendingLayerFlush();
-    m_layerTreeContext.contextID = handle;
-
-    createTextureMapper();
-    scheduleLayerFlush();
-}
-#endif
-
-} // namespace WebKit
-
-#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
deleted file mode 100644 (file)
index e356a36..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2012 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 LayerTreeHostGtk_h
-#define LayerTreeHostGtk_h
-
-#if USE(TEXTURE_MAPPER_GL)
-
-#include "LayerTreeContext.h"
-#include "LayerTreeHost.h"
-#include "TextureMapperLayer.h"
-#include <WebCore/GLContext.h>
-#include <WebCore/GraphicsLayerClient.h>
-#include <WebCore/TransformationMatrix.h>
-#include <wtf/RunLoop.h>
-
-namespace WebKit {
-
-class AcceleratedSurface;
-
-class LayerTreeHostGtk final : public LayerTreeHost, WebCore::GraphicsLayerClient {
-public:
-    static Ref<LayerTreeHostGtk> create(WebPage&);
-    virtual ~LayerTreeHostGtk();
-
-private:
-    explicit LayerTreeHostGtk(WebPage&);
-
-    WebCore::GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
-
-    // LayerTreeHost
-    void scheduleLayerFlush() override;
-    void cancelPendingLayerFlush() override;
-    void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
-    void invalidate() override;
-
-    void forceRepaint() override;
-    void sizeDidChange(const WebCore::IntSize& newSize) override;
-    void deviceOrPageScaleFactorChanged() override;
-    void pageBackgroundTransparencyChanged() override;
-
-    void setNonCompositedContentsNeedDisplay() override;
-    void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) override;
-    void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) override;
-    void setViewOverlayRootLayer(WebCore::GraphicsLayer*) override;
-
-#if PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
-    void setNativeSurfaceHandleForCompositing(uint64_t) override;
-#endif
-
-    class RenderFrameScheduler {
-    public:
-        RenderFrameScheduler(std::function<bool()>);
-        ~RenderFrameScheduler();
-
-        void start();
-        void stop();
-
-    private:
-        void renderFrame();
-        void nextFrame();
-
-        std::function<bool()> m_renderer;
-        RunLoop::Timer<RenderFrameScheduler> m_timer;
-        double m_fireTime { 0 };
-        double m_lastImmediateFlushTime { 0 };
-    };
-
-    // GraphicsLayerClient
-    void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override;
-    float deviceScaleFactor() const override;
-    float pageScaleFactor() const override;
-
-    bool flushPendingLayerChanges();
-
-    enum CompositePurpose { ForResize, NotForResize };
-    void compositeLayersToContext(CompositePurpose = NotForResize);
-
-    void flushAndRenderLayers();
-    bool renderFrame();
-    bool makeContextCurrent();
-    void createTextureMapper();
-
-    std::unique_ptr<WebCore::GraphicsLayer> m_rootLayer;
-    std::unique_ptr<WebCore::GraphicsLayer> m_nonCompositedContentLayer;
-    std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
-    std::unique_ptr<WebCore::GLContext> m_context;
-    WebCore::TransformationMatrix m_scaleMatrix;
-    std::unique_ptr<AcceleratedSurface> m_surface;
-    RenderFrameScheduler m_renderFrameScheduler;
-};
-
-} // namespace WebKit
-
-#endif
-
-#endif // LayerTreeHostGtk_h
index 2987654..59e70c7 100644 (file)
@@ -108,7 +108,6 @@ WEBKIT_OPTION_DEPEND(ENABLE_ACCELERATED_2D_CANVAS ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(ENABLE_GLES2 ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(ENABLE_NETSCAPE_PLUGIN_API ENABLE_X11_TARGET)
 WEBKIT_OPTION_DEPEND(ENABLE_PLUGIN_PROCESS_GTK2 ENABLE_X11_TARGET)
-WEBKIT_OPTION_DEPEND(ENABLE_THREADED_COMPOSITOR ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(ENABLE_WEBGL ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_OPENGL)
 WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_X11_TARGET)
@@ -144,7 +143,6 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ICONDATABASE PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_JIT PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SAMPLING_PROFILER PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK PUBLIC ON)
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THREADED_COMPOSITOR PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_AUDIO PUBLIC ON)
@@ -311,8 +309,8 @@ if (ENABLE_OPENGL)
         SET_AND_EXPOSE_TO_BUILD(USE_GLX TRUE)
     endif ()
 
-    SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS ${ENABLE_THREADED_COMPOSITOR})
-    SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS_THREADED ${ENABLE_THREADED_COMPOSITOR})
+    SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS TRUE)
+    SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS_THREADED TRUE)
 endif ()
 
 if (ENABLE_PLUGIN_PROCESS_GTK2)
index e570391..441a0e1 100644 (file)
@@ -172,7 +172,6 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_SVG_FONTS "Toggle SVG fonts support (imples SVG support)" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_TELEPHONE_NUMBER_DETECTION "Toggle telephone number detection support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_TEXT_AUTOSIZING "Toggle automatic text size adjustment support" PRIVATE OFF)
-    WEBKIT_OPTION_DEFINE(ENABLE_THREADED_COMPOSITOR "Toggle threaded compositor support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_TOUCH_EVENTS "Toggle Touch Events support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_TOUCH_SLIDER "Toggle Touch Slider support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_TOUCH_ICON_LOADING "Toggle Touch Icon Loading Support" PRIVATE OFF)
index 7cd0256..393d237 100644 (file)
@@ -1,3 +1,12 @@
+2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Remove ENABLE_THREADED_COMPOSITOR build option
+        https://bugs.webkit.org/show_bug.cgi?id=168606
+
+        Reviewed by Michael Catanzaro.
+
+        * Scripts/webkitperl/FeatureList.pm:
+
 2017-02-20  Youenn Fablet  <youenn@apple.com>
 
         [WebRTC][Mac] Activate libwebrtc
index 70e7034..6fbd838 100644 (file)
@@ -365,9 +365,6 @@ my @features = (
     { option => "system-malloc", desc => "Toggle system allocator instead of bmalloc",
       define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
 
-    { option => "threaded-compositor", desc => "Toggle threaded compositor support",
-      define => "ENABLE_THREADED_COMPOSITOR", default => isGtk(), value => \$threadedCompositorSupport },
-
     { option => "touch-events", desc => "Toggle Touch Events support",
       define => "ENABLE_TOUCH_EVENTS", default => (isIOSWebKit() || isEfl() || isGtk()), value => \$touchEventsSupport },