Changeset 284801 in webkit
- Timestamp:
- Oct 25, 2021, 12:09:31 PM (5 years ago)
- Location:
- branches/safari-612-branch
- Files:
-
- 1 added
- 21 edited
- 8 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/canvas/context-attributes-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-2d-full-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-bitmaprenderer-full-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-html-2d-expected.txt (modified) (7 diffs)
-
LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl-full-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl-snapshots-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/canvas/recording-webgl2-snapshots-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas (added)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-frameCount-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-full-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-full-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-memoryLimit-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-snapshots-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-snapshots-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-frameCount-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-full-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-memoryLimit-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt ) (1 diff)
-
LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-snapshots-expected.txt (copied) (copied from branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-snapshots-expected.txt ) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/inspector/protocol/Canvas.json (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/InspectorCanvas.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612-branch/LayoutTests/ChangeLog
r284707 r284801 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r282984. rdar://problem/77587429 4 5 Web Inspector: Graphics: add instrumentation for new `CanvasRenderingContext2DSettings` 6 https://bugs.webkit.org/show_bug.cgi?id=225180 7 <rdar://problem/77587429> 8 9 Reviewed by BJ Burg. 10 11 Source/JavaScriptCore: 12 13 * inspector/protocol/Canvas.json: 14 Add `colorSpace` and `desynchronized` to `Canvas.ContextAttributes`. 15 16 Source/WebCore: 17 18 * inspector/InspectorCanvas.cpp: 19 (WebCore::buildObjectForCanvasContextAttributes): Added. 20 (WebCore::InspectorCanvas::buildObjectForCanvas): 21 (WebCore::InspectorCanvas::buildInitialState): 22 Unify the two cases where we fetch canvas attributes into a single method so that both get 23 the same data. This means that the canvas recorder now also uses `Canvas.ContextAttributes`. 24 25 LayoutTests: 26 27 * inspector/canvas/context-attributes-expected.txt: 28 * inspector/canvas/recording-2d-frameCount-expected.txt: 29 * inspector/canvas/recording-2d-full-expected.txt: 30 * inspector/canvas/recording-2d-memoryLimit-expected.txt: 31 * inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt: 32 * inspector/canvas/recording-bitmaprenderer-full-expected.txt: 33 * inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt: 34 * inspector/canvas/recording-html-2d-expected.txt: 35 * inspector/canvas/recording-webgl-frameCount-expected.txt: 36 * inspector/canvas/recording-webgl-full-expected.txt: 37 * inspector/canvas/recording-webgl-memoryLimit-expected.txt: 38 * inspector/canvas/recording-webgl-snapshots-expected.txt: 39 * inspector/canvas/recording-webgl2-frameCount-expected.txt: 40 * inspector/canvas/recording-webgl2-full-expected.txt: 41 * inspector/canvas/recording-webgl2-memoryLimit-expected.txt: 42 * inspector/canvas/recording-webgl2-snapshots-expected.txt: 43 44 45 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282984 268f45cc-cd09-0410-ab3c-d52691b4dbfc 46 47 2021-09-23 Devin Rousso <drousso@apple.com> 48 49 Web Inspector: Graphics: add instrumentation for new `CanvasRenderingContext2DSettings` 50 https://bugs.webkit.org/show_bug.cgi?id=225180 51 <rdar://problem/77587429> 52 53 Reviewed by BJ Burg. 54 55 * inspector/canvas/context-attributes-expected.txt: 56 * inspector/canvas/recording-2d-frameCount-expected.txt: 57 * inspector/canvas/recording-2d-full-expected.txt: 58 * inspector/canvas/recording-2d-memoryLimit-expected.txt: 59 * inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt: 60 * inspector/canvas/recording-bitmaprenderer-full-expected.txt: 61 * inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt: 62 * inspector/canvas/recording-html-2d-expected.txt: 63 * inspector/canvas/recording-webgl-frameCount-expected.txt: 64 * inspector/canvas/recording-webgl-full-expected.txt: 65 * inspector/canvas/recording-webgl-memoryLimit-expected.txt: 66 * inspector/canvas/recording-webgl-snapshots-expected.txt: 67 * inspector/canvas/recording-webgl2-frameCount-expected.txt: 68 * inspector/canvas/recording-webgl2-full-expected.txt: 69 * inspector/canvas/recording-webgl2-memoryLimit-expected.txt: 70 * inspector/canvas/recording-webgl2-snapshots-expected.txt: 71 1 72 2021-10-22 Alan Coon <alancoon@apple.com> 2 73 -
branches/safari-612-branch/LayoutTests/inspector/canvas/context-attributes-expected.txt
r249809 r284801 6 6 Added canvas. 7 7 PASS: Canvas context should be "2D". 8 {} 8 { 9 "colorSpace": "srgb", 10 "desynchronized": false 11 } 9 12 10 13 -- Running test case: CreateBitmapRendererCanvasContext -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt
r274101 r284801 32 32 setPath: [""] 33 33 parameters: 34 0: {"colorSpace":"srgb","desynchronized":false} 34 35 content: <filtered> 35 36 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-2d-full-expected.txt
r274101 r284801 32 32 setPath: [""] 33 33 parameters: 34 0: {"colorSpace":"srgb","desynchronized":false} 34 35 content: <filtered> 35 36 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt
r274101 r284801 32 32 setPath: [""] 33 33 parameters: 34 0: {"colorSpace":"srgb","desynchronized":false} 34 35 content: <filtered> 35 36 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt
r249509 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true} 11 12 content: <filtered> 12 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-bitmaprenderer-full-expected.txt
r249509 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true} 11 12 content: <filtered> 12 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt
r249509 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true} 11 12 content: <filtered> 12 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-html-2d-expected.txt
r277547 r284801 30 30 canvas.height = 2; 31 31 32 let context = canvas.getContext("2d" );32 let context = canvas.getContext("2d", objects[0]); 33 33 34 34 let frames = [ 35 35 function initialState() { 36 context.drawImage(objects[ 0], 0, 0);36 context.drawImage(objects[1], 0, 0); 37 37 38 38 context.direction = "ltr"; … … 61 61 context.webkitLineDashOffset = 0; 62 62 if ("setPath" in context) 63 context.setPath(objects[ 1]);63 context.setPath(objects[2]); 64 64 context.save(); 65 65 … … 89 89 context.webkitLineDashOffset = 0; 90 90 if ("setPath" in context) 91 context.setPath(objects[ 2]);91 context.setPath(objects[3]); 92 92 context.save(); 93 93 … … 117 117 context.webkitLineDashOffset = 0; 118 118 if ("setPath" in context) 119 context.setPath(objects[ 3]);119 context.setPath(objects[4]); 120 120 }, 121 121 function startRecording() { … … 126 126 context.fillStyle; 127 127 context.fillStyle = "test"; 128 context.fillStyle = objects[4];129 128 context.fillStyle = objects[5]; 130 129 context.fillStyle = objects[6]; 131 130 context.fillStyle = objects[7]; 131 context.fillStyle = objects[8]; 132 132 }, 133 133 function frame2() { … … 138 138 }, 139 139 function frame4() { 140 context.drawImage(objects[ 8], 11, 12);140 context.drawImage(objects[9], 11, 12); 141 141 }, 142 142 function frame5() { 143 context.createImageData(objects[ 9]);143 context.createImageData(objects[10]); 144 144 }, 145 145 function frame6() { 146 context.drawImage(objects[1 0], 11, 12);146 context.drawImage(objects[11], 11, 12); 147 147 }, 148 148 function frame7() { 149 context.setTransform(objects[1 1]);149 context.setTransform(objects[12]); 150 150 }, 151 151 function frame8() { 152 // context.drawFocusIfNeeded(objects[1 2], "Element");152 // context.drawFocusIfNeeded(objects[13], "Element"); 153 153 }, 154 154 function stopRecording() { … … 218 218 } 219 219 220 rebuildImage(0, <filtered>); 221 rebuildPath2D(1, ""); 220 rebuildImage(1, <filtered>); 222 221 rebuildPath2D(2, ""); 223 222 rebuildPath2D(3, ""); 224 rebuildCanvasGradient(4, {"type":"linear-gradient","points":[1,2,3,4],"stops":[{"offset":1,"color":"rgb(255, 0, 0)"},{"offset":1,"color":"rgb(0, 0, 255)"}]}); 225 rebuildCanvasGradient(5, {"type":"radial-gradient","points":[1,2,3,4,5,6],"stops":[]}); 226 rebuildCanvasGradient(6, {"type":"conic-gradient","points":[2,3,1],"stops":[{"offset":1,"color":"rgb(0, 128, 0)"}]}); 227 rebuildCanvasPattern(7, {"image":<filtered>,"repeat":"no-repeat"}); 228 rebuildImage(8, <filtered>); 229 rebuildImageData(9, {"data":[0,0,0,0,0,0,0,0],"width":1,"height":2}); 230 rebuildImageBitmap(10, <filtered>); 231 rebuildDOMMatrix(11, "matrix(1, 2, 3, 4, 5, 6)"); 232 rebuildPath2D(12, "M1 2"); 223 rebuildPath2D(4, ""); 224 rebuildCanvasGradient(5, {"type":"linear-gradient","points":[1,2,3,4],"stops":[{"offset":1,"color":"rgb(255, 0, 0)"},{"offset":1,"color":"rgb(0, 0, 255)"}]}); 225 rebuildCanvasGradient(6, {"type":"radial-gradient","points":[1,2,3,4,5,6],"stops":[]}); 226 rebuildCanvasGradient(7, {"type":"conic-gradient","points":[2,3,1],"stops":[{"offset":1,"color":"rgb(0, 128, 0)"}]}); 227 rebuildCanvasPattern(8, {"image":<filtered>,"repeat":"no-repeat"}); 228 rebuildImage(9, <filtered>); 229 rebuildImageData(10, {"data":[0,0,0,0,0,0,0,0],"width":1,"height":2}); 230 rebuildImageBitmap(11, <filtered>); 231 rebuildDOMMatrix(12, "matrix(1, 2, 3, 4, 5, 6)"); 232 rebuildPath2D(13, "M1 2"); 233 233 234 234 Promise.all(promises).then(function() { -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt
r246016 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-full-expected.txt
r265841 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt
r246016 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl-snapshots-expected.txt
r242225 r284801 9 9 height: 150 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt
r265711 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt
r273865 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt
r265711 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/inspector/canvas/recording-webgl2-snapshots-expected.txt
r265711 r284801 9 9 height: 150 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"default","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-frameCount-expected.txt
r284707 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-full-expected.txt
r284707 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-memoryLimit-expected.txt
r284707 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-snapshots-expected.txt
r284707 r284801 9 9 height: 150 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-frameCount-expected.txt
r284707 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-full-expected.txt
r284707 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-memoryLimit-expected.txt
r284707 r284801 9 9 height: 2 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-snapshots-expected.txt
r284707 r284801 9 9 height: 150 10 10 parameters: 11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false," failIfMajorPerformanceCaveat":false}11 0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"powerPreference":"low-power","failIfMajorPerformanceCaveat":false} 12 12 content: <filtered> 13 13 frames: -
branches/safari-612-branch/Source/JavaScriptCore/ChangeLog
r284426 r284801 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r282984. rdar://problem/77587429 4 5 Web Inspector: Graphics: add instrumentation for new `CanvasRenderingContext2DSettings` 6 https://bugs.webkit.org/show_bug.cgi?id=225180 7 <rdar://problem/77587429> 8 9 Reviewed by BJ Burg. 10 11 Source/JavaScriptCore: 12 13 * inspector/protocol/Canvas.json: 14 Add `colorSpace` and `desynchronized` to `Canvas.ContextAttributes`. 15 16 Source/WebCore: 17 18 * inspector/InspectorCanvas.cpp: 19 (WebCore::buildObjectForCanvasContextAttributes): Added. 20 (WebCore::InspectorCanvas::buildObjectForCanvas): 21 (WebCore::InspectorCanvas::buildInitialState): 22 Unify the two cases where we fetch canvas attributes into a single method so that both get 23 the same data. This means that the canvas recorder now also uses `Canvas.ContextAttributes`. 24 25 LayoutTests: 26 27 * inspector/canvas/context-attributes-expected.txt: 28 * inspector/canvas/recording-2d-frameCount-expected.txt: 29 * inspector/canvas/recording-2d-full-expected.txt: 30 * inspector/canvas/recording-2d-memoryLimit-expected.txt: 31 * inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt: 32 * inspector/canvas/recording-bitmaprenderer-full-expected.txt: 33 * inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt: 34 * inspector/canvas/recording-html-2d-expected.txt: 35 * inspector/canvas/recording-webgl-frameCount-expected.txt: 36 * inspector/canvas/recording-webgl-full-expected.txt: 37 * inspector/canvas/recording-webgl-memoryLimit-expected.txt: 38 * inspector/canvas/recording-webgl-snapshots-expected.txt: 39 * inspector/canvas/recording-webgl2-frameCount-expected.txt: 40 * inspector/canvas/recording-webgl2-full-expected.txt: 41 * inspector/canvas/recording-webgl2-memoryLimit-expected.txt: 42 * inspector/canvas/recording-webgl2-snapshots-expected.txt: 43 44 45 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282984 268f45cc-cd09-0410-ab3c-d52691b4dbfc 46 47 2021-09-23 Devin Rousso <drousso@apple.com> 48 49 Web Inspector: Graphics: add instrumentation for new `CanvasRenderingContext2DSettings` 50 https://bugs.webkit.org/show_bug.cgi?id=225180 51 <rdar://problem/77587429> 52 53 Reviewed by BJ Burg. 54 55 * inspector/protocol/Canvas.json: 56 Add `colorSpace` and `desynchronized` to `Canvas.ContextAttributes`. 57 1 58 2021-10-18 Russell Epstein <repstein@apple.com> 2 59 -
branches/safari-612-branch/Source/JavaScriptCore/inspector/protocol/Canvas.json
r284284 r284801 40 40 "properties": [ 41 41 { "name": "alpha", "type": "boolean", "optional": true, "description": "WebGL, WebGL2, ImageBitmapRenderingContext" }, 42 { "name": "colorSpace", "type": "string", "optional": true, "description": "2D" }, 43 { "name": "desynchronized", "type": "boolean", "optional": true, "description": "2D" }, 42 44 { "name": "depth", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" }, 43 45 { "name": "stencil", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" }, -
branches/safari-612-branch/Source/WebCore/ChangeLog
r284707 r284801 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r282984. rdar://problem/77587429 4 5 Web Inspector: Graphics: add instrumentation for new `CanvasRenderingContext2DSettings` 6 https://bugs.webkit.org/show_bug.cgi?id=225180 7 <rdar://problem/77587429> 8 9 Reviewed by BJ Burg. 10 11 Source/JavaScriptCore: 12 13 * inspector/protocol/Canvas.json: 14 Add `colorSpace` and `desynchronized` to `Canvas.ContextAttributes`. 15 16 Source/WebCore: 17 18 * inspector/InspectorCanvas.cpp: 19 (WebCore::buildObjectForCanvasContextAttributes): Added. 20 (WebCore::InspectorCanvas::buildObjectForCanvas): 21 (WebCore::InspectorCanvas::buildInitialState): 22 Unify the two cases where we fetch canvas attributes into a single method so that both get 23 the same data. This means that the canvas recorder now also uses `Canvas.ContextAttributes`. 24 25 LayoutTests: 26 27 * inspector/canvas/context-attributes-expected.txt: 28 * inspector/canvas/recording-2d-frameCount-expected.txt: 29 * inspector/canvas/recording-2d-full-expected.txt: 30 * inspector/canvas/recording-2d-memoryLimit-expected.txt: 31 * inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt: 32 * inspector/canvas/recording-bitmaprenderer-full-expected.txt: 33 * inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt: 34 * inspector/canvas/recording-html-2d-expected.txt: 35 * inspector/canvas/recording-webgl-frameCount-expected.txt: 36 * inspector/canvas/recording-webgl-full-expected.txt: 37 * inspector/canvas/recording-webgl-memoryLimit-expected.txt: 38 * inspector/canvas/recording-webgl-snapshots-expected.txt: 39 * inspector/canvas/recording-webgl2-frameCount-expected.txt: 40 * inspector/canvas/recording-webgl2-full-expected.txt: 41 * inspector/canvas/recording-webgl2-memoryLimit-expected.txt: 42 * inspector/canvas/recording-webgl2-snapshots-expected.txt: 43 44 45 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282984 268f45cc-cd09-0410-ab3c-d52691b4dbfc 46 47 2021-09-23 Devin Rousso <drousso@apple.com> 48 49 Web Inspector: Graphics: add instrumentation for new `CanvasRenderingContext2DSettings` 50 https://bugs.webkit.org/show_bug.cgi?id=225180 51 <rdar://problem/77587429> 52 53 Reviewed by BJ Burg. 54 55 * inspector/InspectorCanvas.cpp: 56 (WebCore::buildObjectForCanvasContextAttributes): Added. 57 (WebCore::InspectorCanvas::buildObjectForCanvas): 58 (WebCore::InspectorCanvas::buildInitialState): 59 Unify the two cases where we fetch canvas attributes into a single method so that both get 60 the same data. This means that the canvas recorder now also uses `Canvas.ContextAttributes`. 61 1 62 2021-10-22 Alan Coon <alancoon@apple.com> 2 63 -
branches/safari-612-branch/Source/WebCore/inspector/InspectorCanvas.cpp
r284284 r284801 814 814 } 815 815 816 static RefPtr<Inspector::Protocol::Canvas::ContextAttributes> buildObjectForCanvasContextAttributes(CanvasRenderingContext& context) 817 { 818 if (is<CanvasRenderingContext2D>(context)) { 819 auto attributes = downcast<CanvasRenderingContext2D>(context).getContextAttributes(); 820 auto contextAttributesPayload = Inspector::Protocol::Canvas::ContextAttributes::create() 821 .release(); 822 switch (attributes.colorSpace) { 823 case PredefinedColorSpace::SRGB: 824 contextAttributesPayload->setColorSpace("srgb"_s); 825 break; 826 827 #if ENABLE(PREDEFINED_COLOR_SPACE_DISPLAY_P3) 828 case PredefinedColorSpace::DisplayP3: 829 contextAttributesPayload->setColorSpace("display-p3"_s); 830 break; 831 #endif 832 } 833 contextAttributesPayload->setDesynchronized(attributes.desynchronized); 834 return contextAttributesPayload; 835 } 836 837 if (is<ImageBitmapRenderingContext>(context)) { 838 auto contextAttributesPayload = Inspector::Protocol::Canvas::ContextAttributes::create() 839 .release(); 840 contextAttributesPayload->setAlpha(downcast<ImageBitmapRenderingContext>(context).hasAlpha()); 841 return contextAttributesPayload; 842 } 843 844 #if ENABLE(WEBGL) 845 if (is<WebGLRenderingContextBase>(context)) { 846 const auto& attributes = downcast<WebGLRenderingContextBase>(context).getContextAttributes(); 847 if (!attributes) 848 return nullptr; 849 850 auto contextAttributesPayload = Inspector::Protocol::Canvas::ContextAttributes::create() 851 .release(); 852 contextAttributesPayload->setAlpha(attributes->alpha); 853 contextAttributesPayload->setDepth(attributes->depth); 854 contextAttributesPayload->setStencil(attributes->stencil); 855 contextAttributesPayload->setAntialias(attributes->antialias); 856 contextAttributesPayload->setPremultipliedAlpha(attributes->premultipliedAlpha); 857 contextAttributesPayload->setPreserveDrawingBuffer(attributes->preserveDrawingBuffer); 858 switch (attributes->powerPreference) { 859 case WebGLPowerPreference::Default: 860 contextAttributesPayload->setPowerPreference("default"_s); 861 break; 862 case WebGLPowerPreference::LowPower: 863 contextAttributesPayload->setPowerPreference("low-power"_s); 864 break; 865 case WebGLPowerPreference::HighPerformance: 866 contextAttributesPayload->setPowerPreference("high-performance"_s); 867 break; 868 } 869 contextAttributesPayload->setFailIfMajorPerformanceCaveat(attributes->failIfMajorPerformanceCaveat); 870 return contextAttributesPayload; 871 } 872 #endif // ENABLE(WEBGL) 873 874 return nullptr; 875 } 876 816 877 Ref<Protocol::Canvas::Canvas> InspectorCanvas::buildObjectForCanvas(bool captureBacktrace) 817 878 { … … 857 918 } 858 919 859 using ContextAttributesType = RefPtr<Protocol::Canvas::ContextAttributes>;860 920 auto contextAttributes = WTF::switchOn(m_context, 861 [] (std::reference_wrapper<CanvasRenderingContext> contextWrapper) -> ContextAttributesType { 862 auto& context = contextWrapper.get(); 863 if (is<ImageBitmapRenderingContext>(context)) { 864 auto contextAttributesPayload = Protocol::Canvas::ContextAttributes::create() 865 .release(); 866 contextAttributesPayload->setAlpha(downcast<ImageBitmapRenderingContext>(context).hasAlpha()); 867 return contextAttributesPayload; 868 } 869 870 #if ENABLE(WEBGL) 871 if (is<WebGLRenderingContextBase>(context)) { 872 if (const auto& attributes = downcast<WebGLRenderingContextBase>(context).getContextAttributes()) { 873 auto contextAttributesPayload = Protocol::Canvas::ContextAttributes::create() 874 .release(); 875 contextAttributesPayload->setAlpha(attributes->alpha); 876 contextAttributesPayload->setDepth(attributes->depth); 877 contextAttributesPayload->setStencil(attributes->stencil); 878 contextAttributesPayload->setAntialias(attributes->antialias); 879 contextAttributesPayload->setPremultipliedAlpha(attributes->premultipliedAlpha); 880 contextAttributesPayload->setPreserveDrawingBuffer(attributes->preserveDrawingBuffer); 881 switch (attributes->powerPreference) { 882 case WebGLPowerPreference::Default: 883 contextAttributesPayload->setPowerPreference("default"); 884 break; 885 case WebGLPowerPreference::LowPower: 886 contextAttributesPayload->setPowerPreference("low-power"); 887 break; 888 case WebGLPowerPreference::HighPerformance: 889 contextAttributesPayload->setPowerPreference("high-performance"); 890 break; 891 } 892 contextAttributesPayload->setFailIfMajorPerformanceCaveat(attributes->failIfMajorPerformanceCaveat); 893 return contextAttributesPayload; 894 } 895 } 896 #endif 897 return nullptr; 921 [] (std::reference_wrapper<CanvasRenderingContext> contextWrapper) { 922 return buildObjectForCanvasContextAttributes(contextWrapper); 898 923 }, 899 924 [] (Monostate) { … … 1230 1255 } 1231 1256 } 1232 #if ENABLE(WEBGL) 1233 else if (is<WebGLRenderingContextBase>(context)) { 1234 auto& contextWebGLBase = downcast<WebGLRenderingContextBase>(*context); 1235 if (std::optional<WebGLContextAttributes> webGLContextAttributes = contextWebGLBase.getContextAttributes()) { 1236 auto webGLContextAttributesPayload = JSON::Object::create(); 1237 webGLContextAttributesPayload->setBoolean("alpha"_s, webGLContextAttributes->alpha); 1238 webGLContextAttributesPayload->setBoolean("depth"_s, webGLContextAttributes->depth); 1239 webGLContextAttributesPayload->setBoolean("stencil"_s, webGLContextAttributes->stencil); 1240 webGLContextAttributesPayload->setBoolean("antialias"_s, webGLContextAttributes->antialias); 1241 webGLContextAttributesPayload->setBoolean("premultipliedAlpha"_s, webGLContextAttributes->premultipliedAlpha); 1242 webGLContextAttributesPayload->setBoolean("preserveDrawingBuffer"_s, webGLContextAttributes->preserveDrawingBuffer); 1243 webGLContextAttributesPayload->setBoolean("failIfMajorPerformanceCaveat"_s, webGLContextAttributes->failIfMajorPerformanceCaveat); 1244 parametersPayload->addItem(WTFMove(webGLContextAttributesPayload)); 1245 } 1246 } 1247 #endif 1257 1258 if (auto contextAttributes = buildObjectForCanvasContextAttributes(*context)) 1259 parametersPayload->addItem(contextAttributes.releaseNonNull()); 1248 1260 1249 1261 initialStatePayload->setAttributes(WTFMove(attributesPayload));
Note:
See TracChangeset
for help on using the changeset viewer.