Bug 232733

Summary: "OffscreenCanvas" in IDLs doesn't seem to be able to be compiled
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: BindingsAssignee: Dan Glastonbury <djg>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, djg, esprehn+autocc, ews-watchlist, kondapallykalyan, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 232558    
Attachments:
Description Flags
Patch none

Description Myles C. Maxfield 2021-11-04 16:25:21 PDT
There are a few comments in our bindings code:

// FIXME: OffscreenCanvas doesn't seem to work with our bindings here.
Comment 1 Radar WebKit Bug Importer 2021-11-11 15:26:18 PST
<rdar://problem/85318653>
Comment 2 Dan Glastonbury 2022-03-02 19:20:28 PST
Notes on how to handle OffscreenCanvas from slack:

typedef (HTMLImageElement
#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    or HTMLVideoElement
#endif
    or HTMLCanvasElement
    or ImageBitmap
#if defined(ENABLE_OFFSCREEN_CANVAS) && ENABLE_OFFSCREEN_CANVAS
    or OffscreenCanvas
#endif
#if defined(ENABLE_CSS_TYPED_OM) && ENABLE_CSS_TYPED_OM
    or CSSStyleImageValue
#endif
) CanvasImageSource;
Comment 3 Dan Glastonbury 2022-03-03 21:58:15 PST
Created attachment 453812 [details]
Patch
Comment 4 Dan Glastonbury 2022-03-03 22:02:53 PST
Comment on attachment 453812 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453812&action=review

> Source/WebCore/Modules/WebGPU/GPUCanvasContext.h:45
> +    using CanvasType = std::variant<RefPtr<HTMLCanvasElement>, RefPtr<OffscreenCanvas>>;

I'm happy to bike shed the name `CanvasType`.

> Source/WebCore/Modules/WebGPU/GPUImageCopyExternalImage.h:41
> +    using SourceType = std::variant<RefPtr<ImageBitmap>, RefPtr<HTMLCanvasElement>, RefPtr<OffscreenCanvas>>;

I'm happy to bike shed the name `SourceType`.
Comment 5 EWS 2022-03-04 11:17:00 PST
Committed r290838 (248074@main): <https://commits.webkit.org/248074@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453812 [details].