Skip to content
Permalink
Browse files
[CoordinatedGraphics] Unify all LayerTreeHost classes
https://bugs.webkit.org/show_bug.cgi?id=195094

Reviewed by Žan Doberšek.

There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
ports.

* PlatformWin.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
(WebKit::LayerTreeHost::LayerTreeHost):
(WebKit::LayerTreeHost::~LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::scheduleLayerFlush):
(WebKit::LayerTreeHost::cancelPendingLayerFlush):
(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::setRootCompositingLayer):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::invalidate):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::forceRepaint):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::sizeDidChange):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportAttributes):
(WebKit::LayerTreeHost::didChangeViewport):
(WebKit::LayerTreeHost::setIsDiscardable):
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):
(WebKit::LayerTreeHost::didFlushRootLayer):
(WebKit::LayerTreeHost::commitSceneState):
(WebKit::LayerTreeHost::frameComplete):
(WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::didDestroyGLContext):
(WebKit::LayerTreeHost::willRenderFrame):
(WebKit::LayerTreeHost::didRenderFrame):
(WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
* WebProcess/WebPage/LayerTreeHost.cpp: Removed.
* WebProcess/WebPage/LayerTreeHost.h: Removed.
* WebPage/win/LayerTreeHost.h: Added.

Canonical link: https://commits.webkit.org/209492@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Feb 28, 2019
1 parent 431930e commit c33c9548f84743f503546d11a2905bec6cb7e312
Showing 15 changed files with 558 additions and 842 deletions.
@@ -1,3 +1,64 @@
2019-02-28 Carlos Garcia Campos <cgarcia@igalia.com>

[CoordinatedGraphics] Unify all LayerTreeHost classes
https://bugs.webkit.org/show_bug.cgi?id=195094

Reviewed by Žan Doberšek.

There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
ports.

* PlatformWin.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
(WebKit::LayerTreeHost::LayerTreeHost):
(WebKit::LayerTreeHost::~LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::scheduleLayerFlush):
(WebKit::LayerTreeHost::cancelPendingLayerFlush):
(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::setRootCompositingLayer):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::invalidate):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::forceRepaint):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::sizeDidChange):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportAttributes):
(WebKit::LayerTreeHost::didChangeViewport):
(WebKit::LayerTreeHost::setIsDiscardable):
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):
(WebKit::LayerTreeHost::didFlushRootLayer):
(WebKit::LayerTreeHost::commitSceneState):
(WebKit::LayerTreeHost::frameComplete):
(WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::didDestroyGLContext):
(WebKit::LayerTreeHost::willRenderFrame):
(WebKit::LayerTreeHost::didRenderFrame):
(WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
* WebProcess/WebPage/LayerTreeHost.cpp: Removed.
* WebProcess/WebPage/LayerTreeHost.h: Removed.
* WebPage/win/LayerTreeHost.h: Added.

2019-02-28 Justin Fan <justin_fan@apple.com>

[Web GPU] Enable Web GPU only on 64-bit
@@ -81,11 +81,9 @@ list(APPEND WebKit_SOURCES
WebProcess/WebPage/AcceleratedDrawingArea.cpp
WebProcess/WebPage/AcceleratedSurface.cpp
WebProcess/WebPage/DrawingAreaImpl.cpp
WebProcess/WebPage/LayerTreeHost.cpp

WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp

WebProcess/WebPage/win/WebInspectorUIWin.cpp
WebProcess/WebPage/win/WebPageWin.cpp
@@ -25,9 +25,9 @@

#pragma once

#if USE(COORDINATED_GRAPHICS_THREADED) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)

#include <WebCore/DisplayRefreshMonitor.h>

#if USE(COORDINATED_GRAPHICS_THREADED) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
#include <wtf/RunLoop.h>

namespace WebKit {
@@ -403,12 +403,10 @@ WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp

WebProcess/WebPage/AcceleratedDrawingArea.cpp
WebProcess/WebPage/AcceleratedSurface.cpp
WebProcess/WebPage/LayerTreeHost.cpp
WebProcess/WebPage/ViewGestureGeometryCollector.cpp

WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp

WebProcess/WebPage/DrawingAreaImpl.cpp

@@ -243,11 +243,9 @@ WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp

WebProcess/WebPage/AcceleratedDrawingArea.cpp
WebProcess/WebPage/AcceleratedSurface.cpp
WebProcess/WebPage/LayerTreeHost.cpp

WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp

WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp

@@ -66,24 +66,6 @@ AcceleratedDrawingArea::AcceleratedDrawingArea(WebPage& webPage, const WebPageCr
m_webPage.corePage()->setDeviceScaleFactor(parameters.deviceScaleFactor);
}

void AcceleratedDrawingArea::setNeedsDisplay()
{
if (!m_isPaintingEnabled)
return;

if (m_layerTreeHost)
m_layerTreeHost->setNonCompositedContentsNeedDisplay();
}

void AcceleratedDrawingArea::setNeedsDisplayInRect(const IntRect& rect)
{
if (!m_isPaintingEnabled)
return;

if (m_layerTreeHost)
m_layerTreeHost->setNonCompositedContentsNeedDisplayInRect(rect);
}

void AcceleratedDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
{
if (!m_isPaintingEnabled)
@@ -343,19 +325,19 @@ void AcceleratedDrawingArea::enterAcceleratedCompositingMode(GraphicsLayer* grap

ASSERT(!m_layerTreeHost);
if (m_previousLayerTreeHost) {
#if USE(COORDINATED_GRAPHICS)
m_layerTreeHost = WTFMove(m_previousLayerTreeHost);
m_layerTreeHost->setIsDiscardable(false);
if (!m_isPaintingSuspended)
m_layerTreeHost->resumeRendering();
if (!m_layerTreeStateIsFrozen)
m_layerTreeHost->setLayerFlushSchedulingEnabled(true);
} else {
#if USE(COORDINATED_GRAPHICS_THREADED)
m_layerTreeHost = std::make_unique<LayerTreeHost>(m_webPage);
#else
ASSERT_NOT_REACHED();
m_layerTreeHost = nullptr;
#endif
} else {
m_layerTreeHost = LayerTreeHost::create(m_webPage);


if (!m_layerTreeHost)
return;

@@ -393,16 +375,12 @@ void AcceleratedDrawingArea::exitAcceleratedCompositingModeNow()
m_exitCompositingTimer.stop();
m_wantsToExitAcceleratedCompositingMode = false;

#if USE(COORDINATED_GRAPHICS)
ASSERT(m_layerTreeHost);
m_previousLayerTreeHost = WTFMove(m_layerTreeHost);
m_previousLayerTreeHost->setIsDiscardable(true);
m_previousLayerTreeHost->pauseRendering();
m_previousLayerTreeHost->setLayerFlushSchedulingEnabled(false);
m_discardPreviousLayerTreeHostTimer.startOneShot(5_s);
#else
m_layerTreeHost = nullptr;
#endif
}

void AcceleratedDrawingArea::discardPreviousLayerTreeHost()
@@ -40,8 +40,8 @@ class AcceleratedDrawingArea : public DrawingArea {

protected:
// DrawingArea
void setNeedsDisplay() override;
void setNeedsDisplayInRect(const WebCore::IntRect&) override;
void setNeedsDisplay() override { };
void setNeedsDisplayInRect(const WebCore::IntRect&) override { };
void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
void setLayerTreeStateIsFrozen(bool) override;
bool layerTreeStateIsFrozen() const override { return m_layerTreeStateIsFrozen; }
@@ -128,9 +128,9 @@ class AcceleratedDrawingArea : public DrawingArea {
RunLoop::Timer<AcceleratedDrawingArea> m_exitCompositingTimer;

// The layer tree host that handles accelerated compositing.
RefPtr<LayerTreeHost> m_layerTreeHost;
std::unique_ptr<LayerTreeHost> m_layerTreeHost;

RefPtr<LayerTreeHost> m_previousLayerTreeHost;
std::unique_ptr<LayerTreeHost> m_previousLayerTreeHost;
RunLoop::Timer<AcceleratedDrawingArea> m_discardPreviousLayerTreeHostTimer;
};

0 comments on commit c33c954

Please sign in to comment.