Bug 202679

Summary: Web Inspector: Canvas: don't show an empty preview for WebGPU devices
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, jonlee, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
[Image] After Patch is applied none

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>