Web Inspector: allow ShaderProgram to be shown in CanvasContentView
authorwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 21:17:17 +0000 (21:17 +0000)
committerwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 21:17:17 +0000 (21:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178714

Reviewed by Brian Burg.

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.inspect):
Allow ShaderProgram to show the related Canvas information.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype.canShowRepresentedObject):
(WI.CanvasTabContentView.prototype.showRepresentedObject):
(WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
If a ShaderProgram is selected in the path component, display a ShaderProgramContentView.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.js

index 65e2827..5623514 100644 (file)
@@ -1,5 +1,22 @@
 2017-10-24  Devin Rousso  <webkit@devinrousso.com>
 
+        Web Inspector: allow ShaderProgram to be shown in CanvasContentView
+        https://bugs.webkit.org/show_bug.cgi?id=178714
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/CanvasDetailsSidebarPanel.js:
+        (WI.CanvasDetailsSidebarPanel.prototype.inspect):
+        Allow ShaderProgram to show the related Canvas information.
+
+        * UserInterface/Views/CanvasTabContentView.js:
+        (WI.CanvasTabContentView.prototype.canShowRepresentedObject):
+        (WI.CanvasTabContentView.prototype.showRepresentedObject):
+        (WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
+        If a ShaderProgram is selected in the path component, display a ShaderProgramContentView.
+
+2017-10-24  Devin Rousso  <webkit@devinrousso.com>
+
         Web Inspector: remove canvases from Resources and experimental setting/UI
         https://bugs.webkit.org/show_bug.cgi?id=178711
 
index 3f1287e..8c008de 100644 (file)
@@ -42,7 +42,13 @@ WI.CanvasDetailsSidebarPanel = class CanvasDetailsSidebarPanel extends WI.Detail
         if (!(objects instanceof Array))
             objects = [objects];
 
-        objects = objects.map((object) => object instanceof WI.Recording ? object.source : object);
+        objects = objects.map((object) => {
+            if (object instanceof WI.Recording)
+                return object.source;
+            if (object instanceof WI.ShaderProgram)
+                return object.canvas;
+            return object;
+        });
 
         this.canvas = objects.find((object) => object instanceof WI.Canvas);
 
index 7108577..1fec08d 100644 (file)
@@ -90,7 +90,9 @@ WI.CanvasTabContentView = class CanvasTabContentView extends WI.ContentBrowserTa
 
     canShowRepresentedObject(representedObject)
     {
-        return representedObject instanceof WI.CanvasCollection || representedObject instanceof WI.Recording;
+        return representedObject instanceof WI.CanvasCollection
+            || representedObject instanceof WI.Recording
+            || representedObject instanceof WI.ShaderProgram;
     }
 
     showRepresentedObject(representedObject, cookie)
@@ -99,7 +101,7 @@ WI.CanvasTabContentView = class CanvasTabContentView extends WI.ContentBrowserTa
 
         this.navigationSidebarPanel.recording = null;
 
-        if (representedObject instanceof WI.CanvasCollection) {
+        if (representedObject instanceof WI.CanvasCollection || representedObject instanceof WI.ShaderProgram) {
             this._overviewNavigationItem.hidden = true;
             WI.navigationSidebar.collapsed = true;
             return;
@@ -194,7 +196,9 @@ WI.CanvasTabContentView = class CanvasTabContentView extends WI.ContentBrowserTa
 
         if (this.canShowRepresentedObject(representedObject)) {
             this.showRepresentedObject(representedObject);
-            this._updateActionIndex(0);
+
+            if (representedObject instanceof WI.Recording)
+                this._updateActionIndex(0);
             return;
         }