Bug 199544 - Layers visualization should show layer contents
Summary: Layers visualization should show layer contents
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-06 10:36 PDT by Simon Fraser (smfr)
Modified: 2021-06-16 10:47 PDT (History)
13 users (show)

See Also:


Attachments
Non-working patch (9.18 KB, patch)
2019-07-07 21:36 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Kinda working patch (1.58 MB, patch)
2019-07-09 21:41 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
WIP v0.1 - Rebase smfr patch, adjust texture UVs (9.98 KB, patch)
2021-06-16 09:36 PDT, Patrick Angle
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2019-07-06 10:36:18 PDT
The layers 3D view needs to show images of the layer contents.
Comment 1 Radar WebKit Bug Importer 2019-07-06 12:54:44 PDT
<rdar://problem/52729705>
Comment 2 Simon Fraser (smfr) 2019-07-07 21:36:52 PDT
Created attachment 373615 [details]
Non-working patch
Comment 3 Simon Fraser (smfr) 2019-07-07 21:37:32 PDT
I could not get the material texture stuff to work.
Comment 4 Simon Fraser (smfr) 2019-07-09 21:41:14 PDT
Created attachment 373818 [details]
Kinda working patch
Comment 5 Simon Fraser (smfr) 2019-07-09 21:41:49 PDT
Comment on attachment 373818 [details]
Kinda working patch

This patch actually gets bits onto layers.
Comment 6 Patrick Angle 2021-06-16 09:36:27 PDT
Created attachment 431555 [details]
WIP v0.1 - Rebase smfr patch, adjust texture UVs
Comment 7 EWS Watchlist 2021-06-16 09:37:08 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 8 Devin Rousso 2021-06-16 10:47:11 PDT
Comment on attachment 431555 [details]
WIP v0.1 - Rebase smfr patch, adjust texture UVs

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

> Source/JavaScriptCore/inspector/protocol/LayerTree.json:112
> +            "name": "imageForLayerContents",

Rather than having a separate command (which means we'd have a new call-and-response for each layer), I wonder if it'd be better to instead include a `{ "name": "content", "type": "string", "optional": true }` property inside `LayerTree.Layer` and have a `{ "name": "includeContent", "type": "boolean", "optional": true }` parameter for `LayerTree.layersForNode` so that we can instead just have a single command that has all the response in it.

I think there also may be a benefit of having a checkbox in the Layers Tab that controls whether image data is fetched (probably default enabled).  At least in the short term while evaluating the performance of this.

> Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp:348
> +    return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes);

I wonder if we should consider lowering the `quality`.  Maybe only if the performance is really bad.

> Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js:297
> +        layerGroup.add(this._createLayerMesh(layer.compositedBounds), this._createLayerMesh(layer.compositedBounds, true));

o_0 why?