WebKit Bugzilla
Attachment 362273 Details for
Bug 186364
: [WinCairo] Enable coordinated graphics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patch
bug186364.patch (text/plain), 32.22 KB, created by
Fujii Hironori
on 2019-02-18 02:10:43 PST
(
hide
)
Description:
WIP patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-02-18 02:10:43 PST
Size:
32.22 KB
patch
obsolete
>diff --git a/Source/WTF/wtf/WorkQueue.h b/Source/WTF/wtf/WorkQueue.h >index b3844275a65..51684b208eb 100644 >--- a/Source/WTF/wtf/WorkQueue.h >+++ b/Source/WTF/wtf/WorkQueue.h >@@ -38,6 +38,7 @@ > > #if USE(WINDOWS_EVENT_LOOP) > #include <wtf/HashMap.h> >+#include <wtf/RunLoop.h> > #include <wtf/ThreadingPrimitives.h> > #include <wtf/Vector.h> > #endif >@@ -76,6 +77,8 @@ public: > dispatch_queue_t dispatchQueue() const { return m_dispatchQueue; } > #elif USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP) > RunLoop& runLoop() const { return *m_runLoop; } >+#elif USE(WINDOWS_EVENT_LOOP) >+ HANDLE timerQueue() const { return m_timerQueue; } > #endif > > private: >diff --git a/Source/WebCore/PlatformWinCairo.cmake b/Source/WebCore/PlatformWinCairo.cmake >index 434bc43932f..542df38692f 100644 >--- a/Source/WebCore/PlatformWinCairo.cmake >+++ b/Source/WebCore/PlatformWinCairo.cmake >@@ -11,6 +11,15 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES > ) > > list(APPEND WebCore_SOURCES >+ page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >+ page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp >+ page/scrolling/nicosia/ScrollingTreeNicosia.cpp >+ page/scrolling/nicosia/ScrollingTreeFixedNode.cpp >+ page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >+ page/scrolling/nicosia/ScrollingTreeStickyNode.cpp >+ >+ page/scrolling/generic/ScrollingThreadGeneric.cpp >+ > page/win/FrameCairoWin.cpp > > platform/graphics/GLContext.cpp >@@ -59,5 +68,8 @@ list(APPEND WebCoreTestSupport_LIBRARIES > list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES > platform/mediacapabilities > platform/graphics/cairo >+ platform/graphics/nicosia >+ platform/graphics/nicosia/texmap >+ platform/graphics/texmap/coordinated > platform/network/curl > ) >diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake >index 0a5335a3cf8..05b6f8463a0 100644 >--- a/Source/WebKit/PlatformWin.cmake >+++ b/Source/WebKit/PlatformWin.cmake >@@ -24,6 +24,8 @@ list(APPEND WebKit_SOURCES > > Shared/API/c/curl/WKCertificateInfoCurl.cpp > >+ Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >+ > Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp > > Shared/win/AuxiliaryProcessMainWin.cpp >@@ -164,6 +166,13 @@ if (${WTF_PLATFORM_WIN_CAIRO}) > > Shared/API/c/cairo/WKImageCairo.cpp > >+ Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp >+ >+ Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp >+ Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >+ >+ Shared/CoordinatedGraphics/SimpleViewportController.cpp >+ > Shared/cairo/ShareableBitmapCairo.cpp > > Shared/curl/WebCoreArgumentCodersCurl.cpp >@@ -173,6 +182,8 @@ if (${WTF_PLATFORM_WIN_CAIRO}) > UIProcess/cairo/BackingStoreCairo.cpp > > WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp >+ >+ WebProcess/WebPage/win/AcceleratedSurfaceWin.cpp > ) > > list(APPEND WebKit_INCLUDE_DIRECTORIES >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >index a5f15f01a50..ae802d7e28e 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >@@ -232,7 +232,7 @@ void CoordinatedGraphicsScene::updateSceneState() > > // Store layer and impl references along with the corresponding update > // for each type of possible layer backing. >- struct { >+ struct LayersByBacking { > struct BackingStore { > std::reference_wrapper<TextureMapperLayer> layer; > std::reference_wrapper<Nicosia::BackingStoreTextureMapperImpl> backingStore; >@@ -364,7 +364,7 @@ void CoordinatedGraphicsScene::updateSceneState() > { std::ref(layer), std::ref(impl.proxy()), layerState.delta.contentLayerChanged }); > } else if (layerState.imageBacking) { > auto& impl = imageBackingImpl(*layerState.imageBacking); >- layersByBacking.imageBacking.append( >+ layersByBacking.imageBacking.append<LayersByBacking::ImageBacking>( > { std::ref(layer), std::ref(impl), impl.takeUpdate() }); > } else > layer.setContentsLayer(nullptr); >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp >index bdc5ee5a92f..e8f2f2534fb 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp >@@ -56,10 +56,19 @@ public: > getOrCreateWorkQueueForContext(context).dispatch(WTFMove(function)); > } > >+#if USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP) > RunLoop& runLoop(void* context) > { > return getOrCreateWorkQueueForContext(context).runLoop(); > } >+#endif >+ >+#if USE(WINDOWS_EVENT_LOOP) >+ HANDLE timerQueue(void* context) >+ { >+ return getOrCreateWorkQueueForContext(context).timerQueue(); >+ } >+#endif > > void invalidate(void* context) > { >@@ -106,7 +115,12 @@ private: > }; > > CompositingRunLoop::CompositingRunLoop(Function<void ()>&& updateFunction) >+#if USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP) > : m_updateTimer(WorkQueuePool::singleton().runLoop(this), this, &CompositingRunLoop::updateTimerFired) >+#elif USE(WINDOWS_EVENT_LOOP) >+ : m_timerQueue(WorkQueuePool::singleton().timerQueue(this)) >+ , m_updateTimer(INVALID_HANDLE_VALUE) >+#endif > , m_updateFunction(WTFMove(updateFunction)) > { > #if USE(GLIB_EVENT_LOOP) >@@ -142,6 +156,36 @@ void CompositingRunLoop::performTaskSync(Function<void ()>&& function) > m_dispatchSyncCondition.wait(m_dispatchSyncConditionMutex); > } > >+#if USE(WINDOWS_EVENT_LOOP) >+VOID CALLBACK CompositingRunLoop::updateTimerCallback(PVOID lpParam, BOOLEAN TimerOrWaitFired) >+{ >+ static_cast<CompositingRunLoop*>(lpParam)->m_updateTimer = INVALID_HANDLE_VALUE; >+ static_cast<CompositingRunLoop*>(lpParam)->updateTimerFired(); >+} >+#endif >+ >+void CompositingRunLoop::startUpdateTimer() >+{ >+#if USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP) >+ m_updateTimer.startOneShot(0_s); >+#elif USE(WINDOWS_EVENT_LOOP) >+ if (m_updateTimer == INVALID_HANDLE_VALUE) >+ ::CreateTimerQueueTimer(&m_updateTimer, m_timerQueue, updateTimerCallback, this, 0, 0, WT_EXECUTEINTIMERTHREAD); >+#endif >+} >+ >+void CompositingRunLoop::stopUpdateTimer() >+{ >+#if USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP) >+ m_updateTimer.stop(); >+#elif USE(WINDOWS_EVENT_LOOP) >+ if (m_updateTimer != INVALID_HANDLE_VALUE) { >+ ::DeleteTimerQueueTimer(m_timerQueue, m_updateTimer, NULL); >+ m_updateTimer = INVALID_HANDLE_VALUE; >+ } >+#endif >+} >+ > void CompositingRunLoop::scheduleUpdate() > { > LockHolder stateLocker(m_state.lock); >@@ -161,7 +205,7 @@ void CompositingRunLoop::scheduleUpdate(LockHolder& stateLocker) > switch (m_state.update) { > case UpdateState::Idle: > m_state.update = UpdateState::Scheduled; >- m_updateTimer.startOneShot(0_s); >+ startUpdateTimer(); > return; > case UpdateState::Scheduled: > return; >@@ -177,7 +221,7 @@ void CompositingRunLoop::stopUpdates() > // Stop everything. > > LockHolder locker(m_state.lock); >- m_updateTimer.stop(); >+ stopUpdateTimer(); > m_state.composition = CompositionState::Idle; > m_state.update = UpdateState::Idle; > m_state.pendingUpdate = false; >@@ -204,7 +248,7 @@ void CompositingRunLoop::compositionCompleted(LockHolder& stateLocker) > if (m_state.pendingUpdate) { > m_state.pendingUpdate = false; > m_state.update = UpdateState::Scheduled; >- m_updateTimer.startOneShot(0_s); >+ startUpdateTimer(); > return; > } > >@@ -236,7 +280,7 @@ void CompositingRunLoop::updateCompleted(LockHolder& stateLocker) > if (m_state.pendingUpdate) { > m_state.pendingUpdate = false; > m_state.update = UpdateState::Scheduled; >- m_updateTimer.startOneShot(0_s); >+ startUpdateTimer(); > return; > } > >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h >index 42c52f6be82..fc10cc588e7 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h >@@ -69,9 +69,18 @@ private: > PendingCompletion, > }; > >+ void startUpdateTimer(); >+ void stopUpdateTimer(); >+ > void updateTimerFired(); > >+#if USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP) > RunLoop::Timer<CompositingRunLoop> m_updateTimer; >+#elif USE(WINDOWS_EVENT_LOOP) >+ HANDLE m_timerQueue; >+ HANDLE m_updateTimer; >+ static VOID CALLBACK updateTimerCallback(PVOID lpParam, BOOLEAN TimerOrWaitFired); >+#endif > Function<void ()> m_updateFunction; > Lock m_dispatchSyncConditionMutex; > Condition m_dispatchSyncCondition; >diff --git a/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp b/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp >index 39af9b3798b..a8f36d9997b 100644 >--- a/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp >+++ b/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.cpp >@@ -126,7 +126,7 @@ void AcceleratedDrawingAreaProxy::didUpdateBackingStoreState(uint64_t backingSto > else { > m_hasReceivedFirstUpdate = true; > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > if (m_pendingNativeSurfaceHandleForCompositing) { > setNativeSurfaceHandleForCompositing(m_pendingNativeSurfaceHandleForCompositing); > m_pendingNativeSurfaceHandleForCompositing = 0; >@@ -249,7 +249,7 @@ void AcceleratedDrawingAreaProxy::updateAcceleratedCompositingMode(const LayerTr > m_webPageProxy.updateAcceleratedCompositingMode(layerTreeContext); > } > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > void AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing(uint64_t handle) > { > if (!m_hasReceivedFirstUpdate) { >diff --git a/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h b/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h >index c38a9bb12bc..47b8b43126b 100644 >--- a/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h >+++ b/Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h >@@ -40,7 +40,7 @@ public: > bool isInAcceleratedCompositingMode() const { return alwaysUseCompositing() || !m_layerTreeContext.isEmpty(); } > void visibilityDidChange(); > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > void setNativeSurfaceHandleForCompositing(uint64_t); > void destroyNativeSurfaceHandleForCompositing(); > #endif >@@ -89,7 +89,7 @@ protected: > // For a new Drawing Area don't draw anything until the WebProcess has sent over the first content. > bool m_hasReceivedFirstUpdate { false }; > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 }; > #endif > }; >diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp >index 0f9f9d4efd5..5d13f68c1dd 100644 >--- a/Source/WebKit/UIProcess/win/WebView.cpp >+++ b/Source/WebKit/UIProcess/win/WebView.cpp >@@ -233,8 +233,10 @@ WebView::WebView(RECT rect, const API::PageConfiguration& configuration, HWND pa > m_page = processPool->createWebPage(*m_pageClient, WTFMove(pageConfiguration)); > m_page->initializeWebPage(); > >- if (m_page->drawingArea()) >- m_page->drawingArea()->setSize(IntSize(rect.right - rect.left, rect.bottom - rect.top)); >+ if (AcceleratedDrawingAreaProxy* drawingArea = static_cast<AcceleratedDrawingAreaProxy*>(m_page->drawingArea())) { >+ drawingArea->setSize(IntSize(rect.right - rect.left, rect.bottom - rect.top)); >+ drawingArea->setNativeSurfaceHandleForCompositing((uint64_t)m_window); >+ } > > // FIXME: Initializing the tooltip window here matches WebKit win, but seems like something > // we could do on demand to save resources. >diff --git a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp >index edfe46b218e..a6fe7006c7f 100644 >--- a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp >+++ b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp >@@ -371,7 +371,7 @@ void AcceleratedDrawingArea::enterAcceleratedCompositingMode(GraphicsLayer* grap > m_layerTreeHost->pauseRendering(); > } > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > if (m_nativeSurfaceHandleForCompositing) > m_layerTreeHost->setNativeSurfaceHandleForCompositing(m_nativeSurfaceHandleForCompositing); > #endif >@@ -423,7 +423,7 @@ void AcceleratedDrawingArea::discardPreviousLayerTreeHost() > m_previousLayerTreeHost = nullptr; > } > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > void AcceleratedDrawingArea::setNativeSurfaceHandleForCompositing(uint64_t handle) > { > m_nativeSurfaceHandleForCompositing = handle; >diff --git a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h >index 0927d44d004..4efada82ffb 100644 >--- a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h >@@ -64,7 +64,7 @@ protected: > virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID); > #endif > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > void setNativeSurfaceHandleForCompositing(uint64_t) override; > void destroyNativeSurfaceHandleForCompositing(bool&) override; > #endif >diff --git a/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp b/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp >index e579a5df3a0..a806df78b5d 100644 >--- a/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp >+++ b/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp >@@ -41,6 +41,10 @@ > #include "AcceleratedSurfaceWPE.h" > #endif > >+#if PLATFORM(WIN) >+#include "AcceleratedSurfaceWin.h" >+#endif >+ > namespace WebKit { > using namespace WebCore; > >@@ -57,6 +61,10 @@ std::unique_ptr<AcceleratedSurface> AcceleratedSurface::create(WebPage& webPage, > #if PLATFORM(WPE) > if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::WPE) > return AcceleratedSurfaceWPE::create(webPage, client); >+#endif >+#if PLATFORM(WIN) >+ if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Windows) >+ return AcceleratedSurfaceWin::create(webPage, client); > #endif > return nullptr; > } >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp >index 823b7fa2ac7..ad352883ba8 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp >@@ -223,7 +223,7 @@ void ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes(ViewportAttri > didChangeViewport(); > } > >-#if PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)) || PLATFORM(WIN) > void ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing(uint64_t handle) > { > m_layerTreeContext.contextID = handle; >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h >index b784681679b..1c9050241a5 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h >@@ -68,7 +68,7 @@ private: > > void setIsDiscardable(bool) override; > >-#if PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)) || PLATFORM(WIN) > void setNativeSurfaceHandleForCompositing(uint64_t) override; > #endif > >diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.h b/Source/WebKit/WebProcess/WebPage/DrawingArea.h >index 7ee228ce18a..fec4601c667 100644 >--- a/Source/WebKit/WebProcess/WebPage/DrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.h >@@ -156,7 +156,7 @@ protected: > DrawingAreaType m_type; > WebPage& m_webPage; > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > uint64_t m_nativeSurfaceHandleForCompositing { 0 }; > #endif > >@@ -182,7 +182,7 @@ private: > virtual void addTransactionCallbackID(WebKit::CallbackID) { ASSERT_NOT_REACHED(); } > #endif > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > virtual void setNativeSurfaceHandleForCompositing(uint64_t) = 0; > virtual void destroyNativeSurfaceHandleForCompositing(bool&) = 0; > #endif >diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in b/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in >index 02330405142..64a503e4685 100644 >--- a/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in >@@ -40,8 +40,8 @@ messages -> DrawingArea { > AddTransactionCallbackID(WebKit::CallbackID callbackID) > #endif > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) || PLATFORM(WIN)) > SetNativeSurfaceHandleForCompositing(uint64_t handle) >- DestroyNativeSurfaceHandleForCompositing() -> (bool handled) >+ DestroyNativeSurfaceHandleForCompositing() -> (bool handled) LegacySync > #endif > } >diff --git a/Source/WebKit/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/LayerTreeHost.h >index 85dd458e018..c92623b69da 100644 >--- a/Source/WebKit/WebProcess/WebPage/LayerTreeHost.h >+++ b/Source/WebKit/WebProcess/WebPage/LayerTreeHost.h >@@ -91,7 +91,7 @@ public: > virtual void setIsDiscardable(bool) { }; > #endif > >-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) >+#if USE(TEXTURE_MAPPER_GL) && (PLATFORM(GTK) || PLATFORM(WIN)) > virtual void setNativeSurfaceHandleForCompositing(uint64_t) { }; > #endif > >diff --git a/Source/WebKit/WebProcess/WebPage/win/AcceleratedSurfaceWin.cpp b/Source/WebKit/WebProcess/WebPage/win/AcceleratedSurfaceWin.cpp >new file mode 100644 >index 00000000000..ee060ba0b7b >--- /dev/null >+++ b/Source/WebKit/WebProcess/WebPage/win/AcceleratedSurfaceWin.cpp >@@ -0,0 +1,91 @@ >+/* >+ * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * >+ * 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. ``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 >+ * 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 "AcceleratedSurfaceWin.h" >+ >+#include "WebPage.h" >+#include <egl.h> >+#include <WebCore/PlatformDisplayWin.h> >+ >+namespace WebKit { >+using namespace WebCore; >+ >+std::unique_ptr<AcceleratedSurfaceWin> AcceleratedSurfaceWin::create(WebPage& webPage, Client& client) >+{ >+ return std::unique_ptr<AcceleratedSurfaceWin>(new AcceleratedSurfaceWin(webPage, client)); >+} >+ >+AcceleratedSurfaceWin::AcceleratedSurfaceWin(WebPage& webPage, Client& client) >+ : AcceleratedSurface(webPage, client) >+{ >+} >+ >+AcceleratedSurfaceWin::~AcceleratedSurfaceWin() >+{ >+} >+ >+void AcceleratedSurfaceWin::initialize() >+{ >+} >+ >+void AcceleratedSurfaceWin::finalize() >+{ >+} >+ >+uint64_t AcceleratedSurfaceWin::window() const >+{ >+ // EGLNativeWindowType changes depending on the EGL implementation: reinterpret_cast works >+ // for pointers (only if they are 64-bit wide and not for other cases), and static_cast for >+ // numeric types (and when needed they get extended to 64-bit) but not for pointers. Using >+ // a plain C cast expression in this one instance works in all cases. >+ // static_assert(sizeof(EGLNativeWindowType) <= sizeof(uint64_t), "EGLNativeWindowType must not be longer than 64 bits."); >+ return 0; >+} >+ >+uint64_t AcceleratedSurfaceWin::surfaceID() const >+{ >+ return m_webPage.pageID(); >+} >+ >+bool AcceleratedSurfaceWin::hostResize(const IntSize& size) >+{ >+ if (!AcceleratedSurface::hostResize(size)) >+ return false; >+ >+ return true; >+} >+ >+void AcceleratedSurfaceWin::willRenderFrame() >+{ >+} >+ >+void AcceleratedSurfaceWin::didRenderFrame() >+{ >+ // FIXME: frameComplete() should be called when the frame was actually rendered in the screen. >+ m_client.frameComplete(); >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit/WebProcess/WebPage/win/AcceleratedSurfaceWin.h b/Source/WebKit/WebProcess/WebPage/win/AcceleratedSurfaceWin.h >new file mode 100644 >index 00000000000..90616e820ba >--- /dev/null >+++ b/Source/WebKit/WebProcess/WebPage/win/AcceleratedSurfaceWin.h >@@ -0,0 +1,57 @@ >+/* >+ * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * >+ * 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. ``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 >+ * 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 >+ >+#if PLATFORM(WIN) >+ >+#include "AcceleratedSurface.h" >+ >+namespace WebKit { >+ >+class WebPage; >+ >+class AcceleratedSurfaceWin final : public AcceleratedSurface { >+ WTF_MAKE_NONCOPYABLE(AcceleratedSurfaceWin); WTF_MAKE_FAST_ALLOCATED; >+public: >+ static std::unique_ptr<AcceleratedSurfaceWin> create(WebPage&, Client&); >+ ~AcceleratedSurfaceWin(); >+ >+ uint64_t window() const override; >+ uint64_t surfaceID() const override; >+ bool hostResize(const WebCore::IntSize&) override; >+ >+ void initialize() override; >+ void finalize() override; >+ void willRenderFrame() override; >+ void didRenderFrame() override; >+ >+private: >+ AcceleratedSurfaceWin(WebPage&, Client&); >+}; >+ >+} // namespace WebKit >+ >+#endif // PLATFORM(WIN) >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp b/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp >index a52b120abb2..a09fc04adbd 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp >@@ -25,7 +25,7 @@ > > #include "AcceleratedCompositingContext.h" > >-#if USE(TEXTURE_MAPPER_GL) >+#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > > #include "WebView.h" > >@@ -414,4 +414,4 @@ float AcceleratedCompositingContext::deviceScaleFactor() const > return m_webView.deviceScaleFactor(); > } > >-#endif // USE(TEXTURE_MAPPER_GL) >+#endif // USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h b/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h >index 6bb334d441d..3374d6aa4b9 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h >@@ -26,7 +26,7 @@ > #ifndef AcceleratedCompositingContext_h > #define AcceleratedCompositingContext_h > >-#if USE(TEXTURE_MAPPER_GL) >+#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > > #include <WebCore/FloatRect.h> > #include <WebCore/GLContext.h> >@@ -99,6 +99,6 @@ private: > void applyDeviceScaleFactor(); > }; > >-#endif // TEXTURE_MAPPER_GL >+#endif // TEXTURE_MAPPER_GL && !USE(COORDINATED_GRAPHICS) > > #endif // AcceleratedCompositingContext_h >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index 3ff81cf2089..87975c53a5f 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -197,7 +197,7 @@ > #if USE(CA) > #include <WebCore/CACFLayerTreeHost.h> > #include <WebCore/PlatformCALayer.h> >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > #include "AcceleratedCompositingContext.h" > #endif > >@@ -921,7 +921,7 @@ void WebView::addToDirtyRegion(const IntRect& dirtyRect) > if (isAcceleratedCompositing()) { > #if USE(CA) > m_backingLayer->setNeedsDisplayInRect(dirtyRect); >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > m_acceleratedCompositingContext->setNonCompositedContentsNeedDisplay(dirtyRect); > #endif > return; >@@ -993,7 +993,7 @@ void WebView::scrollBackingStore(FrameView* frameView, int logicalDx, int logica > // any newly-exposed tiles. <http://webkit.org/b/52714> > #if USE(CA) > m_backingLayer->setNeedsDisplayInRect(scrollViewRect); >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > m_acceleratedCompositingContext->scrollNonCompositedContents(scrollViewRect, IntSize(dx, dy)); > #endif > return; >@@ -1071,7 +1071,7 @@ void WebView::sizeChanged(const IntSize& newSize) > m_backingLayer->setSize(newSize); > m_backingLayer->setNeedsDisplay(); > } >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > if (m_acceleratedCompositingContext) > m_acceleratedCompositingContext->resizeRootLayer(newSize); > #endif >@@ -5480,7 +5480,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) > hr = prefsPrivate->acceleratedCompositingEnabled(&enabled); > if (FAILED(hr)) > return hr; >-#if USE(TEXTURE_MAPPER_GL) >+#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > static bool acceleratedCompositingAvailable = AcceleratedCompositingContext::acceleratedCompositingAvailable(); > enabled = enabled && acceleratedCompositingAvailable; > #elif USE(DIRECT2D) >@@ -6487,7 +6487,7 @@ bool WebView::paintCompositedContentToHDC(HDC deviceContext) > > #if USE(CA) > m_layerTreeHost->flushPendingLayerChangesNow(); >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > m_acceleratedCompositingContext->flushAndRenderLayers(); > #endif > >@@ -7149,7 +7149,7 @@ void WebView::setRootChildLayer(GraphicsLayer* layer) > else > m_backingLayer->removeAllChildren(); > >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > if (!m_acceleratedCompositingContext) > return; > m_acceleratedCompositingContext->setRootCompositingLayer(layer); >@@ -7162,7 +7162,7 @@ void WebView::flushPendingGraphicsLayerChangesSoon() > if (!m_layerTreeHost) > return; > m_layerTreeHost->flushPendingGraphicsLayerChangesSoon(); >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > if (!m_acceleratedCompositingContext) > return; > m_acceleratedCompositingContext->flushPendingLayerChangesSoon(); >@@ -7223,7 +7223,7 @@ void WebView::setAcceleratedCompositing(bool accelerated) > m_backingLayer = nullptr; > m_isAcceleratedCompositing = false; > } >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > if (accelerated && !m_acceleratedCompositingContext) > m_acceleratedCompositingContext = std::make_unique<AcceleratedCompositingContext>(*this); > m_isAcceleratedCompositing = accelerated; >diff --git a/Source/WebKitLegacy/win/WebView.h b/Source/WebKitLegacy/win/WebView.h >index c3eb08c4288..ebb23dad768 100644 >--- a/Source/WebKitLegacy/win/WebView.h >+++ b/Source/WebKitLegacy/win/WebView.h >@@ -68,7 +68,7 @@ class WebBackForwardList; > class WebFrame; > class WebInspector; > class WebInspectorClient; >-#if USE(TEXTURE_MAPPER_GL) >+#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > class AcceleratedCompositingContext; > #endif > class WebViewGroup; >@@ -706,7 +706,7 @@ protected: > #if USE(CA) > RefPtr<WebCore::CACFLayerTreeHost> m_layerTreeHost; > RefPtr<WebCore::GraphicsLayer> m_backingLayer; >-#elif USE(TEXTURE_MAPPER_GL) >+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) > std::unique_ptr<AcceleratedCompositingContext> m_acceleratedCompositingContext; > #endif > bool m_isAcceleratedCompositing { false }; >diff --git a/Source/cmake/OptionsWinCairo.cmake b/Source/cmake/OptionsWinCairo.cmake >index 4ad2c4b423a..893ecbe9e48 100644 >--- a/Source/cmake/OptionsWinCairo.cmake >+++ b/Source/cmake/OptionsWinCairo.cmake >@@ -27,8 +27,14 @@ SET_AND_EXPOSE_TO_BUILD(USE_CF ON) > SET_AND_EXPOSE_TO_BUILD(USE_CURL ON) > SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER ON) > SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER_GL ON) >+SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS ON) >+SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS_THREADED ON) >+SET_AND_EXPOSE_TO_BUILD(USE_NICOSIA ON) >+SET_AND_EXPOSE_TO_BUILD(USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR ON) > SET_AND_EXPOSE_TO_BUILD(USE_MEDIA_FOUNDATION ON) > >+SET_AND_EXPOSE_TO_BUILD(ENABLE_ASYNC_SCROLLING ON) >+ > set(ENABLE_GRAPHICS_CONTEXT_3D ON) > set(ENABLE_WEBKIT ON) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186364
:
362273
|
362377
|
362600
|
362601
|
362971
|
363475
|
363575
|
363736
|
364241
|
365947
|
365949
|
369688
|
369820
|
369827
|
369934
|
370239
|
370924
|
391378
|
397177
|
418496