forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCanvas.json
More file actions
268 lines (268 loc) · 11.9 KB
/
Canvas.json
File metadata and controls
268 lines (268 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
{
"domain": "Canvas",
"description": "Canvas domain allows tracking of canvases that have an associated graphics context. Tracks canvases in the DOM and CSS canvases created with -webkit-canvas.",
"debuggableTypes": ["page", "web-page"],
"targetTypes": ["page"],
"types": [
{
"id": "CanvasId",
"type": "string",
"description": "Unique canvas identifier."
},
{
"id": "ProgramId",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"type": "string",
"description": "Unique shader program identifier."
},
{
"id": "ColorSpace",
"type": "string",
"enum": ["srgb", "display-p3"]
},
{
"id": "ContextType",
"type": "string",
"enum": ["canvas-2d", "bitmaprenderer", "webgl", "webgl2"],
"description": "The type of rendering context backing the canvas element."
},
{
"id": "ProgramType",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"type": "string",
"enum": ["compute", "render"]
},
{
"id": "ShaderType",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"type": "string",
"enum": ["compute", "fragment", "vertex"]
},
{
"id": "ContextAttributes",
"type": "object",
"description": "Drawing surface attributes.",
"properties": [
{ "name": "alpha", "type": "boolean", "optional": true, "description": "WebGL, WebGL2, ImageBitmapRenderingContext" },
{ "name": "colorSpace", "$ref": "ColorSpace", "optional": true, "description": "2D" },
{ "name": "desynchronized", "type": "boolean", "optional": true, "description": "2D" },
{ "name": "depth", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
{ "name": "stencil", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
{ "name": "antialias", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
{ "name": "premultipliedAlpha", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
{ "name": "preserveDrawingBuffer", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
{ "name": "failIfMajorPerformanceCaveat", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
{ "name": "powerPreference", "type": "string", "optional": true, "description": "WebGL, WebGL2" }
]
},
{
"id": "Canvas",
"type": "object",
"description": "Information about a canvas for which a rendering context has been created.",
"properties": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." },
{ "name": "contextType", "$ref": "ContextType", "description": "The type of rendering context backing the canvas." },
{ "name": "nodeId", "$ref": "DOM.NodeId", "optional": true, "description": "The corresponding DOM node id." },
{ "name": "cssCanvasName", "type": "string", "optional": true, "description": "The CSS canvas identifier, for canvases created with <code>document.getCSSCanvasContext</code>." },
{ "name": "contextAttributes", "$ref": "ContextAttributes", "optional": true, "description": "Context attributes for rendering contexts." },
{ "name": "memoryCost", "type": "number", "optional": true, "description": "Memory usage of the canvas in bytes." },
{ "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "Backtrace that was captured when this canvas context was created." }
]
},
{
"id": "ShaderProgram",
"description": "Information about a WebGL/WebGL2 shader program.",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"type": "object",
"properties": [
{ "name": "programId", "$ref": "ProgramId" },
{ "name": "programType", "$ref": "ProgramType" },
{ "name": "canvasId", "$ref": "CanvasId"}
]
}
],
"commands": [
{
"name": "enable",
"description": "Enables Canvas domain events."
},
{
"name": "disable",
"description": "Disables Canvas domain events."
},
{
"name": "requestNode",
"description": "Gets the NodeId for the canvas node with the given CanvasId.",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." }
],
"returns": [
{ "name": "nodeId", "$ref": "DOM.NodeId", "description": "Node identifier for given canvas." }
]
},
{
"name": "requestContent",
"description": "Gets the data for the canvas node with the given CanvasId.",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." }
],
"returns": [
{ "name": "content", "type": "string", "description": "Base64-encoded data of the canvas' contents." }
]
},
{
"name": "requestClientNodes",
"description": "Gets all <code>-webkit-canvas</code> nodes or active <code>HTMLCanvasElement</code> for a <code>WebGPUDevice</code>.",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" }
],
"returns": [
{ "name": "clientNodeIds", "type": "array", "items": { "$ref": "DOM.NodeId" } }
]
},
{
"name": "resolveContext",
"description": "Resolves JavaScript canvas/device context object for given canvasId.",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." },
{ "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
],
"returns": [
{ "name": "object", "$ref": "Runtime.RemoteObject", "description": "JavaScript object wrapper for given canvas context." }
]
},
{
"name": "setRecordingAutoCaptureFrameCount",
"description": "Tells the backend to record `count` frames whenever a new context is created.",
"parameters": [
{ "name": "count", "type": "integer", "description": "Number of frames to record (0 means don't record anything)." }
]
},
{
"name": "startRecording",
"description": "Record the next frame, or up to the given number of bytes of data, for the given canvas.",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" },
{ "name": "frameCount", "type": "integer", "optional": true, "description": "Number of frames to record (unlimited when not specified)." },
{ "name": "memoryLimit", "type": "integer", "optional": true, "description": "Memory limit of recorded data (100MB when not specified)." }
]
},
{
"name": "stopRecording",
"description": "Stop recording the given canvas.",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" }
]
},
{
"name": "requestShaderSource",
"description": "Requests the source of the shader of the given type from the program with the given id.",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"parameters": [
{ "name": "programId", "$ref": "ProgramId" },
{ "name": "shaderType", "$ref": "ShaderType" }
],
"returns": [
{ "name": "source", "type": "string" }
]
},
{
"name": "updateShader",
"description": "Compiles and links the shader with identifier and type with the given source code.",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"parameters": [
{ "name": "programId", "$ref": "ProgramId" },
{ "name": "shaderType", "$ref": "ShaderType" },
{ "name": "source", "type": "string" }
]
},
{
"name": "setShaderProgramDisabled",
"description": "Enable/disable the visibility of the given shader program.",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"parameters": [
{ "name": "programId", "$ref": "ProgramId" },
{ "name": "disabled", "type": "boolean" }
]
},
{
"name": "setShaderProgramHighlighted",
"description": "Enable/disable highlighting of the given shader program.",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"parameters": [
{ "name": "programId", "$ref": "ProgramId" },
{ "name": "highlighted", "type": "boolean" }
]
}
],
"events": [
{
"name": "canvasAdded",
"parameters": [
{ "name": "canvas", "$ref": "Canvas", "description": "Canvas object." }
]
},
{
"name": "canvasRemoved",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Removed canvas identifier." }
]
},
{
"name": "canvasMemoryChanged",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Identifier of canvas that changed." },
{ "name": "memoryCost", "type": "number", "description": "New memory cost value for the canvas in bytes." }
]
},
{
"name": "extensionEnabled",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" },
{ "name": "extension", "type": "string", "description": "Name of the extension that was enabled." }
]
},
{
"name": "clientNodesChanged",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId", "description": "Identifier of canvas that changed." }
]
},
{
"name": "recordingStarted",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" },
{ "name": "initiator", "$ref": "Recording.Initiator" }
]
},
{
"name": "recordingProgress",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" },
{ "name": "frames", "type": "array", "items": { "$ref": "Recording.Frame" }},
{ "name": "bufferUsed", "type": "integer", "description": "Total memory size in bytes of all data recorded since the recording began." }
]
},
{
"name": "recordingFinished",
"parameters": [
{ "name": "canvasId", "$ref": "CanvasId" },
{ "name": "recording", "$ref": "Recording.Recording", "optional": true }
]
},
{
"name": "programCreated",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"parameters": [
{ "name": "shaderProgram", "$ref": "ShaderProgram" }
]
},
{
"name": "programDeleted",
"condition": "defined(ENABLE_WEBGL) && ENABLE_WEBGL",
"parameters": [
{ "name": "programId", "$ref": "ProgramId" }
]
}
]
}