Bug 261259

Summary: ImageBufferCreationContext is used in wrong ImageBuffer::create factory function
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: CanvasAssignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description Kimmo Kinnunen 2023-09-06 23:55:40 PDT
ImageBufferCreationContext is used in wrong ImageBuffer::create factory function

ImageBufferCreationContext is ad hoc amalgamation of all parameters accepted by any ImageBufferBackend, populated for the purpose of constructing a specific backend.

ImageBuffer::create<Backend>(..., const ImageBufferCreationContext&) is the concrete function constructing a specific ImageBuffer type with a specific backend.

ImageBuffer::create(...) is a polymorphic factory, which invokes the GraphicsClient, a polymorphic interface. It doesn't request a specific backend, rather the polymorphism selects the backend based on policy.  This function shouldn't accept ImageBufferCreationContext, there's nothing that can be populated by the caller, except fields incorrectly added to ImageBufferCreationContext.
Comment 1 Radar WebKit Bug Importer 2023-09-06 23:55:57 PDT
<rdar://problem/115098672>
Comment 2 Kimmo Kinnunen 2023-09-07 00:05:21 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17531
Comment 3 EWS 2023-09-08 07:48:42 PDT
Committed 267792@main (61d979e4fad4): <https://commits.webkit.org/267792@main>

Reviewed commits have been landed. Closing PR #17531 and removing active labels.