Web Inspector: Canvas Tab: show supported GL extensions for selected canvas
authorwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 01:53:17 +0000 (01:53 +0000)
committerwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 01:53:17 +0000 (01:53 +0000)
commit21677894a6262be7ef830b39fd848ef718841648
tree15fc18de0e73d0d180ccd47bfdd9315c64b24e56
parentdd127477098d370a39c7cf9a45060ce8b9c43f18
Web Inspector: Canvas Tab: show supported GL extensions for selected canvas
https://bugs.webkit.org/show_bug.cgi?id=179070
<rdar://problem/35278276>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
Add `extensionEnabled` event that is fired each time `getExtension` is called with a
different string on a WebGL context.

Source/WebCore:

Test: inspector/canvas/extensions.html

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
Rework common logic into a macro for readability and to simplify adding calls to
InspectorInstrumentation functions.

* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::extensionIsEnabled):

* inspector/InspectorCanvasAgent.h:
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::didEnableExtension):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didEnableExtension):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didEnableExtensionImpl):

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.extensionEnabled):

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.extensionEnabled):

* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.get extensions):
(WI.Canvas.prototype.enableExtension):
Maintain a Set of enabled extensions, and dispatch an event whenever an extension is enabled.

* UserInterface/Views/CanvasDetailsSidebarPanel.css:
(.sidebar > .panel.details.canvas .details-section.canvas-extensions .content > ul):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.set canvas):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshAttributesSection):
(WI.CanvasDetailsSidebarPanel.prototype._refreshExtensionsSection):
Drive-by: hide Attributes section when the canvas has no attributes.
LayoutTests:

* inspector/canvas/extensions-expected.txt: Added.
* inspector/canvas/extensions.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/canvas/extensions-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/extensions.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Canvas.json
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
Source/WebCore/inspector/agents/InspectorCanvasAgent.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
Source/WebInspectorUI/UserInterface/Models/Canvas.js
Source/WebInspectorUI/UserInterface/Protocol/CanvasObserver.js
Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.css
Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js