Title: [217779] trunk/Source/WebKit2
Revision
217779
Author
[email protected]
Date
2017-06-05 05:01:53 -0700 (Mon, 05 Jun 2017)

Log Message

[WPE] Use AcceleratedDrawingArea instead of its fork
https://bugs.webkit.org/show_bug.cgi?id=172496

Reviewed by Žan Doberšek.

WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified
for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing
being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead.

* PlatformWPE.cmake:
* Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type.
* UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed.
* UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually
belongs here.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port.
* WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here.
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed.
* WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (217778 => 217779)


--- trunk/Source/WebKit2/ChangeLog	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-05 12:01:53 UTC (rev 217779)
@@ -1,3 +1,30 @@
+2017-06-05  Carlos Garcia Campos  <[email protected]>
+
+        [WPE] Use AcceleratedDrawingArea instead of its fork
+        https://bugs.webkit.org/show_bug.cgi?id=172496
+
+        Reviewed by Žan Doberšek.
+
+        WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified
+        for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing
+        being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead.
+
+        * PlatformWPE.cmake:
+        * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type.
+        * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed.
+        * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed.
+        * UIProcess/API/wpe/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy.
+        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
+        (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually
+        belongs here.
+        * WebProcess/WebPage/DrawingArea.cpp:
+        (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port.
+        * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here.
+        * WebProcess/WebPage/DrawingAreaImpl.h:
+        * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed.
+        * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed.
+
 2017-06-03  Simon Fraser  <[email protected]>
 
         Sort the project file.

Modified: trunk/Source/WebKit2/PlatformWPE.cmake (217778 => 217779)


--- trunk/Source/WebKit2/PlatformWPE.cmake	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/PlatformWPE.cmake	2017-06-05 12:01:53 UTC (rev 217779)
@@ -90,6 +90,7 @@
     Shared/wpe/ProcessExecutablePathWPE.cpp
     Shared/wpe/WebEventFactory.cpp
 
+    UIProcess/AcceleratedDrawingAreaProxy.cpp
     UIProcess/BackingStore.cpp
     UIProcess/DefaultUndoController.cpp
     UIProcess/LegacySessionStateCodingNone.cpp
@@ -105,7 +106,6 @@
     UIProcess/API/C/wpe/WKView.cpp
 
     UIProcess/API/wpe/CompositingManagerProxy.cpp
-    UIProcess/API/wpe/DrawingAreaProxyWPE.cpp
     UIProcess/API/wpe/PageClientImpl.cpp
     UIProcess/API/wpe/ScrollGestureController.cpp
     UIProcess/API/wpe/WPEView.cpp
@@ -152,6 +152,7 @@
     WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp
     WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp
 
+    WebProcess/WebPage/AcceleratedDrawingArea.cpp
     WebProcess/WebPage/AcceleratedSurface.cpp
 
     WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
@@ -164,7 +165,6 @@
 
     WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp
     WebProcess/WebPage/wpe/CompositingManager.cpp
-    WebProcess/WebPage/wpe/DrawingAreaWPE.cpp
     WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp
     WebProcess/WebPage/wpe/WebPageWPE.cpp
 

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (217778 => 217779)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -182,10 +182,14 @@
 
 void ThreadedCompositor::forceRepaint()
 {
+    // FIXME: Enable this for WPE once it's possible to do these forced updates
+    // in a way that doesn't starve out the underlying graphics buffers.
+#if PLATFORM(GTK)
     m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
         SetForScope<bool> change(m_inForceRepaint, true);
         renderLayerTree();
     });
+#endif
 }
 
 void ThreadedCompositor::renderLayerTree()

Modified: trunk/Source/WebKit2/Shared/DrawingAreaInfo.h (217778 => 217779)


--- trunk/Source/WebKit2/Shared/DrawingAreaInfo.h	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/Shared/DrawingAreaInfo.h	2017-06-05 12:01:53 UTC (rev 217779)
@@ -34,8 +34,6 @@
     DrawingAreaTypeTiledCoreAnimation,
 #endif
     DrawingAreaTypeRemoteLayerTree,
-#elif PLATFORM(WPE)
-    DrawingAreaTypeWPE
 #else
     DrawingAreaTypeImpl
 #endif

Deleted: trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.cpp (217778 => 217779)


--- trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -1,97 +0,0 @@
-/*
- * 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 "DrawingAreaProxyWPE.h"
-
-#include "DrawingAreaMessages.h"
-#include "WebPageProxy.h"
-#include "WebProcessProxy.h"
-#include <WebCore/NotImplemented.h>
-
-namespace WebKit {
-
-DrawingAreaProxyWPE::DrawingAreaProxyWPE(WebPageProxy& page)
-    : DrawingAreaProxy(DrawingAreaTypeWPE, page)
-{
-}
-
-DrawingAreaProxyWPE::~DrawingAreaProxyWPE()
-{
-}
-
-void DrawingAreaProxyWPE::deviceScaleFactorDidChange()
-{
-    notImplemented();
-}
-
-void DrawingAreaProxyWPE::sizeDidChange()
-{
-    if (m_webPageProxy.isValid())
-        m_webPageProxy.process().send(Messages::DrawingArea::UpdateBackingStoreState(0, false, m_webPageProxy.deviceScaleFactor(), m_size, m_scrollOffset), m_webPageProxy.pageID());
-}
-
-void DrawingAreaProxyWPE::dispatchAfterEnsuringDrawing(std::function<void(CallbackBase::Error)> callbackFunction)
-{
-    if (!m_webPageProxy.isValid()) {
-        callbackFunction(CallbackBase::Error::OwnerWasInvalidated);
-        return;
-    }
-
-    RunLoop::main().dispatch(
-        [callbackFunction] {
-            callbackFunction(CallbackBase::Error::None);
-        });
-}
-
-void DrawingAreaProxyWPE::update(uint64_t backingStoreStateID, const UpdateInfo&)
-{
-    notImplemented();
-}
-
-void DrawingAreaProxyWPE::didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&)
-{
-    notImplemented();
-}
-
-void DrawingAreaProxyWPE::enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
-{
-    ASSERT(!backingStoreStateID);
-
-    m_layerTreeContext = layerTreeContext;
-    m_webPageProxy.enterAcceleratedCompositingMode(layerTreeContext);
-}
-
-void DrawingAreaProxyWPE::exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&)
-{
-    notImplemented();
-}
-
-void DrawingAreaProxyWPE::updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&)
-{
-    notImplemented();
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.h (217778 => 217779)


--- trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.h	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.h	2017-06-05 12:01:53 UTC (rev 217779)
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-#pragma once
-
-#include "DrawingAreaProxy.h"
-
-#include "LayerTreeContext.h"
-
-namespace WebKit {
-
-class DrawingAreaProxyWPE final : public DrawingAreaProxy {
-public:
-    explicit DrawingAreaProxyWPE(WebPageProxy&);
-    virtual ~DrawingAreaProxyWPE();
-
-private:
-    // DrawingAreaProxy
-    void deviceScaleFactorDidChange() override;
-    void sizeDidChange() override;
-    void dispatchAfterEnsuringDrawing(std::function<void(CallbackBase::Error)>) override;
-
-    // IPC message handlers
-    void update(uint64_t backingStoreStateID, const UpdateInfo&) override;
-    void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override;
-    void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
-    void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override;
-    void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
-
-    // The current layer tree context.
-    LayerTreeContext m_layerTreeContext;
-};
-
-}

Modified: trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp (217778 => 217779)


--- trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "PageClientImpl.h"
 
-#include "DrawingAreaProxyWPE.h"
+#include "AcceleratedDrawingAreaProxy.h"
 #include "NativeWebMouseEvent.h"
 #include "NativeWebWheelEvent.h"
 #include "ScrollGestureController.h"
@@ -47,7 +47,7 @@
 
 std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
 {
-    return std::make_unique<DrawingAreaProxyWPE>(m_view.page());
+    return std::make_unique<AcceleratedDrawingAreaProxy>(m_view.page());
 }
 
 void PageClientImpl::setViewNeedsDisplay(const WebCore::Region&)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp (217778 => 217779)


--- trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -162,6 +162,11 @@
             m_layerTreeHost->sizeDidChange(size);
         else if (m_previousLayerTreeHost)
             m_previousLayerTreeHost->sizeDidChange(size);
+    } else {
+        if (m_layerTreeHost)
+            m_layerTreeHost->contentsSizeChanged(size);
+        else if (m_previousLayerTreeHost)
+            m_previousLayerTreeHost->contentsSizeChanged(size);
     }
     m_webPage.mainFrame()->pageOverlayController().didChangeDocumentSize();
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp (217778 => 217779)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -38,7 +38,7 @@
 #include "RemoteLayerTreeDrawingArea.h"
 #include "TiledCoreAnimationDrawingArea.h"
 #elif PLATFORM(WPE)
-#include "DrawingAreaWPE.h"
+#include "AcceleratedDrawingArea.h"
 #else
 #include "DrawingAreaImpl.h"
 #endif
@@ -57,13 +57,14 @@
 #endif
     case DrawingAreaTypeRemoteLayerTree:
         return std::make_unique<RemoteLayerTreeDrawingArea>(webPage, parameters);
-#elif PLATFORM(WPE)
-    case DrawingAreaTypeWPE:
-        return std::make_unique<DrawingAreaWPE>(webPage, parameters);
 #else
     case DrawingAreaTypeImpl:
+#if PLATFORM(WPE)
+        return std::make_unique<AcceleratedDrawingArea>(webPage, parameters);
+#else
         return std::make_unique<DrawingAreaImpl>(webPage, parameters);
 #endif
+#endif
     }
 
     return nullptr;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (217778 => 217779)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -169,18 +169,6 @@
     }
 }
 
-void DrawingAreaImpl::mainFrameContentSizeChanged(const WebCore::IntSize& newSize)
-{
-#if USE(COORDINATED_GRAPHICS_THREADED)
-    if (m_layerTreeHost)
-        m_layerTreeHost->contentsSizeChanged(newSize);
-    else if (m_previousLayerTreeHost)
-        m_previousLayerTreeHost->contentsSizeChanged(newSize);
-#else
-    UNUSED_PARAM(newSize);
-#endif
-}
-
 void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store)
 {
     Settings& settings = m_webPage.corePage()->settings();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h (217778 => 217779)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2017-06-05 12:01:53 UTC (rev 217779)
@@ -49,7 +49,6 @@
     void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
     void forceRepaint() override;
 
-    void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
     void updatePreferences(const WebPreferencesStore&) override;
 
     void setRootCompositingLayer(WebCore::GraphicsLayer*) override;

Deleted: trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.cpp (217778 => 217779)


--- trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.cpp	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.cpp	2017-06-05 12:01:53 UTC (rev 217779)
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2015 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 "DrawingAreaWPE.h"
-
-#include "DrawingAreaProxyMessages.h"
-#include "WebPage.h"
-#include "WebPreferencesKeys.h"
-#include "WebPreferencesStore.h"
-#include <WebCore/DisplayRefreshMonitor.h>
-#include <WebCore/MainFrame.h>
-#include <WebCore/NotImplemented.h>
-#include <WebCore/Settings.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-DrawingAreaWPE::DrawingAreaWPE(WebPage& webPage, const WebPageCreationParameters&)
-    : DrawingArea(DrawingAreaTypeWPE, webPage)
-{
-    webPage.corePage()->settings().setForceCompositingMode(true);
-    enterAcceleratedCompositingMode(0);
-}
-
-DrawingAreaWPE::~DrawingAreaWPE()
-{
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->invalidate();
-}
-
-void DrawingAreaWPE::layerHostDidFlushLayers()
-{
-    m_webPage.send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(0, m_layerTreeHost->layerTreeContext()));
-}
-
-void DrawingAreaWPE::setNeedsDisplay()
-{
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->setNonCompositedContentsNeedDisplay();
-}
-
-void DrawingAreaWPE::setNeedsDisplayInRect(const IntRect& rect)
-{
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->setNonCompositedContentsNeedDisplayInRect(rect);
-}
-
-void DrawingAreaWPE::scroll(const IntRect& scrollRect, const IntSize&)
-{
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->scrollNonCompositedContents(scrollRect);
-}
-
-void DrawingAreaWPE::pageBackgroundTransparencyChanged()
-{
-    if (m_layerTreeHost)
-        m_layerTreeHost->pageBackgroundTransparencyChanged();
-}
-
-void DrawingAreaWPE::forceRepaint()
-{
-    notImplemented();
-}
-
-bool DrawingAreaWPE::forceRepaintAsync(uint64_t callbackID)
-{
-    return m_layerTreeHost && m_layerTreeHost->forceRepaintAsync(callbackID);
-}
-
-void DrawingAreaWPE::setLayerTreeStateIsFrozen(bool frozen)
-{
-    m_layerTreeStateIsFrozen = frozen;
-}
-
-void DrawingAreaWPE::setPaintingEnabled(bool)
-{
-    notImplemented();
-}
-
-void DrawingAreaWPE::updatePreferences(const WebPreferencesStore& store)
-{
-    m_webPage.corePage()->settings().setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
-}
-
-void DrawingAreaWPE::mainFrameContentSizeChanged(const WebCore::IntSize& size)
-{
-    if (m_layerTreeHost)
-        m_layerTreeHost->contentsSizeChanged(size);
-}
-
-GraphicsLayerFactory* DrawingAreaWPE::graphicsLayerFactory()
-{
-    if (m_layerTreeHost)
-        return m_layerTreeHost->graphicsLayerFactory();
-    return nullptr;
-}
-
-void DrawingAreaWPE::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
-{
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
-}
-
-void DrawingAreaWPE::scheduleCompositingLayerFlush()
-{
-    if (m_layerTreeHost)
-        m_layerTreeHost->scheduleLayerFlush();
-}
-
-void DrawingAreaWPE::scheduleCompositingLayerFlushImmediately()
-{
-    scheduleCompositingLayerFlush();
-}
-
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-RefPtr<WebCore::DisplayRefreshMonitor> DrawingAreaWPE::createDisplayRefreshMonitor(PlatformDisplayID displayID)
-{
-    if (m_layerTreeHost)
-        return m_layerTreeHost->createDisplayRefreshMonitor(displayID);
-
-    return nullptr;
-}
-#endif
-
-void DrawingAreaWPE::attachViewOverlayGraphicsLayer(WebCore::Frame* frame, WebCore::GraphicsLayer* viewOverlayRootLayer)
-{
-    if (!frame->isMainFrame())
-        return;
-
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer);
-}
-
-#if USE(COORDINATED_GRAPHICS_THREADED)
-void DrawingAreaWPE::didChangeViewportAttributes(WebCore::ViewportAttributes&&)
-{
-}
-#endif
-
-#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
-void DrawingAreaWPE::deviceOrPageScaleFactorChanged()
-{
-}
-#endif
-
-void DrawingAreaWPE::updateBackingStoreState(uint64_t, bool, float deviceScaleFactor, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset)
-{
-    m_webPage.setDeviceScaleFactor(deviceScaleFactor);
-    m_webPage.setSize(size);
-    m_webPage.layoutIfNeeded();
-    m_webPage.scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset);
-
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->sizeDidChange(m_webPage.size());
-}
-
-void DrawingAreaWPE::didUpdate()
-{
-}
-
-void DrawingAreaWPE::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer)
-{
-    ASSERT(!m_layerTreeHost);
-    m_layerTreeHost = LayerTreeHost::create(m_webPage);
-    m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
-    m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true);
-    m_layerTreeHost->sizeDidChange(m_webPage.size());
-}
-
-#if USE(COORDINATED_GRAPHICS)
-void DrawingAreaWPE::resetUpdateAtlasForTesting()
-{
-    ASSERT(m_layerTreeHost);
-    m_layerTreeHost->clearUpdateAtlases();
-}
-#endif
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.h (217778 => 217779)


--- trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.h	2017-06-05 09:11:34 UTC (rev 217778)
+++ trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.h	2017-06-05 12:01:53 UTC (rev 217779)
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#pragma once
-
-#include "DrawingArea.h"
-
-#include "LayerTreeHost.h"
-
-namespace WebKit {
-
-class DrawingAreaWPE : public DrawingArea {
-public:
-    DrawingAreaWPE(WebPage&, const WebPageCreationParameters&);
-    virtual ~DrawingAreaWPE();
-
-    void layerHostDidFlushLayers() override;
-
-private:
-    // DrawingArea
-    void setNeedsDisplay() override;
-    void setNeedsDisplayInRect(const WebCore::IntRect&) override;
-    void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
-
-    void pageBackgroundTransparencyChanged() override;
-    void forceRepaint() override;
-    bool forceRepaintAsync(uint64_t callbackID) override;
-    void setLayerTreeStateIsFrozen(bool) override;
-    bool layerTreeStateIsFrozen() const override { return m_layerTreeStateIsFrozen; }
-    LayerTreeHost* layerTreeHost() const override { return m_layerTreeHost.get(); }
-
-    void setPaintingEnabled(bool) override;
-    void updatePreferences(const WebPreferencesStore&) override;
-    void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
-
-    WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
-    void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
-    void scheduleCompositingLayerFlush() override;
-    void scheduleCompositingLayerFlushImmediately() override;
-
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
-#endif
-
-    void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
-
-#if USE(COORDINATED_GRAPHICS_THREADED)
-    void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;
-#endif
-
-#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
-    void deviceOrPageScaleFactorChanged() override;
-    void resetUpdateAtlasForTesting() override;
-#endif
-
-    void updateBackingStoreState(uint64_t, bool, float, const WebCore::IntSize&, const WebCore::IntSize&) override;
-    void didUpdate() override;
-
-    void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
-
-    // When true, we maintain the layer tree in its current state by not leaving accelerated compositing mode
-    // and not scheduling layer flushes.
-    bool m_layerTreeStateIsFrozen { false };
-
-    // The layer tree host that handles accelerated compositing.
-    RefPtr<LayerTreeHost> m_layerTreeHost;
-};
-
-} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to