Bug 219705

Summary: [GPU Process]: Recording an in-process ImageBuffer drawing has to convert it to a NativeImage first
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: CanvasAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218871
Attachments:
Description Flags
Patch
wenson_hsieh: review+
Patch none

Description Said Abou-Hallawa 2020-12-09 13:22:57 PST
We should not send the ImageBuffer to GPUP if it's created in-process. We should let ImageBuffer::draw() extract a NativeImage of it first. Then GraphicsContext::drawNativeImage() sends this NativeImage to GPUP.
Comment 1 Said Abou-Hallawa 2020-12-09 13:41:33 PST
Created attachment 415795 [details]
Patch
Comment 2 Said Abou-Hallawa 2020-12-09 13:46:17 PST
This patch allows drawing the test case in bug 218871. The drawing of the PDF still happens in WebP. We draw the PDF to an ImageBuffer first and then draw this ImageBuffer to the canvas.
Comment 3 Wenson Hsieh 2020-12-09 13:51:03 PST
Comment on attachment 415795 [details]
Patch

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

> Source/WebCore/platform/graphics/GraphicsContextImpl.h:42
> +    virtual bool canRecordDrawImageBuffer(const ImageBuffer&) const { return true; }

It seems like this should just be `canDrawImageBuffer` instead, since it's on the GraphicsContextImpl (of which DisplayList::Recorder is one particular implementation).
Comment 4 Said Abou-Hallawa 2020-12-09 14:00:15 PST
Created attachment 415796 [details]
Patch
Comment 5 EWS 2020-12-09 15:01:34 PST
Committed r270605: <https://trac.webkit.org/changeset/270605>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415796 [details].
Comment 6 Radar WebKit Bug Importer 2020-12-09 15:03:34 PST
<rdar://problem/72155021>
Comment 7 Said Abou-Hallawa 2021-03-05 10:27:53 PST
*** Bug 218871 has been marked as a duplicate of this bug. ***