Bug 222343

Summary: [GPU Process] Some DisplayList items may not be replayed back before calling getImageData()
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: CanvasAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Said Abou-Hallawa 2021-02-23 21:43:17 PST
Ensuring the DisplayList items are replayed to the ImageBuffer before calling getImageData() will fix these tests:

fast/canvas/canvas-arc-connecting-line.html [ Failure ]
fast/canvas/canvas-arc-zero-lineto.html [ Failure ]
fast/canvas/canvas-bezier-same-endpoint.html [ Failure Pass ]
fast/canvas/canvas-blend-image.html [ Failure Pass ]
fast/canvas/canvas-blend-solid.html [ Failure Pass ]
imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-origin.sub.html [ Failure ]
Comment 1 Said Abou-Hallawa 2021-02-23 21:48:30 PST
Created attachment 421383 [details]
Patch
Comment 2 Said Abou-Hallawa 2021-02-26 15:02:45 PST
Created attachment 421710 [details]
Patch
Comment 3 Tim Horton 2021-02-26 17:03:44 PST
Comment on attachment 421710 [details]
Patch

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

> Source/WebKit/ChangeLog:10
> +        Make sure all the pending DisplayList items are pushed to the GPUP and
> +        submitted to RemoteImageBuffer before calling the asynchronous method
> +        getImageData().

Is there an assertion we could add somewhere that would have alerted us to this?
Comment 4 Said Abou-Hallawa 2021-03-01 11:20:36 PST
Comment on attachment 421710 [details]
Patch

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

>> Source/WebKit/ChangeLog:10
>> +        getImageData().
> 
> Is there an assertion we could add somewhere that would have alerted us to this?

This is going to be costly because we have to know the state of RemoteImageBuffer playing back in WebP. This will require sending a confirmation message from GPUP to WebP for every playback.
Comment 5 Tim Horton 2021-03-01 11:25:57 PST
(In reply to Said Abou-Hallawa from comment #4)
> Comment on attachment 421710 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=421710&action=review
> 
> >> Source/WebKit/ChangeLog:10
> >> +        getImageData().
> > 
> > Is there an assertion we could add somewhere that would have alerted us to this?
> 
> This is going to be costly because we have to know the state of
> RemoteImageBuffer playing back in WebP. This will require sending a
> confirmation message from GPUP to WebP for every playback.

That's probably beyond the scope of a reasonable assertion, then.
Comment 6 EWS 2021-03-01 11:57:08 PST
Committed r273672: <https://commits.webkit.org/r273672>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421710 [details].
Comment 7 Radar WebKit Bug Importer 2021-03-01 11:58:16 PST
<rdar://problem/74882498>