Changeset 275463 in webkit
- Timestamp:
- Apr 5, 2021 5:50:05 PM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r275462 r275463 1 2021-04-05 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win][WK2] Implement IPC::Semaphore to run WebGL in GPU process 4 https://bugs.webkit.org/show_bug.cgi?id=224014 5 6 Reviewed by Don Olmstead. 7 8 * platform/graphics/PlatformDisplay.cpp: 9 (WebCore::PlatformDisplay::sharedDisplay): GPU process calls this 10 function in IPC thread. Removed the assertion checking the main 11 thread. 12 * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 13 * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: 14 (WebCore::GraphicsContextGLOpenGL::createForGPUProcess): Added. 15 1 16 2021-04-05 Cameron McCormack <heycam@apple.com> 2 17 -
trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp
r274273 r275463 133 133 #if PLATFORM(WIN) 134 134 // ANGLE D3D renderer isn't thread-safe. Don't destruct it on non-main threads which calls _exit(). 135 ASSERT(isMainThread());136 135 static PlatformDisplay* display = createPlatformDisplay().release(); 137 136 return *display; -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h
r275097 r275463 113 113 static GCGLint EGLDrawingBufferTextureTarget(); 114 114 #else 115 static Ref<GraphicsContextGLOpenGL> createForGPUProcess(const GraphicsContextGLAttributes&); 115 116 PlatformLayer* platformLayer() const final; 116 117 #endif -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp
r275373 r275463 97 97 } 98 98 99 Ref<GraphicsContextGLOpenGL> GraphicsContextGLOpenGL::createForGPUProcess(const GraphicsContextGLAttributes& attributes) 100 { 101 return adoptRef(*new GraphicsContextGLOpenGL(attributes, nullptr)); 102 } 103 99 104 #if USE(ANGLE) 100 105 GraphicsContextGLOpenGL::GraphicsContextGLOpenGL(GraphicsContextGLAttributes attributes, HostWindow*, GraphicsContextGLOpenGL* sharedContext) -
trunk/Source/WebKit/ChangeLog
r275459 r275463 1 2021-04-05 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win][WK2] Implement IPC::Semaphore to run WebGL in GPU process 4 https://bugs.webkit.org/show_bug.cgi?id=224014 5 6 Reviewed by Don Olmstead. 7 8 * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: 9 * GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp: Added. 10 (WebKit::RemoteGraphicsContextGL::create): 11 (WebKit::RemoteGraphicsContextGLWin::RemoteGraphicsContextGLWin): 12 (WebKit::RemoteGraphicsContextGLWin::platformWorkQueueInitialize): 13 (WebKit::RemoteGraphicsContextGL::prepareForDisplay): 14 * Platform/IPC/IPCSemaphore.cpp: 15 * Platform/IPC/IPCSemaphore.h: 16 * Platform/IPC/StreamClientConnection.cpp: 17 (IPC::StreamClientConnection::setWakeUpSemaphore): 18 (IPC::StreamClientConnection::wakeUpServer): 19 * Platform/IPC/StreamClientConnection.h: 20 (IPC::StreamClientConnection::tryAcquire): 21 (IPC::StreamClientConnection::tryAcquireAll): 22 * Platform/IPC/StreamConnectionWorkQueue.cpp: 23 (IPC::StreamConnectionWorkQueue::StreamConnectionWorkQueue): 24 (IPC::StreamConnectionWorkQueue::removeStreamConnection): 25 (IPC::StreamConnectionWorkQueue::stop): 26 (IPC::StreamConnectionWorkQueue::wakeUp): 27 (IPC::StreamConnectionWorkQueue::wakeUpProcessingThread): 28 * Platform/IPC/StreamConnectionWorkQueue.h: 29 * Platform/IPC/StreamServerConnection.cpp: 30 (IPC::StreamServerConnectionBase::release): 31 (IPC::StreamServerConnectionBase::releaseAll): 32 * Platform/IPC/win/IPCSemaphoreWin.cpp: Added. 33 (IPC::Semaphore::Semaphore): 34 (IPC::Semaphore::~Semaphore): 35 (IPC::Semaphore::operator=): 36 (IPC::Semaphore::signal): 37 (IPC::Semaphore::wait): 38 (IPC::Semaphore::waitFor): 39 (IPC::Semaphore::encode const): 40 (IPC::Semaphore::decode): 41 (IPC::Semaphore::destroy): 42 * PlatformWin.cmake: 43 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 44 (WebKit::WebChromeClient::createGraphicsContextGL const): 45 1 46 2021-04-05 Myles C. Maxfield <mmaxfield@apple.com> 2 47 -
trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp
r275403 r275463 53 53 } 54 54 55 #if !PLATFORM(COCOA) 55 #if !PLATFORM(COCOA) && !PLATFORM(WIN) 56 56 Ref<RemoteGraphicsContextGL> RemoteGraphicsContextGL::create(GPUConnectionToWebProcess& gpuConnectionToWebProcess, GraphicsContextGLAttributes&& attributes, GraphicsContextGLIdentifier graphicsContextGLIdentifier, RemoteRenderingBackend& renderingBackend, IPC::StreamConnectionBuffer&& stream) 57 57 { … … 152 152 } 153 153 154 #if !PLATFORM(COCOA) 154 #if !PLATFORM(COCOA) && !PLATFORM(WIN) 155 155 void RemoteGraphicsContextGL::prepareForDisplay(CompletionHandler<void()>&& completionHandler) 156 156 { -
trunk/Source/WebKit/Platform/IPC/IPCSemaphore.cpp
r272382 r275463 27 27 #include "IPCSemaphore.h" 28 28 29 #if !OS(DARWIN) 29 #if !OS(DARWIN) && !OS(WINDOWS) 30 30 31 31 namespace IPC { -
trunk/Source/WebKit/Platform/IPC/IPCSemaphore.h
r275180 r275463 34 34 #include <mach/semaphore.h> 35 35 #include <wtf/MachSendRight.h> 36 #elif OS(WINDOWS) 37 #include <windows.h> 36 38 #endif 37 39 … … 53 55 static Optional<Semaphore> decode(Decoder&); 54 56 57 void signal(); 58 void wait(); 59 bool waitFor(Timeout); 60 55 61 #if OS(DARWIN) 56 62 explicit Semaphore(MachSendRight&&); 57 63 58 void signal();59 void wait();60 bool waitFor(Timeout);61 64 MachSendRight createSendRight() const; 62 65 explicit operator bool() const { return m_sendRight || m_semaphore != SEMAPHORE_NULL; } 66 #elif OS(WINDOWS) 67 explicit Semaphore(HANDLE); 63 68 #else 64 69 explicit operator bool() const { return true; } … … 66 71 67 72 private: 73 void destroy(); 68 74 #if OS(DARWIN) 69 void destroy();70 75 MachSendRight m_sendRight; 71 76 semaphore_t m_semaphore { SEMAPHORE_NULL }; 77 #elif OS(WINDOWS) 78 HANDLE m_semaphoreHandle { nullptr }; 72 79 #endif 73 80 }; -
trunk/Source/WebKit/Platform/IPC/StreamClientConnection.cpp
r274066 r275463 41 41 void StreamClientConnection::setWakeUpSemaphore(IPC::Semaphore&& semaphore) 42 42 { 43 #if PLATFORM(COCOA) 43 #if PLATFORM(COCOA) || PLATFORM(WIN) 44 44 m_wakeUpSemaphore = WTFMove(semaphore); 45 45 #endif … … 49 49 void StreamClientConnection::wakeUpServer() 50 50 { 51 #if PLATFORM(COCOA) 51 #if PLATFORM(COCOA) || PLATFORM(WIN) 52 52 if (m_wakeUpSemaphore) 53 53 m_wakeUpSemaphore->signal(); -
trunk/Source/WebKit/Platform/IPC/StreamClientConnection.h
r274433 r275463 103 103 size_t m_clientOffset { 0 }; 104 104 StreamConnectionBuffer m_buffer; 105 #if PLATFORM(COCOA) 105 #if PLATFORM(COCOA) || PLATFORM(WIN) 106 106 Optional<Semaphore> m_wakeUpSemaphore; 107 107 #endif … … 241 241 if (timeout.didTimeOut()) 242 242 break; 243 #if PLATFORM(COCOA) 243 #if PLATFORM(COCOA) || PLATFORM(WIN) 244 244 ClientLimit oldClientLimit = sharedClientLimit().compareExchangeStrong(clientLimit, ClientLimit::clientIsWaitingTag, std::memory_order_acq_rel, std::memory_order_acq_rel); 245 245 if (clientLimit == oldClientLimit) { … … 274 274 275 275 for (;;) { 276 #if PLATFORM(COCOA) 276 #if PLATFORM(COCOA) || PLATFORM(WIN) 277 277 ClientLimit clientLimit = sharedClientLimit().exchange(ClientLimit::clientIsWaitingTag, std::memory_order_acq_rel); 278 278 ClientOffset clientOffset = sharedClientOffset().load(std::memory_order_acquire); … … 284 284 break; 285 285 286 #if PLATFORM(COCOA) 286 #if PLATFORM(COCOA) || PLATFORM(WIN) 287 287 m_buffer.clientWaitSemaphore().waitFor(timeout); 288 288 #else … … 292 292 return WTF::nullopt; 293 293 } 294 #if PLATFORM(COCOA) 294 #if PLATFORM(COCOA) || PLATFORM(WIN) 295 295 // In case the transaction was cancelled, undo the transaction marker. 296 296 sharedClientLimit().store(static_cast<ClientLimit>(0), std::memory_order_release); -
trunk/Source/WebKit/Platform/IPC/StreamConnectionWorkQueue.cpp
r274386 r275463 30 30 31 31 StreamConnectionWorkQueue::StreamConnectionWorkQueue(const char* name) 32 #if PLATFORM(COCOA) 32 #if PLATFORM(COCOA) || PLATFORM(WIN) 33 33 : m_name(name) 34 34 #endif … … 64 64 ASSERT(!m_shouldQuit); // Re-entering during shutdown not supported. 65 65 } 66 #if PLATFORM(COCOA) 66 #if PLATFORM(COCOA) || PLATFORM(WIN) 67 67 m_wakeUpSemaphore.signal(); 68 68 #endif … … 72 72 { 73 73 m_shouldQuit = true; 74 #if PLATFORM(COCOA) 74 #if PLATFORM(COCOA) || PLATFORM(WIN) 75 75 if (!m_processingThread) 76 76 return; … … 83 83 void StreamConnectionWorkQueue::wakeUp() 84 84 { 85 #if PLATFORM(COCOA) 85 #if PLATFORM(COCOA) || PLATFORM(WIN) 86 86 m_wakeUpSemaphore.signal(); 87 87 #endif … … 95 95 void StreamConnectionWorkQueue::wakeUpProcessingThread() 96 96 { 97 #if PLATFORM(COCOA) 97 #if PLATFORM(COCOA) || PLATFORM(WIN) 98 98 if (m_processingThread) { 99 99 m_wakeUpSemaphore.signal(); -
trunk/Source/WebKit/Platform/IPC/StreamConnectionWorkQueue.h
r274386 r275463 54 54 void processStreams(); 55 55 56 #if PLATFORM(COCOA) 56 #if PLATFORM(COCOA) || PLATFORM(WIN) 57 57 const char* const m_name; 58 58 #endif -
trunk/Source/WebKit/Platform/IPC/StreamServerConnection.cpp
r274433 r275463 89 89 ServerOffset serverOffset = static_cast<ServerOffset>(wrapOffset(alignOffset(m_serverOffset) + readSize)); 90 90 91 #if PLATFORM(COCOA) 91 #if PLATFORM(COCOA) || PLATFORM(WIN) 92 92 ServerOffset oldServerOffset = sharedServerOffset().exchange(serverOffset, std::memory_order_acq_rel); 93 93 // If the client wrote over serverOffset, it means the client is waiting. … … 107 107 { 108 108 sharedServerLimit().store(static_cast<ServerLimit>(0), std::memory_order_release); 109 #if PLATFORM(COCOA) 109 #if PLATFORM(COCOA) || PLATFORM(WIN) 110 110 ServerOffset oldServerOffset = sharedServerOffset().exchange(static_cast<ServerOffset>(0), std::memory_order_acq_rel); 111 111 // If the client wrote over serverOffset, it means the client is waiting. -
trunk/Source/WebKit/PlatformWin.cmake
r274912 r275463 10 10 11 11 list(APPEND WebKit_SOURCES 12 GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp 13 12 14 GPUProcess/media/win/RemoteMediaPlayerProxyWin.cpp 13 15 … … 23 25 Platform/IPC/win/AttachmentWin.cpp 24 26 Platform/IPC/win/ConnectionWin.cpp 27 Platform/IPC/win/IPCSemaphoreWin.cpp 25 28 26 29 Platform/classifier/ResourceLoadStatisticsClassifier.cpp -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
r274929 r275463 112 112 #endif 113 113 114 #if PLATFORM(COCOA) 114 #if PLATFORM(COCOA) || PLATFORM(WIN) 115 115 #include "RemoteGraphicsContextGLProxy.h" 116 116 #endif … … 939 939 return nullptr; 940 940 UNUSED_VARIABLE(hostWindowDisplayID); 941 #if PLATFORM(COCOA) 941 #if PLATFORM(COCOA) || PLATFORM(WIN) 942 942 return RemoteGraphicsContextGLProxy::create(attributes, m_page.ensureRemoteRenderingBackendProxy().renderingBackendIdentifier()); 943 943 #else
Note: See TracChangeset
for help on using the changeset viewer.