RESOLVED FIXED 173396
Web Inspector: Support listing WebGL2 and WebGPU contexts
https://bugs.webkit.org/show_bug.cgi?id=173396
Summary Web Inspector: Support listing WebGL2 and WebGPU contexts
Devin Rousso
Reported 2017-06-14 18:34:29 PDT
Currently, only 2d and WebGL(1) contexts are tracked. We should support all types of canvas contexts.
Attachments
[Patch] WIP (8.50 KB, patch)
2017-06-14 22:53 PDT, Devin Rousso
hi: review-
hi: commit-queue-
Patch (8.82 KB, patch)
2017-06-16 10:11 PDT, Devin Rousso
no flags
Patch (8.00 KB, patch)
2017-06-20 00:56 PDT, Devin Rousso
no flags
Patch (16.38 KB, patch)
2017-06-20 18:33 PDT, Devin Rousso
buildbot: commit-queue-
Archive of layout-test-results from ews115 for mac-elcapitan (1.77 MB, application/zip)
2017-06-20 20:00 PDT, Build Bot
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (1.38 MB, application/zip)
2017-06-20 20:10 PDT, Build Bot
no flags
Patch (23.92 KB, patch)
2017-06-20 22:00 PDT, Devin Rousso
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-elcapitan (1.22 MB, application/zip)
2017-06-20 23:09 PDT, Build Bot
no flags
Patch (15.46 KB, patch)
2017-06-20 23:21 PDT, Devin Rousso
buildbot: commit-queue-
Archive of layout-test-results from ews100 for mac-elcapitan (1.25 MB, application/zip)
2017-06-20 23:59 PDT, Build Bot
no flags
Archive of layout-test-results from ews117 for mac-elcapitan (1.78 MB, application/zip)
2017-06-21 00:43 PDT, Build Bot
no flags
Patch (16.37 KB, patch)
2017-06-21 10:32 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews101 for mac-elcapitan (1001.18 KB, application/zip)
2017-06-21 11:33 PDT, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (1.76 MB, application/zip)
2017-06-21 11:56 PDT, Build Bot
no flags
Patch (33.44 KB, patch)
2017-06-28 19:37 PDT, Devin Rousso
buildbot: commit-queue-
Archive of layout-test-results from ews114 for mac-elcapitan (1.85 MB, application/zip)
2017-06-28 20:57 PDT, Build Bot
no flags
Archive of layout-test-results from ews101 for mac-elcapitan (991.61 KB, application/zip)
2017-06-29 11:56 PDT, Build Bot
no flags
Patch (35.12 KB, patch)
2017-06-29 15:47 PDT, Devin Rousso
joepeck: review-
joepeck: commit-queue-
Archive of layout-test-results from ews102 for mac-elcapitan (1.06 MB, application/zip)
2017-06-29 16:50 PDT, Build Bot
no flags
Archive of layout-test-results from ews115 for mac-elcapitan (1.76 MB, application/zip)
2017-06-29 17:09 PDT, Build Bot
no flags
[Patch] For bots (35.98 KB, patch)
2017-06-30 17:19 PDT, Devin Rousso
buildbot: commit-queue-
Archive of layout-test-results from ews103 for mac-elcapitan (1.11 MB, application/zip)
2017-06-30 19:30 PDT, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-elcapitan (1.80 MB, application/zip)
2017-06-30 19:35 PDT, Build Bot
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.32 MB, application/zip)
2017-06-30 20:02 PDT, Build Bot
no flags
Patch (36.64 KB, patch)
2017-06-30 21:28 PDT, Devin Rousso
no flags
Patch (36.44 KB, patch)
2017-07-01 00:40 PDT, Devin Rousso
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-elcapitan (1018.29 KB, application/zip)
2017-07-01 02:27 PDT, Build Bot
no flags
Patch (36.42 KB, patch)
2017-07-01 10:45 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2017-06-14 22:53:58 PDT
Created attachment 312954 [details] [Patch] WIP
Devin Rousso
Comment 2 2017-06-16 10:11:40 PDT
Devin Rousso
Comment 3 2017-06-20 00:56:03 PDT
Build Bot
Comment 4 2017-06-20 00:58:22 PDT
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Matt Baker
Comment 5 2017-06-20 16:17:49 PDT
Comment on attachment 313380 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=313380&action=review > Source/WebCore/ChangeLog:8 > + No new tests because this just adds extra values to an existing enum. At minimum we should test that WebGL2 and WebGPU contexts are being instrumented. Adding two simple test cases to LayoutTests/inspector/canvas/create-canvas-contexts.html should be enough: let simpleTestCases = [ ... { name: "CreateWebGL2CanvasContext", expression: `createCanvas("webgl2")`, contextType: WebInspector.Canvas.ContextType.WebGL2, }, { name: "CreateWebGPUCanvasContext", expression: `createCanvas("webgpu")`, contextType: WebInspector.Canvas.ContextType.WebGPU, } ]; For this to work, you'll need to add the following to your test: if (window.internals) { internals.settings.setWebGL2Enabled(true); internals.settings.setWebGPUEnabled(true); } > Source/WebCore/inspector/InspectorCanvasAgent.cpp:274 > + else if (is<WebGL2RenderingContext>(context)) There is a separate WEBGL2 guard.
Devin Rousso
Comment 6 2017-06-20 18:33:37 PDT
Build Bot
Comment 7 2017-06-20 20:00:55 PDT
Comment on attachment 313464 [details] Patch Attachment 313464 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3969299 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 8 2017-06-20 20:00:57 PDT
Created attachment 313477 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 9 2017-06-20 20:10:15 PDT
Comment on attachment 313464 [details] Patch Attachment 313464 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3969430 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 10 2017-06-20 20:10:16 PDT
Created attachment 313480 [details] Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 11 2017-06-20 22:00:43 PDT
Build Bot
Comment 12 2017-06-20 23:09:34 PDT
Comment on attachment 313490 [details] Patch Attachment 313490 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3970240 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 13 2017-06-20 23:09:35 PDT
Created attachment 313494 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 14 2017-06-20 23:21:40 PDT
Build Bot
Comment 15 2017-06-20 23:59:45 PDT
Comment on attachment 313495 [details] Patch Attachment 313495 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3970425 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 16 2017-06-20 23:59:47 PDT
Created attachment 313497 [details] Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 17 2017-06-21 00:43:06 PDT
Comment on attachment 313495 [details] Patch Attachment 313495 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3970518 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 18 2017-06-21 00:43:08 PDT
Created attachment 313499 [details] Archive of layout-test-results from ews117 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 19 2017-06-21 10:32:00 PDT
Build Bot
Comment 20 2017-06-21 11:33:24 PDT
Comment on attachment 313528 [details] Patch Attachment 313528 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3973153 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 21 2017-06-21 11:33:26 PDT
Created attachment 313536 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 22 2017-06-21 11:56:24 PDT
Comment on attachment 313528 [details] Patch Attachment 313528 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3973168 New failing tests: inspector/canvas/create-canvas-contexts.html
Build Bot
Comment 23 2017-06-21 11:56:26 PDT
Created attachment 313537 [details] Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Joseph Pecoraro
Comment 24 2017-06-21 13:31:32 PDT
Comment on attachment 313528 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=313528&action=review > LayoutTests/inspector/canvas/create-canvas-contexts.html:8 > + window.internals.settings.setWebGPUEnabled(true); The WebGPU portions of this test are only going to pass if a port enables ENABLE_WEBGPU. The WebGL2 portions of this test are only going to pass if a port enables ENABLE_WEBGL2. I think some ports don't do this (GTK/Windows) so they would fail this test. It might be easier to break these out into their own test that can be skipped per-port based on feature availability. LayoutTests/inspector/canvas/canvas-contexts.html # if needed a test for multiple LayoutTests/inspector/canvas/context-type-2d.html LayoutTests/inspector/canvas/context-type-webgl.html LayoutTests/inspector/canvas/context-type-webgl2.html LayoutTests/inspector/canvas/context-type-webgpu.html There is a way to share code between tests if you want to go that approach. Its up to you though if you want to go down this road. -- I'm not sure why this test is timing out. You can add `InspectorTest.debug()`, attach a new patch, and when EWS fails, you can get the debug output.
Devin Rousso
Comment 25 2017-06-28 19:37:05 PDT
Build Bot
Comment 26 2017-06-28 20:57:28 PDT
Comment on attachment 314093 [details] Patch Attachment 314093 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4017477 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 27 2017-06-28 20:57:29 PDT
Created attachment 314107 [details] Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 28 2017-06-29 11:56:29 PDT
Comment on attachment 314093 [details] Patch Attachment 314093 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4020738 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 29 2017-06-29 11:56:31 PDT
Created attachment 314149 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 30 2017-06-29 15:47:11 PDT
Build Bot
Comment 31 2017-06-29 15:50:45 PDT
Attachment 314179 [details] did not pass style-queue: WARNING: Not running on native Windows. ERROR: LayoutTests/platform/win/TestExpectations:2386: Path does not exist. [test/expectations] [5] ERROR: LayoutTests/platform/ios/TestExpectations:45: Path does not exist. [test/expectations] [5] ERROR: LayoutTests/platform/gtk/TestExpectations:1263: Path does not exist. [test/expectations] [5] Total errors found: 3 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 32 2017-06-29 16:46:07 PDT
Comment on attachment 314179 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=314179&action=review Very nice! > LayoutTests/inspector/canvas/resources/create-context-utilities.js:69 > + name: suite.name + "." + name, I'm on the fence about this. I think its fine, you are generating tests. But one of the things I've always tried to strive for is the ability to search our code for the name of a failing test case: "Canvas.CreateContextWebGPU.NoCanvases" and find the code associated with it. This breaks that, but I'm probably overblowing the usefulness. I don't think I've actually done this search many times. > LayoutTests/inspector/canvas/resources/create-context-utilities.js:91 > + window.addCSSCanvasTestCase = function(contextType) { It is my understanding that you can't change the context inside of a -webkit-canvas. Can you throw an error if this gets called more than once in a test? Basically something like this: let addedCSSCanvas = false; window.addCSSCanvasTestCase = function(contextType) { InspectorTest.assert(!addedCSSCanvas, "addCSSCanvasTestCase should only be called once in a test"); addedCSSCanvas = true; ... suite.addTestCase ... }); > LayoutTests/platform/gtk/TestExpectations:1263 > +inspector/canvas/create-context-webpu.html [ Skip ] This is a typo it should be webgpu.html > LayoutTests/platform/ios/TestExpectations:45 > +inspector/canvas/create-context-webpu.html [ Skip ] This is a typo it should be webgpu.html > LayoutTests/platform/win/TestExpectations:2386 > +inspector/canvas/create-context-webpu.html [ Skip ] Remove this line. > Source/WebCore/inspector/InspectorCanvasAgent.cpp:49 > +#if ENABLE(WEBGL) > +#if ENABLE(WEBGL2) > +#include "WebGL2RenderingContext.h" > +#endif > #include "WebGLContextAttributes.h" > +#include "WebGLRenderingContext.h" > #include "WebGLRenderingContextBase.h" > +#endif > + > +#if ENABLE(WEBGPU) > +#include "WebGPURenderingContext.h" > +#endif This is a mess. I'd recommend not nesting WEBGL2 and WEBGL. Just: #if ENABLE(WEBGL) #include "WebGLRenderingContext.h" #endif #if ENABLE(WEBGL2) #include "WebGLContextAttributes.h" #include "WebGL2RenderingContext.h" #include "WebGLRenderingContextBase.h" #endif #if ENABLE(WEBGPU) #include "WebGPURenderingContext.h" #endif > Source/WebCore/inspector/InspectorCanvasAgent.cpp:52 > #include <inspector/IdentifiersFactory.h> > #include <inspector/InspectorProtocolObjects.h> Style: These would normally be next to line 36. > Source/WebCore/inspector/InspectorCanvasAgent.cpp:283 > +#if ENABLE(WEBGL) > + else if (is<WebGLRenderingContext>(context)) > contextType = Inspector::Protocol::Canvas::ContextType::WebGL; > +#if ENABLE(WEBGL2) > + else if (is<WebGL2RenderingContext>(context)) > + contextType = Inspector::Protocol::Canvas::ContextType::WebGL2; > +#endif > +#endif Likewise this doesn't need to nest and it becomes much more readable: #if ENABLE(WEBGL) else if (is<WebGLRenderingContext>(context)) contextType = Inspector::Protocol::Canvas::ContextType::WebGL; #endif #if ENABLE(WEBGL2) else if (is<WebGL2RenderingContext>(context)) contextType = Inspector::Protocol::Canvas::ContextType::WebGL2; #endif #if ENABLE(WEBGPU) else if (is<WebGPURenderingContext>(context)) contextType = Inspector::Protocol::Canvas::ContextType::WebGPU; #endif > Source/WebInspectorUI/UserInterface/Models/Canvas.js:189 > Canvas2D: "canvas-2d", > WebGL: "webgl", > + WebGL2: "webgl2", > + WebGPU: "webgpu", Have we considered different icons for these?
Build Bot
Comment 33 2017-06-29 16:50:00 PDT
Comment on attachment 314179 [details] Patch Attachment 314179 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4022399 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 34 2017-06-29 16:50:02 PDT
Created attachment 314186 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 35 2017-06-29 17:09:45 PDT
Comment on attachment 314179 [details] Patch Attachment 314179 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4022428 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 36 2017-06-29 17:09:46 PDT
Created attachment 314189 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Joseph Pecoraro
Comment 37 2017-06-29 17:15:13 PDT
Comment on attachment 314179 [details] Patch Hmm, the test is failing on Mac. Maybe we should spend some time trying to figure out why.
Devin Rousso
Comment 38 2017-06-30 17:19:05 PDT
Created attachment 314330 [details] [Patch] For bots
Build Bot
Comment 39 2017-06-30 19:30:40 PDT
Comment on attachment 314330 [details] [Patch] For bots Attachment 314330 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4030645 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 40 2017-06-30 19:30:42 PDT
Created attachment 314350 [details] Archive of layout-test-results from ews103 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 41 2017-06-30 19:35:36 PDT
Comment on attachment 314330 [details] [Patch] For bots Attachment 314330 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4030613 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 42 2017-06-30 19:35:37 PDT
Created attachment 314352 [details] Archive of layout-test-results from ews113 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 43 2017-06-30 20:02:30 PDT
Comment on attachment 314330 [details] [Patch] For bots Attachment 314330 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4030844 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 44 2017-06-30 20:02:32 PDT
Created attachment 314357 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Devin Rousso
Comment 45 2017-06-30 21:28:23 PDT
Devin Rousso
Comment 46 2017-07-01 00:40:09 PDT
Build Bot
Comment 47 2017-07-01 02:27:51 PDT
Comment on attachment 314375 [details] Patch Attachment 314375 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4032891 New failing tests: inspector/canvas/create-context-webgpu.html inspector/canvas/create-context-webgl2.html
Build Bot
Comment 48 2017-07-01 02:27:53 PDT
Created attachment 314378 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 49 2017-07-01 10:45:20 PDT
Joseph Pecoraro
Comment 50 2017-07-03 10:49:23 PDT
Comment on attachment 314387 [details] Patch r=me
WebKit Commit Bot
Comment 51 2017-07-03 11:21:28 PDT
Comment on attachment 314387 [details] Patch Clearing flags on attachment: 314387 Committed r219078: <http://trac.webkit.org/changeset/219078>
WebKit Commit Bot
Comment 52 2017-07-03 11:21:30 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 53 2017-07-03 11:54:29 PDT
Note You need to log in before you can comment on or make changes to this bug.