Changeset 243763 in webkit
- Timestamp:
- Apr 2, 2019 3:19:05 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 24 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243762 r243763 1 2019-04-02 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Canvas: add support for showing WebGPU contexts 4 https://bugs.webkit.org/show_bug.cgi?id=196413 5 <rdar://problem/49438898> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/canvas/create-context-webgpu.html: Added. 10 * inspector/canvas/create-context-webgpu-expected.txt: Added. 11 * inspector/canvas/resolveCanvasContext-webgpu.html: Added. 12 * inspector/canvas/resolveCanvasContext-webgpu-expected.txt: Added. 13 14 * inspector/canvas/resources/create-context-utilities.js: 15 (createDetachedCanvas): 16 (createCSSCanvas): 17 (destroyCanvases): 18 (TestPage.registerInitializer.InspectorTest.CreateContextUtilities.initializeTestSuite): Added. 19 (TestPage.registerInitializer.InspectorTest.CreateContextUtilities.addSimpleTestCase): Added. 20 (TestPage.registerInitializer.InspectorTest.CreateContextUtilities.addCSSCanvasTestCase): Added. 21 (TestPage.registerInitializer.window.initializeTestSuite): Deleted. 22 (TestPage.registerInitializer.window.addSimpleTestCase): Deleted. 23 (TestPage.registerInitializer.window.addCSSCanvasTestCase): Deleted. 24 25 * inspector/canvas/create-context-2d.html: 26 * inspector/canvas/create-context-2d-expected.txt: 27 * inspector/canvas/create-context-bitmaprenderer.html: 28 * inspector/canvas/create-context-bitmaprenderer-expected.txt: 29 * inspector/canvas/create-context-webgl.html: 30 * inspector/canvas/create-context-webgl-expected.txt: 31 * inspector/canvas/create-context-webgl2.html: 32 * inspector/canvas/create-context-webgl2-expected.txt: 33 34 * platform/gtk/TestExpectations: 35 * platform/ios/TestExpectations: 36 * platform/mac-wk1/TestExpectations: 37 * platform/mac/TestExpectations: 38 * platform/win/TestExpectations: 39 * platform/wincairo/TestExpectations: 40 * platform/wpe/TestExpectations: 41 1 42 2019-04-02 Chris Dumez <cdumez@apple.com> 2 43 -
trunk/LayoutTests/inspector/canvas/create-context-2d-expected.txt
r239976 r243763 20 20 PASS: Canvas context should be 2D. 21 21 0: getContext - [native code] 22 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js: 8:6222 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62 23 23 2: Global Code - [program code] 24 24 3: evaluateWithScopeExtension - [native code] … … 32 32 PASS: Canvas context should be 2D. 33 33 0: getCSSCanvasContext - [native code] 34 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:1 2:4734 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47 35 35 2: Global Code - [program code] 36 36 3: evaluateWithScopeExtension - [native code] -
trunk/LayoutTests/inspector/canvas/create-context-2d.html
r220119 r243763 7 7 <script> 8 8 function test() { 9 let suite = initializeTestSuite("Canvas.CreateContext2D");9 let suite = InspectorTest.CreateContextUtilities.initializeTestSuite("Canvas.CreateContext2D"); 10 10 11 addSimpleTestCase({11 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 12 12 name: "Attached", 13 13 expression: `createAttachedCanvas("2d")`, … … 15 15 }); 16 16 17 addSimpleTestCase({17 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 18 18 name: "Detached", 19 19 expression: `createDetachedCanvas("2d")`, … … 21 21 }); 22 22 23 addCSSCanvasTestCase(WI.Canvas.ContextType.Canvas2D);23 InspectorTest.CreateContextUtilities.addCSSCanvasTestCase(WI.Canvas.ContextType.Canvas2D); 24 24 25 25 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/canvas/create-context-bitmaprenderer-expected.txt
r239976 r243763 20 20 PASS: Canvas context should be Bitmap Renderer. 21 21 0: getContext - [native code] 22 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js: 8:6222 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62 23 23 2: Global Code - [program code] 24 24 3: evaluateWithScopeExtension - [native code] -
trunk/LayoutTests/inspector/canvas/create-context-bitmaprenderer.html
r225884 r243763 7 7 <script> 8 8 function test() { 9 let suite = initializeTestSuite("Canvas.CreateContextBitmapRenderer");9 let suite = InspectorTest.CreateContextUtilities.initializeTestSuite("Canvas.CreateContextBitmapRenderer"); 10 10 11 addSimpleTestCase({11 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 12 12 name: "Attached", 13 13 expression: `createAttachedCanvas("bitmaprenderer")`, … … 15 15 }); 16 16 17 addSimpleTestCase({17 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 18 18 name: "Detached", 19 19 expression: `createDetachedCanvas("bitmaprenderer")`, -
trunk/LayoutTests/inspector/canvas/create-context-webgl-expected.txt
r239976 r243763 20 20 PASS: Canvas context should be WebGL. 21 21 0: getContext - [native code] 22 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js: 8:6222 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62 23 23 2: Global Code - [program code] 24 24 3: evaluateWithScopeExtension - [native code] … … 32 32 PASS: Canvas context should be WebGL. 33 33 0: getCSSCanvasContext - [native code] 34 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:1 2:4734 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47 35 35 2: Global Code - [program code] 36 36 3: evaluateWithScopeExtension - [native code] -
trunk/LayoutTests/inspector/canvas/create-context-webgl.html
r220119 r243763 7 7 <script> 8 8 function test() { 9 let suite = initializeTestSuite("Canvas.CreateContextWebGL");9 let suite = InspectorTest.CreateContextUtilities.initializeTestSuite("Canvas.CreateContextWebGL"); 10 10 11 addSimpleTestCase({11 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 12 12 name: "Attached", 13 13 expression: `createAttachedCanvas("webgl")`, … … 15 15 }); 16 16 17 addSimpleTestCase({17 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 18 18 name: "Detached", 19 19 expression: `createDetachedCanvas("webgl")`, … … 21 21 }); 22 22 23 addCSSCanvasTestCase(WI.Canvas.ContextType.WebGL);23 InspectorTest.CreateContextUtilities.addCSSCanvasTestCase(WI.Canvas.ContextType.WebGL); 24 24 25 25 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/canvas/create-context-webgl2-expected.txt
r239976 r243763 20 20 PASS: Canvas context should be WebGL2. 21 21 0: getContext - [native code] 22 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js: 8:6222 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62 23 23 2: Global Code - [program code] 24 24 3: evaluateWithScopeExtension - [native code] … … 32 32 PASS: Canvas context should be WebGL2. 33 33 0: getCSSCanvasContext - [native code] 34 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:1 2:4734 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47 35 35 2: Global Code - [program code] 36 36 3: evaluateWithScopeExtension - [native code] -
trunk/LayoutTests/inspector/canvas/create-context-webgl2.html
r220119 r243763 10 10 11 11 function test() { 12 let suite = initializeTestSuite("Canvas.CreateContextWebGL2");12 let suite = InspectorTest.CreateContextUtilities.initializeTestSuite("Canvas.CreateContextWebGL2"); 13 13 14 addSimpleTestCase({14 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 15 15 name: "Attached", 16 16 expression: `createAttachedCanvas("webgl2")`, … … 18 18 }); 19 19 20 addSimpleTestCase({20 InspectorTest.CreateContextUtilities.addSimpleTestCase({ 21 21 name: "Detached", 22 22 expression: `createDetachedCanvas("webgl2")`, … … 24 24 }); 25 25 26 addCSSCanvasTestCase(WI.Canvas.ContextType.WebGL2);26 InspectorTest.CreateContextUtilities.addCSSCanvasTestCase(WI.Canvas.ContextType.WebGL2); 27 27 28 28 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/canvas/create-context-webgpu-expected.txt
r243762 r243763 1 Test that CanvasManager tracks creation and destruction of WebG Lcanvases.1 Test that CanvasManager tracks creation and destruction of WebGPU canvases. 2 2 3 3 4 == Running test suite: Canvas.CreateContextWebG L5 -- Running test case: Canvas.CreateContextWebG L.NoCanvases4 == Running test suite: Canvas.CreateContextWebGPU 5 -- Running test case: Canvas.CreateContextWebGPU.NoCanvases 6 6 PASS: CanvasManager should have no canvases. 7 7 8 -- Running test case: Canvas.CreateContextWebG L.Attached9 PASS: Canvas context should be Web GL.8 -- Running test case: Canvas.CreateContextWebGPU.Attached 9 PASS: Canvas context should be Web GPU. 10 10 0: getContext - [native code] 11 11 1: createAttachedCanvas - inspector/canvas/resources/create-context-utilities.js:4:36 … … 17 17 PASS: Removed canvas has expected ID. 18 18 19 -- Running test case: Canvas.CreateContextWebG L.Detached20 PASS: Canvas context should be Web GL.19 -- Running test case: Canvas.CreateContextWebGPU.Detached 20 PASS: Canvas context should be Web GPU. 21 21 0: getContext - [native code] 22 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js: 8:6222 1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62 23 23 2: Global Code - [program code] 24 24 3: evaluateWithScopeExtension - [native code] … … 28 28 PASS: Removed canvas has expected ID. 29 29 30 -- Running test case: Canvas.CreateContextWebG L.CSSCanvas30 -- Running test case: Canvas.CreateContextWebGPU.CSSCanvas 31 31 Create CSS canvas from -webkit-canvas(css-canvas). 32 PASS: Canvas context should be Web GL.32 PASS: Canvas context should be Web GPU. 33 33 0: getCSSCanvasContext - [native code] 34 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:1 2:4734 1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47 35 35 2: Global Code - [program code] 36 36 3: evaluateWithScopeExtension - [native code] -
trunk/LayoutTests/inspector/canvas/resources/create-context-utilities.js
r225892 r243763 3 3 function createAttachedCanvas(contextType) { 4 4 let canvas = document.body.appendChild(document.createElement("canvas")); 5 contexts.push(canvas.getContext(contextType)); 5 let context = canvas.getContext(contextType); 6 if (!context) 7 TestPage.addResult("FAIL: missing context for type " + contextType); 8 contexts.push(context); 6 9 } 7 10 8 11 function createDetachedCanvas(contextType) { 9 contexts.push(document.createElement("canvas").getContext(contextType)); 12 let context = document.createElement("canvas").getContext(contextType); 13 if (!context) 14 TestPage.addResult("FAIL: missing context for type " + contextType); 15 contexts.push(context); 10 16 } 11 17 12 18 function createCSSCanvas(contextType, canvasName) { 13 contexts.push(document.getCSSCanvasContext(contextType, canvasName, 10, 10)); 19 let context = document.getCSSCanvasContext(contextType, canvasName, 10, 10); 20 if (!context) 21 TestPage.addResult("FAIL: missing context for type " + contextType); 22 contexts.push(); 14 23 } 15 24 16 25 function destroyCanvases() { 17 26 for (let context of contexts) { 27 if (!context) 28 continue; 29 18 30 let canvasElement = context.canvas; 19 31 if (canvasElement && canvasElement.parentNode) … … 69 81 } 70 82 71 window.initializeTestSuite = function(name) { 83 InspectorTest.CreateContextUtilities = {}; 84 85 InspectorTest.CreateContextUtilities.initializeTestSuite = function(name) { 72 86 suite = InspectorTest.createAsyncSuite(name); 73 87 … … 84 98 }; 85 99 86 window.addSimpleTestCase = function({name, description, expression, contextType}) {100 InspectorTest.CreateContextUtilities.addSimpleTestCase = function({name, description, expression, contextType}) { 87 101 suite.addTestCase({ 88 102 name: suite.name + "." + name, … … 109 123 110 124 let previousCSSCanvasContextType = null; 111 window.addCSSCanvasTestCase = function(contextType) {125 InspectorTest.CreateContextUtilities.addCSSCanvasTestCase = function(contextType) { 112 126 InspectorTest.assert(!previousCSSCanvasContextType || previousCSSCanvasContextType === contextType, "addCSSCanvasTestCase cannot be called more than once with different context types."); 113 127 if (!previousCSSCanvasContextType) … … 124 138 .then(resolve, reject); 125 139 126 let contextId = contextType === WI.Canvas.ContextType.Canvas2D ? "2d" : contextType; 140 let contextId = null; 141 if (contextType === WI.Canvas.ContextType.Canvas2D) 142 contextId = "2d"; 143 else if (contextType === WI.Canvas.ContextType.WebGPU) 144 contextId = "gpu"; 145 else 146 contextId = contextType; 147 127 148 InspectorTest.log(`Create CSS canvas from -webkit-canvas(css-canvas).`); 128 149 InspectorTest.evaluateInPage(`createCSSCanvas("${contextId}", "css-canvas")`); -
trunk/LayoutTests/platform/gtk/TestExpectations
r243666 r243763 1237 1237 # No support for WebGPU yet 1238 1238 webkit.org/b/191005 webgpu/ [ Skip ] 1239 webkit.org/b/191005 inspector/canvas/create-context-webgpu.html [ Skip ] 1240 webkit.org/b/191005 inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 1239 1241 1240 1242 # No support for resource load statistics yet -
trunk/LayoutTests/platform/ios/TestExpectations
r243737 r243763 42 42 # WebGPU is not enabled on iOS Simulator. 43 43 webgpu [ Skip ] 44 inspector/canvas/create-context-webgpu.html [ Skip ] 45 inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 44 46 45 47 # Encrypted Media Extensions are not enabled -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r243749 r243763 44 44 css-typedom [ Skip ] 45 45 css-dark-mode [ Skip ] 46 46 47 webgpu [ Skip ] 48 inspector/canvas/create-context-webgpu.html [ Skip ] 49 inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 47 50 48 51 # Media Stream API testing is not supported for WK1 yet. -
trunk/LayoutTests/platform/mac/TestExpectations
r243750 r243763 1780 1780 1781 1781 webkit.org/b/192956 [ Sierra ] webgpu [ Skip ] 1782 webkit.org/b/192956 [ Sierra ] inspector/canvas/create-context-webgpu.html [ Skip ] 1783 webkit.org/b/192956 [ Sierra ] inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 1782 1784 1783 1785 webkit.org/b/189680 platform/mac/media/audio-session-category-video-paused.html [ Pass Timeout ] -
trunk/LayoutTests/platform/win/TestExpectations
r243714 r243763 4218 4218 # WebGPU is not supported on Windows 4219 4219 webgpu [ Skip ] 4220 inspector/canvas/create-context-webgpu.html [ Skip ] 4221 inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 4220 4222 4221 4223 webkit.org/b/191194 fast/block/basic/inline-content-with-floating-image.html [ Failure ] -
trunk/LayoutTests/platform/wincairo/TestExpectations
r243666 r243763 292 292 # WEBGPU is disabled 293 293 webgpu [ Skip ] 294 inspector/canvas/create-context-webgpu.html [ Skip ] 295 inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 294 296 295 297 # WIRELESS_PLAYBACK_TARGET is disabled -
trunk/LayoutTests/platform/wpe/TestExpectations
r243666 r243763 296 296 # No WebGPU support yet 297 297 webgpu [ Skip ] 298 inspector/canvas/create-context-webgpu.html [ Skip ] 299 inspector/canvas/resolveCanvasContext-webgpu.html [ Skip ] 298 300 299 301 # Skipped due to untestable DRM key system. ClearKey counterparts are tested instead. -
trunk/Source/WebCore/ChangeLog
r243762 r243763 1 2019-04-02 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Canvas: add support for showing WebGPU contexts 4 https://bugs.webkit.org/show_bug.cgi?id=196413 5 <rdar://problem/49438898> 6 7 Reviewed by Timothy Hatcher. 8 9 Tests: inspector/canvas/create-context-webgpu.html 10 inspector/canvas/resolveCanvasContext-webgpu.html 11 12 * Modules/webgpu/GPUCanvasContext.idl: 13 * Modules/webgpu/GPUCanvasContext.h: 14 (WebCore::GPUCanvasContext::canvas const): Added. 15 * Modules/webgpu/GPUCanvasContext.cpp: 16 (WebCore::GPUCanvasContext::create): 17 18 * testing/InternalSettings.idl: 19 * testing/InternalSettings.h: 20 * testing/InternalSettings.cpp: 21 (WebCore::InternalSettings::setWebGPUEnabled): Added. 22 1 23 2019-04-02 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebCore/Modules/webgpu/GPUCanvasContext.cpp
r242759 r243763 27 27 #include "GPUCanvasContext.h" 28 28 29 #include "InspectorInstrumentation.h" 30 29 31 #if ENABLE(WEBGPU) 30 32 … … 35 37 auto context = std::unique_ptr<GPUCanvasContext>(new GPUCanvasContext(canvas)); 36 38 context->suspendIfNeeded(); 39 40 InspectorInstrumentation::didCreateCanvasRenderingContext(*context); 41 37 42 return context; 38 43 } -
trunk/Source/WebCore/Modules/webgpu/GPUCanvasContext.h
r242759 r243763 29 29 30 30 #include "GPUBasedCanvasRenderingContext.h" 31 #include "HTMLCanvasElement.h" 31 32 #include "WebGPUSwapChain.h" 32 33 #include <wtf/RefPtr.h> … … 37 38 public: 38 39 static std::unique_ptr<GPUCanvasContext> create(CanvasBase&); 40 41 HTMLCanvasElement& canvas() const { return downcast<HTMLCanvasElement>(canvasBase()); } 39 42 40 43 void replaceSwapChain(Ref<WebGPUSwapChain>&&); -
trunk/Source/WebCore/Modules/webgpu/GPUCanvasContext.idl
r242759 r243763 29 29 EnabledAtRuntime=WebGPU 30 30 ] interface GPUCanvasContext { 31 // back-reference to the canvas 32 readonly attribute HTMLCanvasElement canvas; 31 33 }; -
trunk/Source/WebCore/testing/InternalSettings.cpp
r243666 r243763 759 759 } 760 760 761 void InternalSettings::setWebGPUEnabled(bool enabled) 762 { 763 #if ENABLE(WEBGPU) 764 RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(enabled); 765 #else 766 UNUSED_PARAM(enabled); 767 #endif 768 } 769 761 770 void InternalSettings::setWebVREnabled(bool enabled) 762 771 { -
trunk/Source/WebCore/testing/InternalSettings.h
r243666 r243763 124 124 static void setIndexedDBWorkersEnabled(bool); 125 125 static void setWebGL2Enabled(bool); 126 static void setWebGPUEnabled(bool); 126 127 static void setWebVREnabled(bool); 127 128 static void setScreenCaptureEnabled(bool); -
trunk/Source/WebCore/testing/InternalSettings.idl
r243666 r243763 92 92 void setIndexedDBWorkersEnabled(boolean enabled); 93 93 void setWebGL2Enabled(boolean enabled); 94 void setWebGPUEnabled(boolean enabled); 94 95 void setWebVREnabled(boolean enabled); 95 96 void setScreenCaptureEnabled(boolean enabled);
Note: See TracChangeset
for help on using the changeset viewer.