Bug 202679 - Web Inspector: Canvas: don't show an empty preview for WebGPU devices
Summary: Web Inspector: Canvas: don't show an empty preview for WebGPU devices
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-07 21:00 PDT by Devin Rousso
Modified: 2019-10-08 14:25 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.18 KB, patch)
2019-10-07 21:08 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
[Image] After Patch is applied (604.00 KB, image/png)
2019-10-07 21:09 PDT, Devin Rousso
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2019-10-07 21:00:20 PDT
`HTMLCanvasElement.prototype.toDataURL` hasn't been hooked up for `GPUCanvasContext` yet, so calling `Canvas.requestContent` with a `WebGPUDevice` won't give us any good results.  As such, the Web Inspector frontend should show something slightly more actionable, or at the very least something less obviously wrong.
Comment 1 Devin Rousso 2019-10-07 21:08:46 PDT
Created attachment 380393 [details]
Patch
Comment 2 Devin Rousso 2019-10-07 21:09:02 PDT
Created attachment 380394 [details]
[Image] After Patch is applied
Comment 3 Matt Baker 2019-10-08 12:01:35 PDT
Comment on attachment 380393 [details]
Patch

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

r=me

> Source/WebInspectorUI/UserInterface/Models/Canvas.js:127
> +        return true;

I know this was written with future contextTypes in mind, but I'd just replace it with:

return contextType !== Canvas.ContextType.WebGPU && contextType !== Canvas.ContextType.WebMetal;
Comment 4 Devin Rousso 2019-10-08 12:32:42 PDT
Comment on attachment 380393 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Models/Canvas.js:127
>> +        return true;
> 
> I know this was written with future contextTypes in mind, but I'd just replace it with:
> 
> return contextType !== Canvas.ContextType.WebGPU && contextType !== Canvas.ContextType.WebMetal;

I personally prefer this, as it's more future-proof.
Comment 5 WebKit Commit Bot 2019-10-08 13:49:55 PDT
Comment on attachment 380393 [details]
Patch

Clearing flags on attachment: 380393

Committed r250858: <https://trac.webkit.org/changeset/250858>
Comment 6 WebKit Commit Bot 2019-10-08 13:49:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-10-08 14:25:02 PDT
<rdar://problem/56088775>