GraphicsContextGL subclasses should be able to supply a custom IOSurfacePool
Created attachment 456645 [details] Patch
<rdar://problem/91267303>
Comment on attachment 456645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456645&action=review > Source/WebCore/html/canvas/WebGLRenderingContextBase.h:418 > + IOSurfacePool* ioSurfacePool() const override; Is this not a teensy bit of a layering violation?
Created attachment 456654 [details] Patch
(In reply to Tim Horton from comment #3) > Comment on attachment 456645 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=456645&action=review > > > Source/WebCore/html/canvas/WebGLRenderingContextBase.h:418 > > + IOSurfacePool* ioSurfacePool() const override; > > Is this not a teensy bit of a layering violation? Perhaps; ideally we'd have a way to allow all platforms to recycle their buffers, accelerated or not.
Comment on attachment 456654 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456654&action=review > Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:8180 > +IOSurfacePool* WebGLRenderingContextBase::ioSurfacePool() const I don't think this is a WebGLRenderingContextBase property, especially currently if all it can do is to have global pool. My mind should, the polymorphism in be provided at the level where the context is being created, e.g. it would be a GraphicsContextGLCocoa constructor parameter. > Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:578 > + auto backing = IOSurface::create(ioSurfacePool, getInternalFramebufferSize(), DestinationColorSpace::SRGB()); If preserving current behaviour is not an explicit goal, I think better first step commit would be to unilaterally just pass nullptr here. - WebGL-in-WP reuses surfaces internally - WebGL-in-GPUP does not have pool in this commit - IOSurfacePool is not entirely correct
Comment on attachment 456654 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456654&action=review >> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:8180 >> +IOSurfacePool* WebGLRenderingContextBase::ioSurfacePool() const > > I don't think this is a WebGLRenderingContextBase property, especially currently if all it can do is to have global pool. > My mind should, the polymorphism in be provided at the level where the context is being created, e.g. it would be a GraphicsContextGLCocoa constructor parameter. And not a GraphicsContextGL::Client property, either)
I'll just leave the existing code alone.