Changeset 285099 in webkit
- Timestamp:
- Oct 31, 2021, 5:56:28 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 18 added
- 25 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r285026 r285099 1 2021-10-31 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [WinCairo] New GraphicsLayer for GPU process mode 4 https://bugs.webkit.org/show_bug.cgi?id=228308 5 6 Reviewed by Don Olmstead. 7 8 * Source/cmake/OptionsWinCairo.cmake: 9 1 10 2021-10-29 Oriol Brufau <obrufau@igalia.com> 2 11 -
trunk/Source/WebCore/ChangeLog
r285098 r285099 1 2021-10-31 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [WinCairo] New GraphicsLayer for GPU process mode 4 https://bugs.webkit.org/show_bug.cgi?id=228308 5 6 Reviewed by Don Olmstead. 7 8 * PlatformWinCairo.cmake: 9 * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: 10 * platform/graphics/RemoteGraphicsContextGLProxyBase.h: 11 * platform/graphics/wc/RemoteGraphicsContextGLProxyBaseWC.cpp: Added. 12 (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): 13 (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): 14 (WebCore::RemoteGraphicsContextGLProxyBase::setPlatformLayer): 15 * platform/graphics/wc/WCPlatformLayer.h: Added. 16 * platform/graphics/win/GraphicsContextWin.cpp: 17 (WebCore::GraphicsContext::getWindowsContext): DisplayList 18 GraphicsContext doesn't have a HDC. Do nothing for DisplayList 19 context. 20 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: 21 (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): 22 Paint a frame by using GraphicsContext::drawNativeImage instead of 23 Cairo API for DisplayList. 24 1 25 2021-10-31 Cameron McCormack <heycam@apple.com> 2 26 -
trunk/Source/WebCore/PlatformWinCairo.cmake
r283199 r285099 13 13 "${WEBCORE_DIR}/loader/archive/cf" 14 14 "${WEBCORE_DIR}/platform/cf" 15 "${WEBCORE_DIR}/platform/graphics/wc" 15 16 ) 16 17 … … 24 25 25 26 platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp 27 28 platform/graphics/wc/RemoteGraphicsContextGLProxyBaseWC.cpp 26 29 27 30 platform/graphics/win/FontCustomPlatformDataCairo.cpp … … 43 46 platform/win/ImportedModulesEnumerator.cpp 44 47 platform/win/PEImage.cpp 48 ) 49 50 list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS 51 platform/graphics/wc/WCPlatformLayer.h 45 52 ) 46 53 -
trunk/Source/WebCore/platform/graphics/RemoteGraphicsContextGLProxyBase.cpp
r284371 r285099 32 32 #if PLATFORM(COCOA) 33 33 #include "IOSurface.h" 34 #endif 35 36 #if USE(GRAPHICS_LAYER_WC) 37 #include "TextureMapperPlatformLayer.h" 34 38 #endif 35 39 … … 131 135 } 132 136 133 #if !PLATFORM(COCOA) 137 #if !PLATFORM(COCOA) && !USE(GRAPHICS_LAYER_WC) 134 138 void RemoteGraphicsContextGLProxyBase::platformInitialize() 135 139 { -
trunk/Source/WebCore/platform/graphics/RemoteGraphicsContextGLProxyBase.h
r284371 r285099 97 97 RetainPtr<WebGLLayer> m_webGLLayer; 98 98 std::unique_ptr<IOSurface> m_displayBuffer; 99 #elif USE(GRAPHICS_LAYER_WC) 100 void setPlatformLayer(PlatformLayerContainer&&); 101 PlatformLayerContainer m_platformLayer; 99 102 #endif 100 103 private: -
trunk/Source/WebCore/platform/graphics/wc/WCPlatformLayer.h
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 24 24 */ 25 25 26 #include "config.h" 27 #include "GPUProcessMain.h" 26 #pragma once 28 27 29 #i f ENABLE(GPU_PROCESS)28 #include "TextureMapperPlatformLayer.h" 30 29 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 30 namespace WebCore { 33 31 34 namespace WebKit { 32 class WCPlatformLayer : public TextureMapperPlatformLayer { 33 WTF_MAKE_FAST_ALLOCATED; 35 34 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 35 private: 36 // TextureMapperPlatformLayer 37 void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) final { } 37 38 }; 38 39 39 int GPUProcessMain(int argc, char** argv)40 {41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv);42 }43 44 40 } // namespace WebKit 45 46 #endif // ENABLE(GPU_PROCESS) -
trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp
r284201 r285099 54 54 HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend) 55 55 { 56 if (!hasPlatformContext()) 57 return nullptr; 56 58 HDC hdc = nullptr; 57 59 #if !USE(CAIRO) -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp
r284439 r285099 2858 2858 2859 2859 cairo_surface_t* image = nullptr; 2860 if (cairoFormat != CAIRO_FORMAT_INVALID) 2861 image = cairo_image_surface_create_for_data(static_cast<unsigned char*>(data), cairoFormat, width, height, pitch); 2862 2863 FloatRect srcRect(0, 0, width, height); 2864 if (image) { 2865 ASSERT(context.hasPlatformContext()); 2866 auto& state = context.state(); 2867 Cairo::drawSurface(*context.platformContext(), image, destRect, srcRect, state.imageInterpolationQuality, state.alpha, Cairo::ShadowState(state)); 2868 cairo_surface_destroy(image); 2860 if (cairoFormat != CAIRO_FORMAT_INVALID) { 2861 auto surface = adoptRef(cairo_image_surface_create_for_data(static_cast<unsigned char*>(data), cairoFormat, width, height, pitch)); 2862 auto image = NativeImage::create(WTFMove(surface)); 2863 FloatRect srcRect(0, 0, width, height); 2864 context.drawNativeImage(*image, srcRect.size(), destRect, srcRect); 2869 2865 } 2870 2866 #else -
trunk/Source/WebKit/ChangeLog
r285094 r285099 1 2021-10-31 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [WinCairo] New GraphicsLayer for GPU process mode 4 https://bugs.webkit.org/show_bug.cgi?id=228308 5 6 Reviewed by Don Olmstead. 7 8 Added a new GraphicsLayer implementation GraphicsLayerWC which 9 transfers GraphicsLayer tree to GPU process and runs the 10 compositor (TextureMapper) in GPU process. 11 12 In GPU process mode, WebGL is run in GPU process. So, the 13 compositor should be run in GPU process. Otherwise, the output 14 texture of WebGL has to be transferred from GPU process to the 15 compositor process (UI process or web process). 16 17 Because ANGLE isn't thread-safe, the compositor and WebGL should 18 be run in the same thread in GPU process. 19 20 Enabling gpu_process_webgl also enables GPU process compositing now. 21 > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_webgl /t REG_DWORD /d 1 /f 22 23 gpu_process_canvas_rendering can also be enabled. 24 > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_canvas_rendering /t REG_DWORD /d 1 /f 25 26 Enabling gpu_process_dom_rendering is still experimental. 27 > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_dom_rendering /t REG_DWORD /d 1 /f 28 29 The following commands restore the non-GPU process mode. 30 > reg delete HKEY_CURRENT_USER\Software\WebKit /v gpu_process_canvas_rendering /f 31 > reg delete HKEY_CURRENT_USER\Software\WebKit /v gpu_process_webgl /f 32 > reg delete HKEY_CURRENT_USER\Software\WebKit /v gpu_process_dom_rendering /f 33 34 * GPUProcess/GPUConnectionToWebProcess.cpp: 35 (WebKit::GPUConnectionToWebProcess::createWCLayerTreeHost): 36 (WebKit::GPUConnectionToWebProcess::releaseWCLayerTreeHost): 37 (WebKit::GPUConnectionToWebProcess::findRemoteGraphicsContextGL): 38 * GPUProcess/GPUConnectionToWebProcess.h: 39 * GPUProcess/GPUConnectionToWebProcess.messages.in: 40 * GPUProcess/GPUProcess.h: 41 (WebKit::GPUProcess::sharedSceneContext): 42 * GPUProcess/graphics/RemoteGraphicsContextGL.h: 43 (WebKit::RemoteGraphicsContextGL::platformLayer const): 44 * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.cpp: 45 (WebKit::ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources): 46 * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp: Added. 47 (WebKit::RemoteWCLayerTreeHost::create): 48 (WebKit::RemoteWCLayerTreeHost::RemoteWCLayerTreeHost): 49 (WebKit::RemoteWCLayerTreeHost::~RemoteWCLayerTreeHost): 50 (WebKit::RemoteWCLayerTreeHost::messageSenderConnection const): 51 (WebKit::RemoteWCLayerTreeHost::messageSenderDestinationID const): 52 (WebKit::RemoteWCLayerTreeHost::update): 53 * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h: Added. 54 * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.messages.in: Added. 55 * GPUProcess/graphics/wc/WCScene.cpp: Added. 56 (WebKit::WCScene::initialize): 57 (WebKit::WCScene::~WCScene): 58 (WebKit::WCScene::update): 59 * GPUProcess/graphics/wc/WCScene.h: Added. 60 * GPUProcess/graphics/wc/WCSceneContext.cpp: Added. 61 (WebKit::WCSceneContext::WCSceneContext): 62 (WebKit::WCSceneContext::makeContextCurrent): 63 (WebKit::WCSceneContext::createTextureMapper): 64 (WebKit::WCSceneContext::swapBuffers): 65 * GPUProcess/graphics/wc/WCSceneContext.h: Added. 66 * GPUProcess/graphics/wc/WCSharedSceneContextHolder.h: Added. 67 (WebKit::WCSharedSceneContextHolder::ensureHolderForWindow): 68 (WebKit::WCSharedSceneContextHolder::removeHolder): 69 * GPUProcess/win/GPUProcessMainWin.cpp: 70 (WebKit::GPUProcessMain): 71 * PlatformWin.cmake: 72 * Scripts/webkit/messages.py: 73 (types_that_cannot_be_forward_declared): 74 (conditions_for_header): 75 * Shared/DrawingAreaInfo.h: 76 * UIProcess/wc/DrawingAreaProxyWC.cpp: Added. 77 (WebKit::DrawingAreaProxyWC::DrawingAreaProxyWC): 78 (WebKit::DrawingAreaProxyWC::paint): 79 (WebKit::DrawingAreaProxyWC::sizeDidChange): 80 (WebKit::DrawingAreaProxyWC::update): 81 (WebKit::DrawingAreaProxyWC::enterAcceleratedCompositingMode): 82 (WebKit::DrawingAreaProxyWC::incorporateUpdate): 83 (WebKit::DrawingAreaProxyWC::discardBackingStore): 84 * UIProcess/wc/DrawingAreaProxyWC.h: Added. 85 * UIProcess/win/PageClientImpl.cpp: 86 (WebKit::PageClientImpl::createDrawingAreaProxy): 87 * UIProcess/win/WebView.cpp: 88 (WebKit::WebView::paint): 89 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: 90 (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): 91 * WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.cpp: Added. 92 (WebKit::RemoteWCLayerTreeHostProxy::RemoteWCLayerTreeHostProxy): 93 (WebKit::RemoteWCLayerTreeHostProxy::~RemoteWCLayerTreeHostProxy): 94 (WebKit::RemoteWCLayerTreeHostProxy::messageSenderConnection const): 95 (WebKit::RemoteWCLayerTreeHostProxy::ensureGPUProcessConnection): 96 (WebKit::RemoteWCLayerTreeHostProxy::disconnectGpuProcessIfNeeded): 97 (WebKit::RemoteWCLayerTreeHostProxy::gpuProcessConnectionDidClose): 98 (WebKit::RemoteWCLayerTreeHostProxy::messageSenderDestinationID const): 99 (WebKit::RemoteWCLayerTreeHostProxy::update): 100 (WebKit::RemoteWCLayerTreeHostProxy::didUpdate): 101 * WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.h: Added. 102 (WebKit::RemoteWCLayerTreeHostProxy::wcLayerTreeHostIdentifier const): 103 * WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.messages.in: Added. 104 * WebProcess/GPU/graphics/wc/WCLayerTreeHostIdentifier.h: Added. 105 * WebProcess/GPU/graphics/wc/WCPlatformLayerGCGL.h: Added. 106 (WebKit::WCPlatformLayerGCGL::WCPlatformLayerGCGL): 107 (WebKit::WCPlatformLayerGCGL::graphicsContextGLIdentifier): 108 * WebProcess/WebPage/DrawingArea.cpp: 109 (WebKit::DrawingArea::create): 110 (WebKit::DrawingArea::supportsGPUProcessRendering): 111 * WebProcess/WebPage/DrawingArea.h: 112 (WebKit::DrawingArea::updateGeometry): 113 * WebProcess/WebPage/DrawingArea.messages.in: 114 * WebProcess/WebPage/wc/DrawingAreaWC.cpp: Added. 115 (WebKit::DrawingAreaWC::DrawingAreaWC): 116 (WebKit::DrawingAreaWC::~DrawingAreaWC): 117 (WebKit::DrawingAreaWC::graphicsLayerFactory): 118 (WebKit::DrawingAreaWC::updateRootLayers): 119 (WebKit::DrawingAreaWC::setRootCompositingLayer): 120 (WebKit::DrawingAreaWC::attachViewOverlayGraphicsLayer): 121 (WebKit::DrawingAreaWC::setLayerTreeStateIsFrozen): 122 (WebKit::DrawingAreaWC::updateGeometry): 123 (WebKit::DrawingAreaWC::setNeedsDisplay): 124 (WebKit::DrawingAreaWC::setNeedsDisplayInRect): 125 (WebKit::DrawingAreaWC::scroll): 126 (WebKit::DrawingAreaWC::triggerRenderingUpdate): 127 (WebKit::flushLayerImageBuffers): 128 (WebKit::DrawingAreaWC::isCompositingMode): 129 (WebKit::DrawingAreaWC::updateRendering): 130 (WebKit::DrawingAreaWC::sendUpdateAC): 131 (WebKit::shouldPaintBoundsRect): 132 (WebKit::DrawingAreaWC::sendUpdateNonAC): 133 (WebKit::DrawingAreaWC::graphicsLayerAdded): 134 (WebKit::DrawingAreaWC::graphicsLayerRemoved): 135 (WebKit::DrawingAreaWC::commitLayerUpateInfo): 136 (WebKit::DrawingAreaWC::createImageBuffer): 137 (WebKit::DrawingAreaWC::didUpdate): 138 (WebKit::DrawingAreaWC::RootLayerClient::RootLayerClient): 139 (WebKit::DrawingAreaWC::RootLayerClient::paintContents): 140 (WebKit::DrawingAreaWC::RootLayerClient::deviceScaleFactor const): 141 * WebProcess/WebPage/wc/DrawingAreaWC.h: Added. 142 * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: Added. 143 (WebKit::GraphicsLayerWC::GraphicsLayerWC): 144 (WebKit::GraphicsLayerWC::~GraphicsLayerWC): 145 (WebKit::GraphicsLayerWC::generateLayerID): 146 (WebKit::GraphicsLayerWC::primaryLayerID const): 147 (WebKit::GraphicsLayerWC::setNeedsDisplay): 148 (WebKit::GraphicsLayerWC::setNeedsDisplayInRect): 149 (WebKit::GraphicsLayerWC::setContentsNeedsDisplay): 150 (WebKit::GraphicsLayerWC::setChildren): 151 (WebKit::GraphicsLayerWC::addChild): 152 (WebKit::GraphicsLayerWC::addChildAtIndex): 153 (WebKit::GraphicsLayerWC::addChildBelow): 154 (WebKit::GraphicsLayerWC::addChildAbove): 155 (WebKit::GraphicsLayerWC::replaceChild): 156 (WebKit::GraphicsLayerWC::removeFromParent): 157 (WebKit::GraphicsLayerWC::setMaskLayer): 158 (WebKit::GraphicsLayerWC::setReplicatedLayer): 159 (WebKit::GraphicsLayerWC::setReplicatedByLayer): 160 (WebKit::GraphicsLayerWC::setPosition): 161 (WebKit::GraphicsLayerWC::setAnchorPoint): 162 (WebKit::GraphicsLayerWC::setSize): 163 (WebKit::GraphicsLayerWC::setBoundsOrigin): 164 (WebKit::GraphicsLayerWC::setTransform): 165 (WebKit::GraphicsLayerWC::setChildrenTransform): 166 (WebKit::GraphicsLayerWC::setPreserves3D): 167 (WebKit::GraphicsLayerWC::setMasksToBounds): 168 (WebKit::GraphicsLayerWC::setOpacity): 169 (WebKit::GraphicsLayerWC::setContentsRect): 170 (WebKit::GraphicsLayerWC::setContentsClippingRect): 171 (WebKit::GraphicsLayerWC::setDrawsContent): 172 (WebKit::GraphicsLayerWC::setContentsVisible): 173 (WebKit::GraphicsLayerWC::setBackfaceVisibility): 174 (WebKit::GraphicsLayerWC::setContentsToSolidColor): 175 (WebKit::GraphicsLayerWC::setContentsToPlatformLayer): 176 (WebKit::GraphicsLayerWC::usesContentsLayer const): 177 (WebKit::GraphicsLayerWC::setShowDebugBorder): 178 (WebKit::GraphicsLayerWC::setDebugBorder): 179 (WebKit::GraphicsLayerWC::setShowRepaintCounter): 180 (WebKit::filtersCanBeComposited): 181 (WebKit::GraphicsLayerWC::setFilters): 182 (WebKit::GraphicsLayerWC::setBackdropFilters): 183 (WebKit::GraphicsLayerWC::setBackdropFiltersRect): 184 (WebKit::GraphicsLayerWC::noteLayerPropertyChanged): 185 (WebKit::GraphicsLayerWC::flushCompositingState): 186 (WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly): 187 * WebProcess/WebPage/wc/GraphicsLayerWC.h: Added. 188 * WebProcess/WebPage/wc/WCBackingStore.h: Added. 189 (WebKit::WCBackingStore::WCBackingStore): 190 (WebKit::WCBackingStore::imageBuffer): 191 (WebKit::WCBackingStore::setImageBuffer): 192 (WebKit::WCBackingStore::bitmap const): 193 (WebKit::WCBackingStore::encode const): 194 (WebKit::WCBackingStore::decode): 195 * WebProcess/WebPage/wc/WCLayerFactory.cpp: Added. 196 (WebKit::WCLayerFactory::WCLayerFactory): 197 (WebKit::WCLayerFactory::createGraphicsLayer): 198 * WebProcess/WebPage/wc/WCLayerFactory.h: Added. 199 * WebProcess/WebPage/wc/WCUpateInfo.h: Added. 200 (WebKit::WCLayerUpateInfo::encode const): 201 (WebKit::WCLayerUpateInfo::decode): 202 (WebKit::WCUpateInfo::encode const): 203 (WebKit::WCUpateInfo::decode): 204 1 205 2021-10-31 Simon Fraser <simon.fraser@apple.com> 2 206 -
trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
r284786 r285099 144 144 #endif 145 145 146 #if USE(GRAPHICS_LAYER_WC) 147 #include "RemoteWCLayerTreeHost.h" 148 #endif 149 146 150 namespace WebKit { 147 151 using namespace WebCore; … … 337 341 } 338 342 343 #if USE(GRAPHICS_LAYER_WC) 344 void GPUConnectionToWebProcess::createWCLayerTreeHost(WebKit::WCLayerTreeHostIdentifier identifier, uint64_t nativeWindow) 345 { 346 auto addResult = m_remoteWCLayerTreeHostMap.add(identifier, RemoteWCLayerTreeHost::create(*this, WTFMove(identifier), nativeWindow)); 347 ASSERT_UNUSED(addResult, addResult.isNewEntry); 348 } 349 350 void GPUConnectionToWebProcess::releaseWCLayerTreeHost(WebKit::WCLayerTreeHostIdentifier identifier) 351 { 352 m_remoteWCLayerTreeHostMap.remove(identifier); 353 } 354 355 RefPtr<RemoteGraphicsContextGL> GPUConnectionToWebProcess::findRemoteGraphicsContextGL(GraphicsContextGLIdentifier identifier) 356 { 357 ASSERT(RunLoop::isMain()); 358 auto iter = m_remoteGraphicsContextGLMap.find(identifier); 359 if (iter == m_remoteGraphicsContextGLMap.end()) 360 return nullptr; 361 return iter->value.get(); 362 } 363 #endif 364 339 365 bool GPUConnectionToWebProcess::allowsExitUnderMemoryPressure() const 340 366 { -
trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h
r284786 r285099 56 56 #if PLATFORM(COCOA) 57 57 #include <pal/spi/cocoa/TCCSPI.h> 58 #endif 59 60 #if USE(GRAPHICS_LAYER_WC) 61 #include "WCLayerTreeHostIdentifier.h" 58 62 #endif 59 63 … … 92 96 struct RemoteRenderingBackendCreationParameters; 93 97 98 #if USE(GRAPHICS_LAYER_WC) 99 class RemoteWCLayerTreeHost; 100 #endif 101 94 102 class GPUConnectionToWebProcess 95 103 : public ThreadSafeRefCounted<GPUConnectionToWebProcess, WTF::DestructionThread::Main> … … 162 170 #endif 163 171 172 #if USE(GRAPHICS_LAYER_WC) 173 RefPtr<RemoteGraphicsContextGL> findRemoteGraphicsContextGL(GraphicsContextGLIdentifier); 174 #endif 175 164 176 void updateSupportedRemoteCommands(); 165 177 … … 229 241 void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel); 230 242 243 #if USE(GRAPHICS_LAYER_WC) 244 void createWCLayerTreeHost(WebKit::WCLayerTreeHostIdentifier, uint64_t nativeWindow); 245 void releaseWCLayerTreeHost(WebKit::WCLayerTreeHostIdentifier); 246 #endif 247 231 248 // IPC::Connection::Client 232 249 void didClose(IPC::Connection&) final; … … 310 327 RemoteAudioHardwareListenerMap m_remoteAudioHardwareListenerMap; 311 328 329 #if USE(GRAPHICS_LAYER_WC) 330 using RemoteWCLayerTreeHostMap = HashMap<WCLayerTreeHostIdentifier, std::unique_ptr<RemoteWCLayerTreeHost>>; 331 RemoteWCLayerTreeHostMap m_remoteWCLayerTreeHostMap; 332 #endif 333 312 334 RefPtr<RemoteRemoteCommandListenerProxy> m_remoteRemoteCommandListener; 313 335 bool m_isActiveNowPlayingProcess { false }; -
trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in
r284079 r285099 52 52 SetUserPreferredLanguages(Vector<String> languages) 53 53 ConfigureLoggingChannel(String channelName, enum:uint8_t WTFLogChannelState state, enum:uint8_t WTFLogLevel level) 54 #if USE(GRAPHICS_LAYER_WC) 55 CreateWCLayerTreeHost(WebKit::WCLayerTreeHostIdentifier identifier, uint64_t nativeWindow) 56 ReleaseWCLayerTreeHost(WebKit::WCLayerTreeHostIdentifier identifier) 57 #endif 54 58 } 55 59 -
trunk/Source/WebKit/GPUProcess/GPUProcess.h
r284786 r285099 43 43 #endif 44 44 45 #if USE(GRAPHICS_LAYER_WC) 46 #include "WCSharedSceneContextHolder.h" 47 #endif 48 45 49 namespace WebCore { 46 50 class NowPlayingManager; … … 91 95 #if USE(LIBWEBRTC) && PLATFORM(COCOA) 92 96 WorkQueue& libWebRTCCodecsQueue(); 97 #endif 98 99 #if USE(GRAPHICS_LAYER_WC) 100 WCSharedSceneContextHolder& sharedSceneContext() { return m_sharedSceneContext; } 93 101 #endif 94 102 … … 187 195 #endif 188 196 197 #if USE(GRAPHICS_LAYER_WC) 198 WCSharedSceneContextHolder m_sharedSceneContext; 199 #endif 200 189 201 struct GPUSession { 190 202 String mediaCacheDirectory; -
trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h
r284371 r285099 68 68 #endif 69 69 70 #if USE(GRAPHICS_LAYER_WC) 71 PlatformLayer* platformLayer() const { return m_context->platformLayer(); } 72 #endif 73 70 74 protected: 71 75 RemoteGraphicsContextGL(GPUConnectionToWebProcess&, GraphicsContextGLIdentifier, RemoteRenderingBackend&, IPC::StreamConnectionBuffer&&); -
trunk/Source/WebKit/GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.cpp
r283703 r285099 43 43 void ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources() 44 44 { 45 #if !USE(GRAPHICS_LAYER_WC) 45 46 if (didScheduleFreeWebGLRenderingResources) 46 47 return; 47 48 RunLoop::main().dispatchAfter(freeWebGLRenderingResourcesTimeout, freeWebGLRenderingResources); 48 49 didScheduleFreeWebGLRenderingResources = true; 50 #endif 49 51 } 50 52 -
trunk/Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h
r285098 r285099 1 1 /* 2 * Copyright (C) 20 10 Apple Inc. All rights reserved.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include <wtf/EnumTraits.h> 29 #include <wtf/ObjectIdentifier.h> 28 #if USE(GRAPHICS_LAYER_WC) 29 30 #include "Connection.h" 31 #include "MessageReceiver.h" 32 #include "MessageSender.h" 33 #include "WCLayerTreeHostIdentifier.h" 34 #include "WCSharedSceneContextHolder.h" 30 35 31 36 namespace WebKit { 37 class GPUConnectionToWebProcess; 38 class WCScene; 39 struct WCUpateInfo; 32 40 33 enum class DrawingAreaType : uint8_t { 34 #if PLATFORM(COCOA) 35 #if !PLATFORM(IOS_FAMILY) 36 TiledCoreAnimation, 37 #endif 38 RemoteLayerTree, 39 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 40 CoordinatedGraphics 41 #endif 41 class RemoteWCLayerTreeHost : public IPC::MessageReceiver, private IPC::MessageSender { 42 WTF_MAKE_FAST_ALLOCATED; 43 public: 44 static std::unique_ptr<RemoteWCLayerTreeHost> create(GPUConnectionToWebProcess&, WebKit::WCLayerTreeHostIdentifier, uint64_t nativeWindow); 45 RemoteWCLayerTreeHost(GPUConnectionToWebProcess&, WebKit::WCLayerTreeHostIdentifier, uint64_t nativeWindow); 46 ~RemoteWCLayerTreeHost(); 47 // message handlers 48 void update(WCUpateInfo&&); 49 50 private: 51 // IPC::MessageReceiver 52 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; 53 // IPC::MessageSender 54 IPC::Connection* messageSenderConnection() const override; 55 uint64_t messageSenderDestinationID() const override; 56 57 WeakPtr<GPUConnectionToWebProcess> m_connectionToWebProcess; 58 WCLayerTreeHostIdentifier m_identifier; 59 RefPtr<WCSharedSceneContextHolder::Holder> m_sharedSceneContextHolder; 60 std::unique_ptr<WCScene> m_scene; 42 61 }; 43 44 enum {45 ActivityStateChangeAsynchronous = 046 };47 typedef uint64_t ActivityStateChangeID;48 49 enum DrawingAreaIdentifierType { };50 using DrawingAreaIdentifier = ObjectIdentifier<DrawingAreaIdentifierType>;51 62 52 63 } // namespace WebKit 53 64 54 namespace WTF { 55 56 template<> struct EnumTraits<WebKit::DrawingAreaType> { 57 using values = EnumValues< 58 WebKit::DrawingAreaType 59 #if PLATFORM(COCOA) 60 #if !PLATFORM(IOS_FAMILY) 61 , WebKit::DrawingAreaType::TiledCoreAnimation 62 #endif 63 , WebKit::DrawingAreaType::RemoteLayerTree 64 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 65 , WebKit::DrawingAreaType::CoordinatedGraphics 66 #endif 67 >; 68 }; 69 70 } // namespace WTF 65 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.messages.in
r285098 r285099 1 # Copyright (C) 20 10-2018 Apple Inc. All rights reserved.1 # Copyright (C) 2021 Sony Interactive Entertainment Inc. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 21 21 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 22 23 messages -> DrawingArea NotRefCounted { 24 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 25 UpdateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, WebCore::IntSize size, WebCore::IntSize scrollOffset) 26 #endif 23 #if USE(GRAPHICS_LAYER_WC) 27 24 28 DidUpdate() 25 messages -> RemoteWCLayerTreeHost NotRefCounted { 26 Update(struct WebKit::WCUpateInfo updateInfo) 27 } 29 28 30 #if PLATFORM(COCOA) 31 // Used by TiledCoreAnimationDrawingArea. 32 UpdateGeometry(WebCore::IntSize viewSize, bool flushSynchronously, MachSendRight fencePort) 33 SetDeviceScaleFactor(float deviceScaleFactor) 34 SetColorSpace(struct std::optional<WebCore::DestinationColorSpace> colorSpace) 35 SetViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) 36 37 AcceleratedAnimationDidStart(uint64_t layerID, String key, MonotonicTime startTime) 38 AcceleratedAnimationDidEnd(uint64_t layerID, String key) 39 40 AddTransactionCallbackID(WebKit::CallbackID callbackID) 41 #endif 42 43 #if PLATFORM(COCOA) || PLATFORM(GTK) 44 AdjustTransientZoom(double scale, WebCore::FloatPoint origin) 45 CommitTransientZoom(double scale, WebCore::FloatPoint origin) 46 #endif 47 } 29 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/GPUProcess/graphics/wc/WCScene.h
r285098 r285099 1 1 /* 2 * Copyright (C) 20 10 Apple Inc. All rights reserved.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include <wtf/EnumTraits.h> 29 #include <wtf/ObjectIdentifier.h> 28 #if USE(GRAPHICS_LAYER_WC) 29 30 #include <WebCore/TextureMapperFPSCounter.h> 31 #include <wtf/Forward.h> 32 #include <wtf/HashMap.h> 33 34 namespace WebCore { 35 class TextureMapper; 36 class TextureMapperLayer; 37 class TextureMapperTiledBackingStore; 38 } 30 39 31 40 namespace WebKit { 32 41 33 enum class DrawingAreaType : uint8_t { 34 #if PLATFORM(COCOA) 35 #if !PLATFORM(IOS_FAMILY) 36 TiledCoreAnimation, 37 #endif 38 RemoteLayerTree, 39 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 40 CoordinatedGraphics 41 #endif 42 class RemoteGraphicsContextGL; 43 class WCSceneContext; 44 struct WCUpateInfo; 45 46 class WCScene { 47 WTF_MAKE_FAST_ALLOCATED; 48 public: 49 WCScene(); 50 ~WCScene(); 51 void initialize(WCSceneContext&); 52 void update(WCUpateInfo&&, Vector<RefPtr<RemoteGraphicsContextGL>>&&); 53 54 private: 55 struct Layer; 56 using LayerMap = HashMap<uint64_t, std::unique_ptr<Layer>>; 57 58 WCSceneContext* m_context { nullptr }; 59 std::unique_ptr<WebCore::TextureMapper> m_textureMapper; 60 WebCore::TextureMapperFPSCounter m_fpsCounter; 61 LayerMap m_layers; 42 62 }; 43 44 enum {45 ActivityStateChangeAsynchronous = 046 };47 typedef uint64_t ActivityStateChangeID;48 49 enum DrawingAreaIdentifierType { };50 using DrawingAreaIdentifier = ObjectIdentifier<DrawingAreaIdentifierType>;51 63 52 64 } // namespace WebKit 53 65 54 namespace WTF { 55 56 template<> struct EnumTraits<WebKit::DrawingAreaType> { 57 using values = EnumValues< 58 WebKit::DrawingAreaType 59 #if PLATFORM(COCOA) 60 #if !PLATFORM(IOS_FAMILY) 61 , WebKit::DrawingAreaType::TiledCoreAnimation 62 #endif 63 , WebKit::DrawingAreaType::RemoteLayerTree 64 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 65 , WebKit::DrawingAreaType::CoordinatedGraphics 66 #endif 67 >; 68 }; 69 70 } // namespace WTF 66 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/GPUProcess/graphics/wc/WCSceneContext.cpp
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 25 25 26 26 #include "config.h" 27 #include " GPUProcessMain.h"27 #include "WCSceneContext.h" 28 28 29 #if ENABLE(GPU_PROCESS)29 #if USE(GRAPHICS_LAYER_WC) 30 30 31 #include "AuxiliaryProcessMain.h"32 #include "GPUProcess.h"31 #include <WebCore/GLContext.h> 32 #include <WebCore/TextureMapperGL.h> 33 33 34 34 namespace WebKit { 35 35 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 37 }; 36 WCSceneContext::WCSceneContext(uint64_t nativeWindow) 37 { 38 m_glContext = WebCore::GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(nativeWindow)); 39 } 38 40 39 int GPUProcessMain(int argc, char** argv) 41 WCSceneContext::~WCSceneContext() = default; 42 43 bool WCSceneContext::makeContextCurrent() 40 44 { 41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv); 45 return m_glContext->makeContextCurrent(); 46 } 47 48 std::unique_ptr<WebCore::TextureMapper> WCSceneContext::createTextureMapper() 49 { 50 return WebCore::TextureMapperGL::create(); 51 } 52 53 void WCSceneContext::swapBuffers() 54 { 55 m_glContext->swapBuffers(); 42 56 } 43 57 44 58 } // namespace WebKit 45 59 46 #endif // ENABLE(GPU_PROCESS)60 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/GPUProcess/graphics/wc/WCSceneContext.h
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 24 24 */ 25 25 26 #include "config.h" 27 #include "GPUProcessMain.h" 26 #pragma once 28 27 29 #if ENABLE(GPU_PROCESS)28 #if USE(GRAPHICS_LAYER_WC) 30 29 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 30 #include <wtf/FastMalloc.h> 31 32 namespace WebCore { 33 class GLContext; 34 class TextureMapper; 35 } 33 36 34 37 namespace WebKit { 35 38 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 39 class WCSceneContext { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 explicit WCSceneContext(uint64_t nativeWindow); 43 ~WCSceneContext(); 44 45 bool makeContextCurrent(); 46 std::unique_ptr<WebCore::TextureMapper> createTextureMapper(); 47 void swapBuffers(); 48 49 private: 50 std::unique_ptr<WebCore::GLContext> m_glContext; 37 51 }; 38 39 int GPUProcessMain(int argc, char** argv)40 {41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv);42 }43 52 44 53 } // namespace WebKit 45 54 46 #endif // ENABLE(GPU_PROCESS)55 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/GPUProcess/win/GPUProcessMainWin.cpp
r271563 r285099 31 31 #include "AuxiliaryProcessMain.h" 32 32 #include "GPUProcess.h" 33 #include <Objbase.h> 34 #include <wtf/win/SoftLinking.h> 35 36 SOFT_LINK_LIBRARY(user32); 37 SOFT_LINK_OPTIONAL(user32, SetProcessDpiAwarenessContext, BOOL, STDAPICALLTYPE, (DPI_AWARENESS_CONTEXT)); 33 38 34 39 namespace WebKit { 35 40 36 41 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 42 public: 43 bool platformInitialize() override 44 { 45 if (SetProcessDpiAwarenessContextPtr()) 46 SetProcessDpiAwarenessContextPtr()(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); 47 else 48 SetProcessDPIAware(); 49 return true; 50 } 37 51 }; 38 52 39 53 int GPUProcessMain(int argc, char** argv) 40 54 { 55 // for DirectX 56 HRESULT hr = ::CoInitializeEx(nullptr, COINIT_MULTITHREADED); 57 RELEASE_ASSERT(SUCCEEDED(hr)); 41 58 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv); 42 59 } -
trunk/Source/WebKit/PlatformWin.cmake
r285047 r285099 11 11 list(APPEND WebKit_SOURCES 12 12 GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp 13 14 GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp 15 GPUProcess/graphics/wc/WCScene.cpp 16 GPUProcess/graphics/wc/WCSceneContext.cpp 13 17 14 18 GPUProcess/media/win/RemoteMediaPlayerProxyWin.cpp … … 70 74 UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp 71 75 76 UIProcess/wc/DrawingAreaProxyWC.cpp 77 72 78 UIProcess/win/PageClientImpl.cpp 73 79 UIProcess/win/WebContextMenuProxyWin.cpp … … 77 83 UIProcess/win/WebView.cpp 78 84 85 WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.cpp 86 79 87 WebProcess/GPU/media/win/VideoLayerRemoteWin.cpp 80 88 … … 93 101 WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp 94 102 103 WebProcess/WebPage/wc/DrawingAreaWC.cpp 104 WebProcess/WebPage/wc/GraphicsLayerWC.cpp 105 WebProcess/WebPage/wc/WCLayerFactory.cpp 106 95 107 WebProcess/WebPage/win/WebPageWin.cpp 96 108 … … 100 112 101 113 list(APPEND WebKit_INCLUDE_DIRECTORIES 114 "${WEBKIT_DIR}/GPUProcess/graphics/wc" 102 115 "${WEBKIT_DIR}/Platform/classifier" 103 116 "${WEBKIT_DIR}/Platform/generic" … … 117 130 "${WEBKIT_DIR}/UIProcess/Inspector/win" 118 131 "${WEBKIT_DIR}/UIProcess/Plugins/win" 132 "${WEBKIT_DIR}/UIProcess/wc" 119 133 "${WEBKIT_DIR}/UIProcess/win" 134 "${WEBKIT_DIR}/WebProcess/GPU/graphics/wc" 120 135 "${WEBKIT_DIR}/WebProcess/InjectedBundle/API/win" 121 136 "${WEBKIT_DIR}/WebProcess/InjectedBundle/API/win/DOM" … … 123 138 "${WEBKIT_DIR}/WebProcess/WebCoreSupport/win" 124 139 "${WEBKIT_DIR}/WebProcess/WebPage/CoordinatedGraphics" 140 "${WEBKIT_DIR}/WebProcess/WebPage/wc" 125 141 "${WEBKIT_DIR}/WebProcess/WebPage/win" 126 142 "${WEBKIT_DIR}/win" 143 ) 144 145 list(APPEND WebKit_MESSAGES_IN_FILES 146 GPUProcess/graphics/wc/RemoteWCLayerTreeHost 147 148 WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy 127 149 ) 128 150 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r284080 r285099 358 358 'WebKit::TransactionID', 359 359 'WebKit::UserContentControllerIdentifier', 360 'WebKit::WCLayerTreeHostIdentifier', 360 361 'WebKit::WebPageProxyIdentifier', 361 362 'WebKit::WebURLSchemeHandlerIdentifier', … … 369 370 '"LayerHostingContext.h"': ["PLATFORM(COCOA)", ], 370 371 '"GestureTypes.h"': ["PLATFORM(IOS_FAMILY)"], 372 '"WCLayerTreeHostIdentifier.h"': ["USE(GRAPHICS_LAYER_WC)"], 371 373 '<WebCore/MediaPlaybackTargetContext.h>': ["ENABLE(WIRELESS_PLAYBACK_TARGET)"], 372 374 '<WebCore/DataDetectorType.h>': ["ENABLE(DATA_DETECTION)"], -
trunk/Source/WebKit/Shared/DrawingAreaInfo.h
r283966 r285099 38 38 RemoteLayerTree, 39 39 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 40 CoordinatedGraphics 40 CoordinatedGraphics, 41 #endif 42 #if USE(GRAPHICS_LAYER_WC) 43 WC, 41 44 #endif 42 45 }; … … 65 68 , WebKit::DrawingAreaType::CoordinatedGraphics 66 69 #endif 70 #if USE(GRAPHICS_LAYER_WC) 71 , WebKit::DrawingAreaType::WC 72 #endif 67 73 >; 68 74 }; -
trunk/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.h
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 24 24 */ 25 25 26 #include "config.h" 27 #include "GPUProcessMain.h" 26 #pragma once 28 27 29 #if ENABLE(GPU_PROCESS) 28 #include "BackingStore.h" 29 #include "DrawingAreaProxy.h" 30 30 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 31 namespace WebCore { 32 class Region; 33 } 33 34 34 35 namespace WebKit { 35 36 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 37 class DrawingAreaProxyWC final : public DrawingAreaProxy { 38 public: 39 DrawingAreaProxyWC(WebPageProxy&, WebProcessProxy&); 40 41 void paint(BackingStore::PlatformGraphicsContext, const WebCore::IntRect&, WebCore::Region& unpaintedRegion); 42 43 private: 44 // DrawingAreaProxy 45 void deviceScaleFactorDidChange() override { } 46 void sizeDidChange() override; 47 // message handers 48 void update(uint64_t, const UpdateInfo&); 49 void enterAcceleratedCompositingMode(uint64_t, const LayerTreeContext&); 50 51 void incorporateUpdate(const UpdateInfo&); 52 void discardBackingStore(); 53 54 uint64_t m_currentBackingStoreStateID { 0 }; 55 std::optional<BackingStore> m_backingStore; 37 56 }; 38 57 39 int GPUProcessMain(int argc, char** argv)40 {41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv);42 }43 44 58 } // namespace WebKit 45 46 #endif // ENABLE(GPU_PROCESS) -
trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp
r283911 r285099 29 29 30 30 #include "DrawingAreaProxyCoordinatedGraphics.h" 31 #include "DrawingAreaProxyWC.h" 31 32 #include "WebContextMenuProxyWin.h" 32 33 #include "WebPageProxy.h" … … 48 49 std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process) 49 50 { 51 if (m_view.page()->preferences().useGPUProcessForWebGLEnabled()) 52 return makeUnique<DrawingAreaProxyWC>(*m_view.page(), process); 50 53 return makeUnique<DrawingAreaProxyCoordinatedGraphics>(*m_view.page(), process); 51 54 } -
trunk/Source/WebKit/UIProcess/win/WebView.cpp
r274089 r285099 30 30 #include "APIPageConfiguration.h" 31 31 #include "DrawingAreaProxyCoordinatedGraphics.h" 32 #include "DrawingAreaProxyWC.h" 32 33 #include "Logging.h" 33 34 #include "NativeWebKeyboardEvent.h" … … 492 493 return; 493 494 m_page->endPrinting(); 494 if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page->drawingArea())) { 495 // FIXME: We should port WebKit1's rect coalescing logic here. 496 Region unpaintedRegion; 495 if (m_page->drawingArea()) { 496 auto painter = [&](auto drawingArea) { 497 // FIXME: We should port WebKit1's rect coalescing logic here. 498 Region unpaintedRegion; 497 499 #if USE(CAIRO) 498 cairo_surface_t* surface = cairo_win32_surface_create(hdc);499 cairo_t* context = cairo_create(surface);500 501 drawingArea->paint(context, dirtyRect, unpaintedRegion);502 503 cairo_destroy(context);504 cairo_surface_destroy(surface);500 cairo_surface_t* surface = cairo_win32_surface_create(hdc); 501 cairo_t* context = cairo_create(surface); 502 503 drawingArea->paint(context, dirtyRect, unpaintedRegion); 504 505 cairo_destroy(context); 506 cairo_surface_destroy(surface); 505 507 #else 506 COMPtr<ID3D11Texture2D> backBuffer; 507 HRESULT hr = m_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&backBuffer)); 508 if (SUCCEEDED(hr)) { 509 BackingStore::DXConnections context { m_immediateContext.get(), backBuffer.get() }; 510 drawingArea->paint(context, dirtyRect, unpaintedRegion); 508 COMPtr<ID3D11Texture2D> backBuffer; 509 HRESULT hr = m_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&backBuffer)); 510 if (SUCCEEDED(hr)) { 511 BackingStore::DXConnections context { m_immediateContext.get(), backBuffer.get() }; 512 drawingArea->paint(context, dirtyRect, unpaintedRegion); 513 } 514 515 m_swapChain->Present(0, 0); 516 #endif 517 518 auto unpaintedRects = unpaintedRegion.rects(); 519 for (auto& rect : unpaintedRects) 520 drawPageBackground(hdc, m_page.get(), rect); 521 }; 522 switch (m_page->drawingArea()->type()) { 523 case DrawingAreaType::WC: 524 painter(static_cast<DrawingAreaProxyWC*>(m_page->drawingArea())); 525 break; 526 case DrawingAreaType::CoordinatedGraphics: 527 painter(static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page->drawingArea())); 528 break; 529 default: 530 ASSERT_NOT_REACHED(); 511 531 } 512 513 m_swapChain->Present(0, 0);514 #endif515 516 auto unpaintedRects = unpaintedRegion.rects();517 for (auto& rect : unpaintedRects)518 drawPageBackground(hdc, m_page.get(), rect);519 532 } else 520 533 drawPageBackground(hdc, m_page.get(), dirtyRect); -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp
r284371 r285099 41 41 #endif 42 42 43 #if USE(GRAPHICS_LAYER_WC) 44 #include "WCPlatformLayerGCGL.h" 45 #endif 46 43 47 namespace WebKit { 44 48 … … 63 67 // during wait while in synchronous stream send. Should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=217211. 64 68 waitUntilInitialized(); 69 #if USE(GRAPHICS_LAYER_WC) 70 setPlatformLayer(makeUnique<WCPlatformLayerGCGL>(m_graphicsContextGLIdentifier)); 71 #endif 65 72 } 66 73 -
trunk/Source/WebKit/WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.messages.in
r285098 r285099 1 # Copyright (C) 20 10-2018 Apple Inc. All rights reserved.1 # Copyright (C) 2021 Sony Interactive Entertainment Inc. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 21 21 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 22 23 messages -> DrawingArea NotRefCounted { 24 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 25 UpdateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, WebCore::IntSize size, WebCore::IntSize scrollOffset) 26 #endif 23 #if USE(GRAPHICS_LAYER_WC) 27 24 25 messages -> RemoteWCLayerTreeHostProxy NotRefCounted { 28 26 DidUpdate() 27 } 29 28 30 #if PLATFORM(COCOA) 31 // Used by TiledCoreAnimationDrawingArea. 32 UpdateGeometry(WebCore::IntSize viewSize, bool flushSynchronously, MachSendRight fencePort) 33 SetDeviceScaleFactor(float deviceScaleFactor) 34 SetColorSpace(struct std::optional<WebCore::DestinationColorSpace> colorSpace) 35 SetViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) 36 37 AcceleratedAnimationDidStart(uint64_t layerID, String key, MonotonicTime startTime) 38 AcceleratedAnimationDidEnd(uint64_t layerID, String key) 39 40 AddTransactionCallbackID(WebKit::CallbackID callbackID) 41 #endif 42 43 #if PLATFORM(COCOA) || PLATFORM(GTK) 44 AdjustTransientZoom(double scale, WebCore::FloatPoint origin) 45 CommitTransientZoom(double scale, WebCore::FloatPoint origin) 46 #endif 47 } 29 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/WebProcess/GPU/graphics/wc/WCLayerTreeHostIdentifier.h
r285098 r285099 1 1 /* 2 * Copyright (C) 2020 Sony Interactive Entertainment Inc.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 24 24 */ 25 25 26 #include "config.h" 27 #include "GPUProcessMain.h" 26 #pragma once 28 27 29 #if ENABLE(GPU_PROCESS)28 #if USE(GRAPHICS_LAYER_WC) 30 29 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 30 #include <wtf/ObjectIdentifier.h> 33 31 34 32 namespace WebKit { 35 33 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 37 }; 38 39 int GPUProcessMain(int argc, char** argv) 40 { 41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv); 42 } 34 enum WCLayerTreeHostIdentifierType { }; 35 using WCLayerTreeHostIdentifier = ObjectIdentifier<WCLayerTreeHostIdentifierType>; 43 36 44 37 } // namespace WebKit 45 38 46 #endif // ENABLE(GPU_PROCESS)39 #endif // USE(GRAPHICS_LAYER_WC) -
trunk/Source/WebKit/WebProcess/GPU/graphics/wc/WCPlatformLayerGCGL.h
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 24 24 */ 25 25 26 #include "config.h" 27 #include "GPUProcessMain.h" 26 #pragma once 28 27 29 #if ENABLE(GPU_PROCESS) 30 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 28 #include "GraphicsContextGLIdentifier.h" 29 #include <WebCore/WCPlatformLayer.h> 33 30 34 31 namespace WebKit { 35 32 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 33 class WCPlatformLayerGCGL : public WebCore::WCPlatformLayer { 34 public: 35 WCPlatformLayerGCGL(GraphicsContextGLIdentifier identifier) 36 : m_graphicsContextGLIdentifier(identifier) 37 { 38 } 39 GraphicsContextGLIdentifier& graphicsContextGLIdentifier() { return m_graphicsContextGLIdentifier; } 40 41 private: 42 GraphicsContextGLIdentifier m_graphicsContextGLIdentifier; 37 43 }; 38 44 39 int GPUProcessMain(int argc, char** argv)40 {41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv);42 }43 44 45 } // namespace WebKit 45 46 #endif // ENABLE(GPU_PROCESS) -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp
r283966 r285099 41 41 #include "DrawingAreaCoordinatedGraphics.h" 42 42 #endif 43 #if USE(GRAPHICS_LAYER_WC) 44 #include "DrawingAreaWC.h" 45 #endif 43 46 44 47 namespace WebKit { … … 58 61 case DrawingAreaType::CoordinatedGraphics: 59 62 return makeUnique<DrawingAreaCoordinatedGraphics>(webPage, parameters); 63 #endif 64 #if USE(GRAPHICS_LAYER_WC) 65 case DrawingAreaType::WC: 66 return makeUnique<DrawingAreaWC>(webPage, parameters); 60 67 #endif 61 68 } … … 110 117 return false; 111 118 #endif 119 #if USE(GRAPHICS_LAYER_WC) 120 case DrawingAreaType::WC: 121 return true; 122 #endif 112 123 default: 113 124 return false; -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h
r283966 r285099 137 137 #endif 138 138 139 #if USE(GRAPHICS_LAYER_WC) 140 virtual void updateGeometry(uint64_t, WebCore::IntSize) { }; 141 #endif 142 139 143 #if USE(COORDINATED_GRAPHICS) || USE(GRAPHICS_LAYER_TEXTURE_MAPPER) 140 144 virtual void layerHostDidFlushLayers() { } -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
r278880 r285099 41 41 #endif 42 42 43 #if USE(GRAPHICS_LAYER_WC) 44 UpdateGeometry(uint64_t backingStoreStateID, WebCore::IntSize viewSize) 45 #endif 46 43 47 #if PLATFORM(COCOA) || PLATFORM(GTK) 44 48 AdjustTransientZoom(double scale, WebCore::FloatPoint origin) -
trunk/Source/WebKit/WebProcess/WebPage/wc/WCLayerFactory.cpp
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 25 25 26 26 #include "config.h" 27 #include " GPUProcessMain.h"27 #include "WCLayerFactory.h" 28 28 29 #if ENABLE(GPU_PROCESS) 30 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 29 #include "GraphicsLayerWC.h" 33 30 34 31 namespace WebKit { 32 using namespace WebCore; 35 33 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 37 }; 34 WCLayerFactory::WCLayerFactory(GraphicsLayerWC::Observer& observer) 35 : m_observer(observer) 36 { 37 } 38 38 39 int GPUProcessMain(int argc, char** argv)39 Ref<WebCore::GraphicsLayer> WCLayerFactory::createGraphicsLayer(WebCore::GraphicsLayer::Type layerType, WebCore::GraphicsLayerClient& client) 40 40 { 41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv);41 return adoptRef(*new GraphicsLayerWC(layerType, client, m_observer)); 42 42 } 43 43 44 44 } // namespace WebKit 45 46 #endif // ENABLE(GPU_PROCESS) -
trunk/Source/WebKit/WebProcess/WebPage/wc/WCLayerFactory.h
r285098 r285099 1 1 /* 2 * Copyright (C) 202 0Sony Interactive Entertainment Inc.2 * Copyright (C) 2021 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 24 24 */ 25 25 26 #include "config.h" 27 #include "GPUProcessMain.h" 26 #pragma once 28 27 29 #if ENABLE(GPU_PROCESS) 30 31 #include "AuxiliaryProcessMain.h" 32 #include "GPUProcess.h" 28 #include "GraphicsLayerWC.h" 29 #include <WebCore/GraphicsLayerFactory.h> 33 30 34 31 namespace WebKit { 35 32 36 class GPUProcessMainWin final: public AuxiliaryProcessMainBaseNoSingleton<GPUProcess> { 33 class WCLayerFactory final : public WebCore::GraphicsLayerFactory { 34 public: 35 WCLayerFactory(GraphicsLayerWC::Observer&); 36 37 private: 38 // WebCore::GraphicsLayerFactory 39 Ref<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override; 40 41 GraphicsLayerWC::Observer& m_observer; 37 42 }; 38 43 39 int GPUProcessMain(int argc, char** argv)40 {41 return AuxiliaryProcessMain<GPUProcessMainWin>(argc, argv);42 }43 44 44 } // namespace WebKit 45 46 #endif // ENABLE(GPU_PROCESS) -
trunk/Source/cmake/OptionsWinCairo.cmake
r282123 r285099 45 45 SET_AND_EXPOSE_TO_BUILD(USE_CURL ON) 46 46 SET_AND_EXPOSE_TO_BUILD(USE_GRAPHICS_LAYER_TEXTURE_MAPPER ON) 47 SET_AND_EXPOSE_TO_BUILD(USE_GRAPHICS_LAYER_WC ON) 47 48 SET_AND_EXPOSE_TO_BUILD(USE_EGL ON) 48 49 SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES ON)
Note:
See TracChangeset
for help on using the changeset viewer.