WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP patch
graphics-layer-texture-mapper.patch (text/plain), 21.65 KB, created by
Fujii Hironori
on 2020-05-18 22:20:33 PDT
(
hide
)
Description:
WIP patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2020-05-18 22:20:33 PDT
Size:
21.65 KB
patch
obsolete
>diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake >index a94c7e11ce6..3b94f4dba2c 100644 >--- a/Source/WebKit/PlatformWin.cmake >+++ b/Source/WebKit/PlatformWin.cmake >@@ -81,7 +81,7 @@ list(APPEND WebKit_SOURCES > > WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp > WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >- WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp >+ WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp > > WebProcess/WebPage/win/WebPageWin.cpp > >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp >index 8c80de2f32e..03175baf55b 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp >@@ -114,6 +114,9 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const > #endif > #if USE(WPE_RENDERER) > encoder << hostFileDescriptor; >+#endif >+#if PLATFORM(WIN) >+ encoder << nativeWindowHandle; > #endif > encoder << appleMailPaginationQuirkEnabled; > encoder << appleMailLinesClampEnabled; >@@ -354,6 +357,11 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod > return WTF::nullopt; > #endif > >+#if PLATFORM(WIN) >+ if (!decoder.decode(parameters.nativeWindowHandle)) >+ return WTF::nullopt; >+#endif >+ > if (!decoder.decode(parameters.appleMailPaginationQuirkEnabled)) > return WTF::nullopt; > >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h >index cff31355c1a..ea9fcd4d7ac 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.h >+++ b/Source/WebKit/Shared/WebPageCreationParameters.h >@@ -174,6 +174,9 @@ struct WebPageCreationParameters { > #endif > #if USE(WPE_RENDERER) > IPC::Attachment hostFileDescriptor; >+#endif >+#if PLATFORM(WIN) >+ uint64_t nativeWindowHandle; > #endif > bool appleMailPaginationQuirkEnabled; > bool appleMailLinesClampEnabled; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 9e2484b3435..1b17347b18d 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -7794,6 +7794,10 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc > parameters.hostFileDescriptor = pageClient().hostFileDescriptor(); > #endif > >+#if PLATFORM(WIN) >+ parameters.nativeWindowHandle = reinterpret_cast<uint64_t>(viewWidget()); >+#endif >+ > for (auto& iterator : m_urlSchemeHandlersByScheme) > parameters.urlSchemeHandlers.set(iterator.key, iterator.value->identifier()); > >diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp >index 4a96b5e9988..6d961b668be 100644 >--- a/Source/WebKit/UIProcess/win/WebView.cpp >+++ b/Source/WebKit/UIProcess/win/WebView.cpp >@@ -237,6 +237,7 @@ WebView::WebView(RECT rect, const API::PageConfiguration& configuration, HWND pa > ASSERT(m_isVisible == static_cast<bool>(::GetWindowLong(m_window, GWL_STYLE) & WS_VISIBLE)); > > auto pageConfiguration = configuration.copy(); >+#if 0 > auto* preferences = pageConfiguration->preferences(); > if (!preferences && pageConfiguration->pageGroup()) { > preferences = &pageConfiguration->pageGroup()->preferences(); >@@ -246,6 +247,7 @@ WebView::WebView(RECT rect, const API::PageConfiguration& configuration, HWND pa > // Disable accelerated compositing until it is supported. > preferences->setAcceleratedCompositingEnabled(false); > } >+#endif > > WebProcessPool* processPool = pageConfiguration->processPool(); > m_page = processPool->createWebPage(*m_pageClient, WTFMove(pageConfiguration)); >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >index 28189c82da6..336acf1a43f 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >@@ -95,6 +95,9 @@ void DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect(const IntRect& rect) > { > if (m_layerTreeHost) { > ASSERT(m_dirtyRegion.isEmpty()); >+#if USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >+ m_layerTreeHost->setNonCompositedContentsNeedDisplay(rect); >+#endif > return; > } > >@@ -588,7 +591,7 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay > if (!m_layerTreeStateIsFrozen) > m_layerTreeHost->setLayerFlushSchedulingEnabled(true); > } else { >-#if USE(COORDINATED_GRAPHICS) >+#if USE(COORDINATED_GRAPHICS) || USE(GRAPHICS_LAYER_TEXTURE_MAPPER) > m_layerTreeHost = makeUnique<LayerTreeHost>(m_webPage); > changeWindowScreen(); > #else >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h >index 4a5e21a2e35..34d72104ae9 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h >@@ -39,8 +39,11 @@ > #include <wtf/OptionSet.h> > #include <wtf/RunLoop.h> > >-#if USE(COORDINATED_GRAPHICS) >-#endif >+#if USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >+ >+#include "LayerTreeHostTextureMapper.h" >+ >+#else // USE(GRAPHICS_LAYER_TEXTURE_MAPPER) > > namespace WebCore { > class IntRect; >@@ -223,3 +226,5 @@ inline RefPtr<WebCore::DisplayRefreshMonitor> LayerTreeHost::createDisplayRefres > #endif > > } // namespace WebKit >+ >+#endif // USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp >new file mode 100644 >index 00000000000..57df91bb6d0 >--- /dev/null >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp >@@ -0,0 +1,334 @@ >+/* >+ * Copyright (C) 2020 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. 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 "LayerTreeHostTextureMapper.h" >+ >+#if USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >+ >+#include "WebPage.h" >+#include <GLES2/gl2.h> >+#include <WebCore/Document.h> >+#include <WebCore/Frame.h> >+#include <WebCore/FrameView.h> >+#include <WebCore/GraphicsLayerTextureMapper.h> >+#include <WebCore/Page.h> >+#include <WebCore/Settings.h> >+#include <WebCore/TemporaryOpenGLSetting.h> >+#include <WebCore/TextureMapperGL.h> >+#include <WebCore/TextureMapperLayer.h> >+ >+namespace WebKit { >+using namespace WebCore; >+ >+static IntSize getWebViewSize(HWND window) >+{ >+ RECT r; >+ GetClientRect(window, &r); >+ return { r.right, r.bottom }; >+} >+ >+bool LayerTreeHost::prepareForRendering() >+{ >+ if (!enabled()) >+ return false; >+ >+ if (!m_context) >+ return false; >+ >+ if (!m_context->makeContextCurrent()) >+ return false; >+ >+ return true; >+} >+ >+void LayerTreeHost::compositeLayersToContext() >+{ >+ if (!prepareForRendering()) >+ return; >+ >+ IntSize windowSize = getWebViewSize(window()); >+ glViewport(0, 0, windowSize.width(), windowSize.height()); >+ >+ m_textureMapper->beginPainting(); >+ downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint(); >+ m_fpsCounter.updateFPSAndDisplay(*m_textureMapper); >+ m_textureMapper->endPainting(); >+ >+ m_context->swapBuffers(); >+} >+ >+bool LayerTreeHost::flushPendingLayerChanges() >+{ >+ FrameView* frameView = m_webPage.corePage()->mainFrame().view(); >+ m_rootLayer->flushCompositingStateForThisLayerOnly(); >+ if (!frameView->flushCompositingStateIncludingSubframes()) >+ return false; >+ >+ if (m_overlayCompositingLayer) >+ m_overlayCompositingLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size())); >+ >+ downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers(); >+ return true; >+} >+ >+void LayerTreeHost::layerFlushTimerFired() >+{ >+ flushAndRenderLayers(); >+ >+ if (!enabled()) >+ return; >+ >+ // In case an animation is running, we should flush again soon. >+ if (downcast<GraphicsLayerTextureMapper>(m_rootLayer.get())->layer().descendantsOrSelfHaveRunningAnimations()) >+ scheduleLayerFlush(); >+} >+ >+LayerTreeHost::LayerTreeHost(WebPage& webPage) >+ : m_webPage(webPage) >+ , m_layerFlushTimer(*this, &LayerTreeHost::layerFlushTimerFired) >+{ >+} >+ >+void LayerTreeHost::setLayerFlushSchedulingEnabled(bool) >+{ >+} >+ >+void LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool) >+{ >+} >+ >+void LayerTreeHost::scheduleLayerFlush() >+{ >+ if (!enabled()) >+ return; >+ >+ if (m_layerFlushTimer.isActive()) >+ return; >+ >+ m_layerFlushTimer.startOneShot(16_ms); >+} >+ >+void LayerTreeHost::cancelPendingLayerFlush() >+{ >+ m_layerFlushTimer.stop(); >+} >+ >+void LayerTreeHost::initialize() >+{ >+ if (m_rootLayer) >+ return; >+ >+ IntSize pageSize = getWebViewSize(window()); >+ >+ m_rootLayer = GraphicsLayer::create(nullptr, *this); >+ m_rootLayer->setDrawsContent(true); >+ m_rootLayer->setContentsOpaque(false); >+ m_rootLayer->setSize(pageSize); >+ m_rootLayer->setNeedsDisplay(); >+#ifndef NDEBUG >+ m_rootLayer->setName("Root layer"); >+#endif >+ applyDeviceScaleFactor(); >+ >+ // The creation of the TextureMapper needs an active OpenGL context. >+ if (!m_context) >+ m_context = GLContext::createContextForWindow(window()); >+ >+ if (!m_context) >+ return; >+ >+ m_context->makeContextCurrent(); >+ >+ m_textureMapper = TextureMapperGL::create(); >+ downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get()); >+} >+ >+void LayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* layer) >+{ >+ prepareForRendering(); >+ >+ if (!layer) { >+ cancelPendingLayerFlush(); >+ m_rootLayer = nullptr; >+ m_textureMapper = nullptr; >+ return; >+ } >+ >+ // Add the accelerated layer tree hierarchy. >+ initialize(); >+ if (!enabled()) >+ return; >+ >+ m_rootLayer->removeAllChildren(); >+ m_rootLayer->addChild(*layer); >+ >+ scheduleLayerFlush(); >+} >+ >+void LayerTreeHost::setViewOverlayRootLayer(WebCore::GraphicsLayer* layer) >+{ >+ if (m_overlayCompositingLayer == layer) >+ return; >+ >+ if (m_overlayCompositingLayer) >+ m_overlayCompositingLayer->removeFromParent(); >+ >+ m_overlayCompositingLayer = layer; >+ if (m_overlayCompositingLayer) >+ m_rootLayer->addChild(*m_overlayCompositingLayer); >+} >+ >+void LayerTreeHost::setNonCompositedContentsNeedDisplay(const WebCore::IntRect& rect) >+{ >+ if (!enabled()) >+ return; >+ m_rootLayer->setNeedsDisplayInRect(rect); >+ scheduleLayerFlush(); >+} >+ >+void LayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect& scrollRect) >+{ >+ setNonCompositedContentsNeedDisplay(scrollRect); >+} >+ >+void LayerTreeHost::flushAndRenderLayers() >+{ >+ if (!enabled()) >+ return; >+ >+ m_webPage.corePage()->updateRendering(); >+ >+ if (!enabled()) >+ return; >+ >+ if (m_context && !m_context->makeContextCurrent()) >+ return; >+ >+ if (!flushPendingLayerChanges()) >+ return; >+ >+ compositeLayersToContext(); >+} >+ >+void LayerTreeHost::forceRepaint() >+{ >+ flushAndRenderLayers(); >+} >+ >+bool LayerTreeHost::forceRepaintAsync(CallbackID) >+{ >+ return false; >+} >+ >+void LayerTreeHost::sizeDidChange(const WebCore::IntSize& newSize) >+{ >+ if (!enabled()) >+ return; >+ >+ if (m_rootLayer->size() == newSize) >+ return; >+ m_rootLayer->setSize(newSize); >+ applyDeviceScaleFactor(); >+ >+ scheduleLayerFlush(); >+} >+ >+void LayerTreeHost::pauseRendering() >+{ >+} >+ >+void LayerTreeHost::resumeRendering() >+{ >+} >+ >+WebCore::GraphicsLayerFactory* LayerTreeHost::graphicsLayerFactory() >+{ >+ return nullptr; >+} >+ >+void LayerTreeHost::contentsSizeChanged(const WebCore::IntSize&) >+{ >+} >+ >+void LayerTreeHost::didChangeViewportAttributes(WebCore::ViewportAttributes&&) >+{ >+} >+ >+void LayerTreeHost::setIsDiscardable(bool) >+{ >+} >+ >+void LayerTreeHost::deviceOrPageScaleFactorChanged() >+{ >+} >+ >+RefPtr<WebCore::DisplayRefreshMonitor> LayerTreeHost::createDisplayRefreshMonitor(WebCore::PlatformDisplayID) >+{ >+ return nullptr; >+} >+ >+HWND LayerTreeHost::window() >+{ >+ return reinterpret_cast<HWND>(m_webPage.nativeWindowHandle()); >+} >+ >+bool LayerTreeHost::enabled() >+{ >+ return window() && m_rootLayer && m_textureMapper; >+} >+ >+void LayerTreeHost::paintContents(const GraphicsLayer*, GraphicsContext& context, const FloatRect& rectToPaint, GraphicsLayerPaintBehavior) >+{ >+ context.save(); >+ context.clip(rectToPaint); >+ m_webPage.corePage()->mainFrame().view()->paint(context, enclosingIntRect(rectToPaint)); >+ context.restore(); >+} >+ >+float LayerTreeHost::deviceScaleFactor() const >+{ >+ return m_webPage.corePage()->deviceScaleFactor(); >+} >+ >+void LayerTreeHost::applyDeviceScaleFactor() >+{ >+ if (!m_rootLayer) >+ return; >+ >+ const FloatSize& size = m_rootLayer->size(); >+ >+ TransformationMatrix m; >+ m.scale(deviceScaleFactor()); >+ // Center view >+ double tx = (size.width() - size.width() / deviceScaleFactor()) / 2.0; >+ double ty = (size.height() - size.height() / deviceScaleFactor()) / 2.0; >+ m.translate(tx, ty); >+ m_rootLayer->setTransform(m); >+} >+ >+} // namespace WebKit >+ >+#endif // USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.h >new file mode 100644 >index 00000000000..4b3df10fdf3 >--- /dev/null >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.h >@@ -0,0 +1,109 @@ >+/* >+ * Copyright (C) 2020 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. 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 >+ >+#if USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >+ >+#include "CallbackID.h" >+#include "LayerTreeContext.h" >+#include <WebCore/DisplayRefreshMonitor.h> >+#include <WebCore/GLContext.h> >+#include <WebCore/GraphicsLayerClient.h> >+#include <WebCore/PlatformScreen.h> >+#include <WebCore/TextureMapperFPSCounter.h> >+#include <WebCore/Timer.h> >+#include <wtf/Forward.h> >+ >+namespace WebCore { >+class GraphicsLayer; >+class GraphicsLayerFactory; >+class IntRect; >+class IntSize; >+class Page; >+struct ViewportAttributes; >+} >+ >+namespace WebKit { >+ >+class WebPage; >+ >+class LayerTreeHost : public WebCore::GraphicsLayerClient { >+ WTF_MAKE_FAST_ALLOCATED; >+public: >+ explicit LayerTreeHost(WebPage&); >+ >+ const LayerTreeContext& layerTreeContext() const { return m_layerTreeContext; } >+ void setLayerFlushSchedulingEnabled(bool); >+ void setShouldNotifyAfterNextScheduledLayerFlush(bool); >+ void scheduleLayerFlush(); >+ void cancelPendingLayerFlush(); >+ void setRootCompositingLayer(WebCore::GraphicsLayer*); >+ void setViewOverlayRootLayer(WebCore::GraphicsLayer*); >+ void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&); >+ void scrollNonCompositedContents(const WebCore::IntRect&); >+ void forceRepaint(); >+ bool forceRepaintAsync(CallbackID); >+ void sizeDidChange(const WebCore::IntSize& newSize); >+ void pauseRendering(); >+ void resumeRendering(); >+ WebCore::GraphicsLayerFactory* graphicsLayerFactory(); >+ void contentsSizeChanged(const WebCore::IntSize&); >+ void didChangeViewportAttributes(WebCore::ViewportAttributes&&); >+ void setIsDiscardable(bool); >+ void deviceOrPageScaleFactorChanged(); >+ RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID); >+ WebCore::PlatformDisplayID displayID() const { return m_displayID; } >+ >+private: >+ // GraphicsLayerClient >+ void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaintBehavior) override; >+ float deviceScaleFactor() const override; >+ >+ void initialize(); >+ HWND window(); >+ bool enabled(); >+ void compositeLayersToContext(); >+ void flushAndRenderLayers(); >+ bool flushPendingLayerChanges(); >+ void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); >+ void layerFlushTimerFired(); >+ bool prepareForRendering(); >+ void applyDeviceScaleFactor(); >+ >+ WebPage& m_webPage; >+ std::unique_ptr<WebCore::GLContext> m_context; >+ LayerTreeContext m_layerTreeContext; >+ WebCore::PlatformDisplayID m_displayID; >+ RefPtr<WebCore::GraphicsLayer> m_rootLayer; >+ WebCore::GraphicsLayer* m_overlayCompositingLayer { nullptr }; >+ std::unique_ptr<WebCore::TextureMapper> m_textureMapper; >+ WebCore::TextureMapperFPSCounter m_fpsCounter; >+ WebCore::Timer m_layerFlushTimer; >+}; >+ >+} // namespace WebKit >+ >+#endif // USE(GRAPHICS_LAYER_TEXTURE_MAPPER) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 8ba9342bc0f..969f87f8a3e 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -427,6 +427,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > , m_viewGestureGeometryCollector(makeUnique<ViewGestureGeometryCollector>(*this)) > #elif ENABLE(ACCESSIBILITY) && PLATFORM(GTK) > , m_accessibilityObject(nullptr) >+#endif >+#if PLATFORM(WIN) >+ , m_nativeWindowHandle(parameters.nativeWindowHandle) > #endif > , m_setCanStartMediaTimer(RunLoop::main(), this, &WebPage::setCanStartMediaTimerFired) > #if ENABLE(CONTEXT_MENUS) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 15f28cf2673..51463dfa88f 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -1328,6 +1328,10 @@ public: > void removeMediaUsageManagerSession(WebCore::MediaSessionIdentifier); > #endif > >+#if PLATFORM(WIN) >+ uint64_t nativeWindowHandle() { return m_nativeWindowHandle; } >+#endif >+ > private: > WebPage(WebCore::PageIdentifier, WebPageCreationParameters&&); > >@@ -1822,6 +1826,10 @@ private: > GRefPtr<AtkObject> m_accessibilityObject; > #endif > >+#if PLATFORM(WIN) >+ uint64_t m_nativeWindowHandle { 0 }; >+#endif >+ > #if !PLATFORM(IOS_FAMILY) > RefPtr<PageBanner> m_headerBanner; > RefPtr<PageBanner> m_footerBanner; >diff --git a/Source/WebKit/WebProcess/win/WebProcessMainWin.cpp b/Source/WebKit/WebProcess/win/WebProcessMainWin.cpp >index f0ea5c5703b..e32f334aeb7 100644 >--- a/Source/WebKit/WebProcess/win/WebProcessMainWin.cpp >+++ b/Source/WebKit/WebProcess/win/WebProcessMainWin.cpp >@@ -37,6 +37,7 @@ class WebProcessMainWin final : public AuxiliaryProcessMainBase { > public: > bool platformInitialize() override > { >+ SetProcessDPIAware(); > return true; > } > }; >diff --git a/Source/cmake/OptionsWinCairo.cmake b/Source/cmake/OptionsWinCairo.cmake >index 35edf853f89..113170ce211 100644 >--- a/Source/cmake/OptionsWinCairo.cmake >+++ b/Source/cmake/OptionsWinCairo.cmake >@@ -39,6 +39,7 @@ set(USE_ANGLE_EGL ON) > SET_AND_EXPOSE_TO_BUILD(USE_CAIRO ON) > SET_AND_EXPOSE_TO_BUILD(USE_CF ON) > SET_AND_EXPOSE_TO_BUILD(USE_CURL ON) >+SET_AND_EXPOSE_TO_BUILD(USE_GRAPHICS_LAYER_TEXTURE_MAPPER ON) > SET_AND_EXPOSE_TO_BUILD(USE_EGL ON) > SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES ON) > SET_AND_EXPOSE_TO_BUILD(HAVE_OPENGL_ES_3 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 211883
:
399337
|
399339
|
399409
|
399455
|
399710
|
399942
|
400178