Diff
Modified: trunk/Source/WebKit2/ChangeLog (217487 => 217488)
--- trunk/Source/WebKit2/ChangeLog 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/ChangeLog 2017-05-26 13:28:51 UTC (rev 217488)
@@ -1,3 +1,17 @@
+2017-05-26 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r217479.
+ https://bugs.webkit.org/show_bug.cgi?id=172642
+
+ Exposes an underlying bug in WPEBackend-mesa that we have to
+ resolve separately (Requested by zdobersek on #webkit).
+
+ Reverted changeset:
+
+ "[WPE] Use AcceleratedDrawingArea instead of its fork"
+ https://bugs.webkit.org/show_bug.cgi?id=172496
+ http://trac.webkit.org/changeset/217479
+
2017-05-26 Csaba Osztrogonác <[email protected]>
Unreviewed Mac cmake buildfix after r217137, just for fun.
Modified: trunk/Source/WebKit2/PlatformWPE.cmake (217487 => 217488)
--- trunk/Source/WebKit2/PlatformWPE.cmake 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/PlatformWPE.cmake 2017-05-26 13:28:51 UTC (rev 217488)
@@ -90,7 +90,6 @@
Shared/wpe/ProcessExecutablePathWPE.cpp
Shared/wpe/WebEventFactory.cpp
- UIProcess/AcceleratedDrawingAreaProxy.cpp
UIProcess/BackingStore.cpp
UIProcess/DefaultUndoController.cpp
UIProcess/LegacySessionStateCodingNone.cpp
@@ -106,6 +105,7 @@
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,7 +152,6 @@
WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp
WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp
- WebProcess/WebPage/AcceleratedDrawingArea.cpp
WebProcess/WebPage/AcceleratedSurface.cpp
WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
@@ -165,6 +164,7 @@
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/DrawingAreaInfo.h (217487 => 217488)
--- trunk/Source/WebKit2/Shared/DrawingAreaInfo.h 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/Shared/DrawingAreaInfo.h 2017-05-26 13:28:51 UTC (rev 217488)
@@ -34,6 +34,8 @@
DrawingAreaTypeTiledCoreAnimation,
#endif
DrawingAreaTypeRemoteLayerTree,
+#elif PLATFORM(WPE)
+ DrawingAreaTypeWPE
#else
DrawingAreaTypeImpl
#endif
Added: trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.cpp (0 => 217488)
--- trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.cpp 2017-05-26 13:28:51 UTC (rev 217488)
@@ -0,0 +1,97 @@
+/*
+ * 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
Copied: trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.h (from rev 217487, trunk/Source/WebKit2/Shared/DrawingAreaInfo.h) (0 => 217488)
--- trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/DrawingAreaProxyWPE.h 2017-05-26 13:28:51 UTC (rev 217488)
@@ -0,0 +1,56 @@
+/*
+ * 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 (217487 => 217488)
--- trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp 2017-05-26 13:28:51 UTC (rev 217488)
@@ -26,7 +26,7 @@
#include "config.h"
#include "PageClientImpl.h"
-#include "AcceleratedDrawingAreaProxy.h"
+#include "DrawingAreaProxyWPE.h"
#include "NativeWebMouseEvent.h"
#include "NativeWebWheelEvent.h"
#include "ScrollGestureController.h"
@@ -47,7 +47,7 @@
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
{
- return std::make_unique<AcceleratedDrawingAreaProxy>(m_view.page());
+ return std::make_unique<DrawingAreaProxyWPE>(m_view.page());
}
void PageClientImpl::setViewNeedsDisplay(const WebCore::Region&)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp (217487 => 217488)
--- trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp 2017-05-26 13:28:51 UTC (rev 217488)
@@ -162,11 +162,6 @@
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 (217487 => 217488)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp 2017-05-26 13:28:51 UTC (rev 217488)
@@ -38,7 +38,7 @@
#include "RemoteLayerTreeDrawingArea.h"
#include "TiledCoreAnimationDrawingArea.h"
#elif PLATFORM(WPE)
-#include "AcceleratedDrawingArea.h"
+#include "DrawingAreaWPE.h"
#else
#include "DrawingAreaImpl.h"
#endif
@@ -57,14 +57,13 @@
#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 (217487 => 217488)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2017-05-26 13:28:51 UTC (rev 217488)
@@ -169,6 +169,18 @@
}
}
+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 (217487 => 217488)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h 2017-05-26 12:02:50 UTC (rev 217487)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h 2017-05-26 13:28:51 UTC (rev 217488)
@@ -49,6 +49,7 @@
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;
Added: trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.cpp (0 => 217488)
--- trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.cpp (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.cpp 2017-05-26 13:28:51 UTC (rev 217488)
@@ -0,0 +1,200 @@
+/*
+ * 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()
+{
+}
+
+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
Copied: trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.h (from rev 217487, trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h) (0 => 217488)
--- trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.h (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/wpe/DrawingAreaWPE.h 2017-05-26 13:28:51 UTC (rev 217488)
@@ -0,0 +1,91 @@
+/*
+ * 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