Bug 222960

Summary: [GPU Process] ImageBitmap should release its ImageBuffer in the main thread
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: CanvasAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, dino, esprehn+autocc, ews-watchlist, gyuyoung.kim, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 222835    
Attachments:
Description Flags
Patch
simon.fraser: review+, ews-feeder: commit-queue-
Patch
none
Patch none

Description Said Abou-Hallawa 2021-03-08 23:53:01 PST
The ImageBuffer of the ImageBitmap should be deleted on the main thread only since its deletion may require sending messages to the GPUP.
Comment 1 Said Abou-Hallawa 2021-03-08 23:55:13 PST
Created attachment 422668 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-03-09 10:07:16 PST
Comment on attachment 422668 [details]
Patch

It this covered by tests?
Comment 3 Said Abou-Hallawa 2021-03-09 10:45:44 PST
Created attachment 422728 [details]
Patch
Comment 4 Said Abou-Hallawa 2021-03-09 10:46:12 PST
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 422668 [details]
> Patch
> 
> It this covered by tests?

imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-in-worker-transfer.html
Comment 5 Chris Dumez 2021-03-09 10:46:57 PST
Comment on attachment 422728 [details]
Patch

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

> Source/WebCore/html/ImageBitmap.cpp:848
> +        callOnMainThread([imageBuffer = WTFMove(imageBuffer)]() mutable { });

I doubt the mutable and () are needed.
Comment 6 Simon Fraser (smfr) 2021-03-09 10:49:11 PST
(In reply to Said Abou-Hallawa from comment #4)
> (In reply to Simon Fraser (smfr) from comment #2)
> > Comment on attachment 422668 [details]
> > Patch
> > 
> > It this covered by tests?
> 
> imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/
> createImageBitmap-in-worker-transfer.html

Please note in the changeling.
Comment 7 Said Abou-Hallawa 2021-03-09 11:08:43 PST
Created attachment 422731 [details]
Patch
Comment 8 EWS 2021-03-09 12:03:33 PST
Committed r274164: <https://commits.webkit.org/r274164>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422731 [details].
Comment 9 Radar WebKit Bug Importer 2021-03-09 12:04:39 PST
<rdar://problem/75228853>
Comment 10 Said Abou-Hallawa 2021-03-12 10:59:07 PST
*** Bug 222879 has been marked as a duplicate of this bug. ***