Web Inspector: Canvas: add compatibility support for WebMetal
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Apr 2019 22:38:29 +0000 (22:38 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Apr 2019 22:38:29 +0000 (22:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196412
<rdar://problem/49439417>

Reviewed by Joseph Pecoraro.

* UserInterface/Models/Canvas.js:
(WI.Canvas.fromPayload):
(WI.Canvas.displayNameForContextType):
* UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
* Versions/Inspector-iOS-12.2.json:

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/Canvas.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js
Source/WebInspectorUI/Versions/Inspector-iOS-12.2.json

index 33f046e..56ea3af 100644 (file)
@@ -1,5 +1,19 @@
 2019-04-01  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Canvas: add compatibility support for WebMetal
+        https://bugs.webkit.org/show_bug.cgi?id=196412
+        <rdar://problem/49439417>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Models/Canvas.js:
+        (WI.Canvas.fromPayload):
+        (WI.Canvas.displayNameForContextType):
+        * UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
+        * Versions/Inspector-iOS-12.2.json:
+
+2019-04-01  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: "Copy as HTML" appears twice when showing a context menu for a logged node
         https://bugs.webkit.org/show_bug.cgi?id=196271
         <rdar://problem/49290676>
index 8fe2dd3..7a3880f 100644 (file)
@@ -75,6 +75,9 @@ WI.Canvas = class Canvas extends WI.Object
         case CanvasAgent.ContextType.WebGPU:
             contextType = WI.Canvas.ContextType.WebGPU;
             break;
+        case CanvasAgent.ContextType.WebMetal:
+            contextType = WI.Canvas.ContextType.WebMetal;
+            break;
         default:
             console.error("Invalid canvas context type", payload.contextType);
         }
@@ -101,6 +104,8 @@ WI.Canvas = class Canvas extends WI.Object
             return WI.unlocalizedString("WebGL2");
         case WI.Canvas.ContextType.WebGPU:
             return WI.unlocalizedString("Web GPU");
+        case WI.Canvas.ContextType.WebMetal:
+            return WI.unlocalizedString("WebMetal");
         default:
             console.error("Invalid canvas context type", contextType);
         }
@@ -408,6 +413,7 @@ WI.Canvas.ContextType = {
     WebGL: "webgl",
     WebGL2: "webgl2",
     WebGPU: "webgpu",
+    WebMetal: "webmetal",
 };
 
 WI.Canvas.RecordingState = {
index 42c4cb5..8ac5c10 100644 (file)
@@ -67,7 +67,7 @@ InspectorBackend.activateDomain("CSS", ["web"]);
 
 // Canvas.
 InspectorBackend.registerCanvasDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Canvas");
-InspectorBackend.registerEnum("Canvas.ContextType", {Canvas2D: "canvas-2d", BitmapRenderer: "bitmaprenderer", WebGL: "webgl", WebGL2: "webgl2"});
+InspectorBackend.registerEnum("Canvas.ContextType", {Canvas2D: "canvas-2d", BitmapRenderer: "bitmaprenderer", WebGL: "webgl", WebGL2: "webgl2", WebMetal: "webmetal"});
 InspectorBackend.registerEnum("Canvas.ShaderType", {Fragment: "fragment", Vertex: "vertex"});
 InspectorBackend.registerEvent("Canvas.canvasAdded", ["canvas"]);
 InspectorBackend.registerEvent("Canvas.canvasRemoved", ["canvasId"]);
index 18702dc..9d52dbe 100644 (file)
         {
             "id": "ContextType",
             "type": "string",
-            "enum": ["canvas-2d", "bitmaprenderer", "webgl", "webgl2"],
+            "enum": ["canvas-2d", "bitmaprenderer", "webgl", "webgl2", "webmetal"],
             "description": "The type of rendering context backing the canvas element."
         },
         {