[GPU Process] Start tracking resource uses for ImageBuffers
Created attachment 434073 [details] Patch for reviewing
Created attachment 434074 [details] Patch for EWS
Created attachment 434268 [details] Patch
Created attachment 434388 [details] Patch
Comment on attachment 434388 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434388&action=review > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:207 > + imageBuffer.incrementUseCounter(); I think this should be similar to drawNativeImage() and appendDrawGlyphsItemWithCachedFont() if (m_delegate) recordImageBufferUse(imageBuffer); > Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:75 > + m_remoteRenderingBackendProxy->releaseRemoteResource(m_renderingResourceIdentifier, m_useCount); I think this call can be moved to RemoteResourceCacheProxy::releaseImageBuffer() and you can know the useCount from ImageBufferHashMap which can have the definition: struct ImageBufferState { WeakPtr<WebCore::ImageBuffer> imageBuffer; uint64_t useCount; }; using ImageBufferHashMap = HashMap<WebCore::RenderingResourceIdentifier, ImageBufferState>; > Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:329 > + void incrementUseCounter() final > + { > + ++m_useCount; > + } void recordImageBufferUse(WebCore::ImageBuffer& imageBuffer) { // Similar to what we do in recordFontUse } > Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:358 > + uint64_t m_useCount { 0 }; I think all the useCount in WebProcess should be managed by RemoteResourceCacheProxy.
Created attachment 434406 [details] Patch
Created attachment 434408 [details] Patch
Comment on attachment 434408 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434408&action=review > Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:204 > + item.imageBuffer->clearBackend(); Do we need to reset the useCount to '0' if GPUP is relaunched?
Committed r280401 (240042@main): <https://commits.webkit.org/240042@main>
<rdar://problem/81237219>