Bug 261259 - ImageBufferCreationContext is used in wrong ImageBuffer::create factory function
Summary: ImageBufferCreationContext is used in wrong ImageBuffer::create factory function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-06 23:55 PDT by Kimmo Kinnunen
Modified: 2023-09-08 07:48 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.