Web Inspector: Record actions performed on WebGL2RenderingContext
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 16:36:17 +0000 (16:36 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 16:36:17 +0000 (16:36 +0000)
commit788eab1546e667ed26c9fd5887734228873b82ec
tree0ade3874d6b887431ccd7ed65c69f4dbb95a9944
parent8d43d2835b1d23f79b519b55a998a87917ac361c
Web Inspector: Record actions performed on WebGL2RenderingContext
https://bugs.webkit.org/show_bug.cgi?id=176008
<rdar://problem/34213884>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Recording.json:
* inspector/scripts/codegen/generator.py:
Add `canvas-webgl2` as a `Type`.

Source/WebCore:

Tests: inspector/canvas/recording-webgl2.html
       inspector/canvas/recording-webgl2-snapshots.html

* html/canvas/WebGL2RenderingContext.idl:

* bindings/js/CallTracerTypes.h:
* inspector/RecordingSwizzleTypes.h:

* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::canvasChanged): Added.
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::shouldSnapshotWebGL2Action): Added.
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::releaseObjectForRecording):
(WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
(WebCore::InspectorCanvas::buildAction):
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::canvasChanged): Added.
(WebCore::InspectorCanvasAgent::startRecording):
Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to
determine whether or not an action needs a snapshot.

* page/PageConsoleClient.cpp:
(WebCore::canvasRenderingContext):

Source/WebInspectorUI:

* UserInterface/Models/Recording.js:
(WI.Recording.fromPayload):
(WI.Recording.displayNameForSwizzleType):
(WI.Recording.prototype.async swizzle):
(WI.Recording.prototype.createContext):

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction.constantNameForParameter):
(WI.RecordingAction._prototypeForType):
(WI.RecordingAction.prototype.async swizzle):
Treat all actions with a snapshot as being a "visible" action.

* UserInterface/Views/CanvasTabContentView.css:
(.content-view.tab.canvas .navigation-bar > .item .canvas:matches(.webgl, .webgl2, .webgpu, .webmetal) .icon): Added.
(.content-view.tab.canvas .navigation-bar > .item .canvas.webgl): Deleted.
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.initialLayout):
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype.shown):
(WI.CanvasSidebarPanel.prototype._canvasChanged):
(WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem):

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.get navigationItems):
(WI.RecordingContentView.prototype.shown):
(WI.RecordingContentView.prototype.initialLayout):
* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._generateDOM.createParameterElement):

LayoutTests:

* inspector/canvas/recording-webgl2.html: Added.
* inspector/canvas/recording-webgl2-expected.txt: Added.
* inspector/canvas/recording-webgl2-snapshots.html: Added.
* inspector/canvas/recording-webgl2-snapshots-expected.txt: Added.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/inspector/canvas/recording-webgl2-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-snapshots-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-snapshots.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2.html [new file with mode: 0644]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Recording.json
Source/JavaScriptCore/inspector/scripts/codegen/generator.py
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/CallTracerTypes.h
Source/WebCore/html/canvas/WebGL2RenderingContext.idl
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/inspector/InspectorCanvas.h
Source/WebCore/inspector/RecordingSwizzleTypes.h
Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
Source/WebCore/inspector/agents/InspectorCanvasAgent.h
Source/WebCore/page/PageConsoleClient.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/Recording.js
Source/WebInspectorUI/UserInterface/Models/RecordingAction.js
Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.css
Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js
Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js