blob: bab30d94558ebfed871301860391ff20f2a3bff9 [file] [log] [blame]
Kevin Lubick217056c2018-09-20 17:39:31 -04001/*
2 * This externs file prevents the Closure JS compiler from minifying away
3 * names of objects created by Emscripten.
4 * Basically, by defining empty objects and functions here, Closure will
5 * know not to rename them. This is needed because of our pre-js files,
6 * that is, the JS we hand-write to bundle into the output. That JS will be
7 * hit by the closure compiler and thus needs to know about what functions
8 * have special names and should not be minified.
9 *
10 * Emscripten does not support automatically generating an externs file, so we
11 * do it by hand. The general process is to write some JS code, and then put any
12 * calls to CanvasKit or related things in here. Running ./compile.sh and then
13 * looking at the minified results or running the Release trybot should
14 * verify nothing was missed. Optionally, looking directly at the minified
15 * pathkit.js can be useful when developing locally.
16 *
17 * Docs:
18 * https://github.com/cljsjs/packages/wiki/Creating-Externs
19 * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
20 *
21 * Example externs:
22 * https://github.com/google/closure-compiler/tree/master/externs
23 */
24
25var CanvasKit = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
27 Color: function() {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -040028 Color4f: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -040029 ColorAsInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050030 /** @return {CanvasKit.SkRect} */
31 LTRBRect: function() {},
32 /** @return {CanvasKit.SkRect} */
33 XYWHRect: function() {},
34 /** @return {CanvasKit.SkRRect} */
35 RRectXY: function() {},
36 /** @return {ImageData} */
37 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050038
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050039 GetWebGLContext: function() {},
40 MakeBlurMaskFilter: function() {},
41 MakeCanvas: function() {},
42 MakeCanvasSurface: function() {},
43 MakeGrContext: function() {},
44 /** @return {CanvasKit.SkAnimatedImage} */
45 MakeAnimatedImageFromEncoded: function() {},
46 /** @return {CanvasKit.SkImage} */
47 MakeImage: function() {},
48 /** @return {CanvasKit.SkImage} */
49 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060050 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050051 MakeOnScreenGLSurface: function() {},
52 MakePathFromCmds: function() {},
53 MakePathFromOp: function() {},
54 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050055 MakeRenderTarget: function() {},
56 MakeSkPicture: function() {},
57 MakeSWCanvasSurface: function() {},
58 MakeManagedAnimation: function() {},
59 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 MakeSkVertices: function() {},
61 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 MakeWebGLCanvasSurface: function() {},
63 /** @return {TypedArray} */
64 Malloc: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040065 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050066 computeTonalColors: function() {},
67 currentContext: function() {},
68 getColorComponents: function() {},
69 getDecodeCacheLimitBytes: function() {},
70 getDecodeCacheUsageBytes: function() {},
71 getSkDataBytes: function() {},
72 multiplyByAlpha: function() {},
73 parseColorString: function() {},
74 setCurrentContext: function() {},
75 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040076
Kevin Lubicke70af512020-05-14 14:50:54 -040077 // Defined by emscripten.
78 createContext:function() {},
79
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 // private API (i.e. things declared in the bindings that we use
81 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040082 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050083 _MakeImage: function() {},
84 _MakeLinearGradientShader: function() {},
85 _MakePathFromCmds: function() {},
86 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070087 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050088 _MakeManagedAnimation: function() {},
89 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050090 _MakeSkPicture: function() {},
91 _MakeSkVertices: function() {},
92 _MakeTwoPointConicalGradientShader: function() {},
93 _decodeAnimatedImage: function() {},
94 _decodeImage: function() {},
95 _drawShapedText: function() {},
96 _getRasterDirectSurface: function() {},
97 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040098
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050099 // The testing object is meant to expose internal functions
100 // for more fine-grained testing, e.g. parseColor
101 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500102
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500103 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400104
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500105 GrContext: {
106 // public API (from C++ bindings)
107 getResourceCacheLimitBytes: function() {},
108 getResourceCacheUsageBytes: function() {},
109 releaseResourcesAndAbandonContext: function() {},
110 setResourceCacheLimitBytes: function() {},
111 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400112
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400113 ManagedAnimation: {
114 prototype: {
115 setColor: function() {},
116 },
117 },
118
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500119 Paragraph: {
120 // public API (from C++ bindings)
121 didExceedMaxLines: function() {},
122 getAlphabeticBaseline: function() {},
123 getGlyphPositionAtCoordinate: function() {},
124 getHeight: function() {},
125 getIdeographicBaseline: function() {},
126 getLongestLine: function() {},
127 getMaxIntrinsicWidth: function() {},
128 getMaxWidth: function() {},
129 getMinIntrinsicWidth: function() {},
130 getWordBoundary: function() {},
131 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400132
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500133 // private API
134 /** @return {Float32Array} */
135 _getRectsForRange: function() {},
136 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400137
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400138 ParagraphBuilder: {
139 Make: function() {},
140 addText: function() {},
141 build: function() {},
142 pop: function() {},
143
144 prototype: {
145 pushStyle: function() {},
146 },
147
148 // private API
149 _Make: function() {},
150 _pushStyle: function() {},
151 },
152
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500153 SkRuntimeEffect: {
154 // public API (from C++ bindings)
155 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500156
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500157 // private API
158 _makeShader: function() {},
159 _makeShaderWithChildren: function() {},
160 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500161
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500162 ParagraphStyle: function() {},
163 RSXFormBuilder: function() {},
164 SkColorBuilder: function() {},
165 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400166
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500167 ShapedText: {
168 // public API (from C++ bindings)
169 getBounds: function() {},
170 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500171
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500172 SkAnimatedImage: {
173 // public API (from C++ bindings)
174 decodeNextFrame: function() {},
175 getFrameCount: function() {},
176 getRepetitionCount: function() {},
177 height: function() {},
178 reset: function() {},
179 width: function() {},
180 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400181
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500182 SkCanvas: {
183 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 clipPath: function() {},
185 clipRRect: function() {},
186 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 drawAnimatedImage: function() {},
188 drawArc: function() {},
189 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400190 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500191 drawDRRect: function() {},
192 drawImage: function() {},
193 drawImageNine: function() {},
194 drawImageRect: function() {},
195 drawLine: function() {},
196 drawOval: function() {},
197 drawPaint: function() {},
198 drawParagraph: function() {},
199 drawPath: function() {},
200 drawPicture: function() {},
201 drawRRect: function() {},
202 drawRect: function() {},
203 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 drawText: function() {},
205 drawTextBlob: function() {},
206 drawVertices: function() {},
207 flush: function() {},
208 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500209 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400210 markCTM: function() {},
211 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500212 restore: function() {},
213 restoreToCount: function() {},
214 rotate: function() {},
215 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000216 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 scale: function() {},
218 skew: function() {},
219 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400220
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400221 prototype: {
222 clear: function() {},
223 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400224 drawColorComponents: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400225 drawShadow: function() {},
226 },
227
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500228 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400229 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400230 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500231 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400232 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500233 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400234 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500235 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400236 _getLocalToCamera: function() {},
237 _getLocalToDevice: function() {},
238 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400239 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400240 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500241 _readPixels: function() {},
242 _writePixels: function() {},
243 delete: function() {},
244 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400245
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500246 SkColorFilter: {
247 // public API (from C++ bindings and JS interface)
248 MakeBlend: function() {},
249 MakeCompose: function() {},
250 MakeLerp: function() {},
251 MakeLinearToSRGBGamma: function() {},
252 MakeMatrix: function() {},
253 MakeSRGBToLinearGamma: function() {},
254 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400255 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500256 _makeMatrix: function() {},
257 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400258
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500259 SkColorMatrix: {
260 concat: function() {},
261 identity: function() {},
262 postTranslate: function() {},
263 rotated: function() {},
264 scaled: function() {},
265 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400266
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400267 SkColorSpace: {
268 Equals: function() {},
269 SRGB: {},
270 DISPLAY_P3: {},
271 ADOBE_RGB: {},
272 // private API (from C++ bindings)
273 _MakeSRGB: function() {},
274 _MakeDisplayP3: function() {},
275 _MakeAdobeRGB: function() {},
276 },
277
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500278 SkContourMeasureIter: {
279 next: function() {},
280 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500281
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500282 SkContourMeasure: {
283 getPosTan: function() {},
284 getSegment: function() {},
285 isClosed: function() {},
286 length: function() {},
287 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500288
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500289 SkFont: {
290 // public API (from C++ bindings)
291 getScaleX: function() {},
292 getSize: function() {},
293 getSkewX: function() {},
294 getTypeface: function() {},
295 measureText: function() {},
296 setHinting: function() {},
297 setLinearMetrics: function() {},
298 setScaleX: function() {},
299 setSize: function() {},
300 setSkewX: function() {},
301 setSubpixel: function() {},
302 setTypeface: function() {},
303 // private API (from C++ bindings)
304 _getWidths: function() {},
305 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500306
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500307 SkFontMgr: {
308 // public API (from C++ and JS bindings)
309 FromData: function() {},
310 RefDefault: function() {},
311 countFamilies: function() {},
312 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500313
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500314 // private API
315 _makeTypefaceFromData: function() {},
316 _fromData: function() {},
317 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500318
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500319 SkImage: {
320 // public API (from C++ bindings)
321 height: function() {},
322 width: function() {},
323 // private API
324 _encodeToData: function() {},
325 _encodeToDataWithFormat: function() {},
326 _makeShader: function() {},
327 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400328
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500329 SkImageFilter: {
330 MakeBlur: function() {},
331 MakeColorFilter: function() {},
332 MakeCompose: function() {},
333 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400334
335 // private API
336 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500337 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400338
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500339 // These are defined in interface.js
340 SkM44: {
341 identity: function() {},
342 invert: function() {},
343 multiply: function() {},
344 rotatedUnitSinCos: function() {},
345 rotated: function() {},
346 scaled: function() {},
347 translated: function() {},
348 lookat: function() {},
349 perspective: function() {},
350 rc: function() {},
351 transpose: function() {},
352 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500353
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500354 SkMatrix: {
355 identity: function() {},
356 invert: function() {},
357 mapPoints: function() {},
358 multiply: function() {},
359 rotated: function() {},
360 scaled: function() {},
361 skewed: function() {},
362 translated: function() {},
363 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500364
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500365 SkMaskFilter: {
366 MakeBlur: function() {},
367 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400368
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500369 SkPaint: {
370 // public API (from C++ bindings)
371 /** @return {CanvasKit.SkPaint} */
372 copy: function() {},
373 getBlendMode: function() {},
374 getColor: function() {},
375 getFilterQuality: function() {},
376 getStrokeCap: function() {},
377 getStrokeJoin: function() {},
378 getStrokeMiter: function() {},
379 getStrokeWidth: function() {},
380 setAntiAlias: function() {},
381 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400382 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500383 setFilterQuality: function() {},
384 setImageFilter: function() {},
385 setMaskFilter: function() {},
386 setPathEffect: function() {},
387 setShader: function() {},
388 setStrokeCap: function() {},
389 setStrokeJoin: function() {},
390 setStrokeMiter: function() {},
391 setStrokeWidth: function() {},
392 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500393
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400394 prototype: {
395 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400396 setColorComponents: function() {},
397 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400398 },
399
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500400 // Private API
401 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400402 _getColor: function() {},
403 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500404 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500405
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500406 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400407 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500408 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400409 MakeDiscrete: function() {},
410
411 // Private C++ API
412 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500413 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500414
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500415 SkParticleEffect: {
416 // public API (from C++ bindings)
417 draw: function() {},
418 getEffectUniform: function() {},
419 getEffectUniformCount: function() {},
420 getEffectUniformFloatCount: function() {},
421 getEffectUniformName: function() {},
422 getParticleUniformCount: function() {},
423 getParticleUniformFloatCount: function() {},
424 getParticleUniformName: function() {},
425 getParticleUniform: function() {},
426 setPosition: function() {},
427 setRate: function() {},
428 start: function() {},
429 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500430
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500431 // private API (from C++ bindings)
432 _effectUniformPtr: function() {},
433 _particleUniformPtr: function() {},
434 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500435
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500436 SkPath: {
437 // public API (from C++ bindings)
438 computeTightBounds: function() {},
439 contains: function() {},
440 /** @return {CanvasKit.SkPath} */
441 copy: function() {},
442 countPoints: function() {},
443 equals: function() {},
444 getBounds: function() {},
445 getFillType: function() {},
446 getPoint: function() {},
447 isEmpty: function() {},
448 isVolatile: function() {},
449 reset: function() {},
450 rewind: function() {},
451 setFillType: function() {},
452 setIsVolatile: function() {},
453 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400454
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500455 // private API
456 _addArc: function() {},
457 _addOval: function() {},
458 _addPath: function() {},
459 _addRect: function() {},
460 _addPoly: function() {},
461 _addRoundRect: function() {},
462 _arc: function() {},
463 _arcTo: function() {},
464 _close: function() {},
465 _conicTo: function() {},
466 _cubicTo: function() {},
467 _dash: function() {},
468 _lineTo: function() {},
469 _moveTo: function() {},
470 _op: function() {},
471 _quadTo: function() {},
472 _rArcTo: function() {},
473 _rConicTo: function() {},
474 _rCubicTo: function() {},
475 _rLineTo: function() {},
476 _rMoveTo: function() {},
477 _rQuadTo: function() {},
478 _rect: function() {},
479 _simplify: function() {},
480 _stroke: function() {},
481 _transform: function() {},
482 _trim: function() {},
483 delete: function() {},
484 dump: function() {},
485 dumpHex: function() {},
486 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400487
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500488 SkPathMeasure: {
489 getLength: function() {},
490 getSegment: function() {},
491 getPosTan: function() {},
492 isClosed: function() {},
493 nextContour: function() {},
494 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400495
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500496 SkPicture: {
497 serialize: function() {},
498 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400499
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500500 SkPictureRecorder: {
501 beginRecording: function() {},
502 finishRecordingAsPicture: function() {},
503 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400504
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500505 SkRect: {
506 fLeft: {},
507 fTop: {},
508 fRight: {},
509 fBottom: {},
510 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400511
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 SkRRect: {
513 rect: {},
514 rx1: {},
515 ry1: {},
516 rx2: {},
517 ry2: {},
518 rx3: {},
519 ry3: {},
520 rx4: {},
521 ry4: {},
522 },
Kevin Lubick62836902019-12-09 09:04:26 -0500523
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500524 SkShader: {
525 Blend: function() {},
526 Color: function() {},
527 Empty: function() {},
528 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400529 MakeLinearGradient: function() {},
530 MakeRadialGradient: function() {},
531 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700532 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400533
534 // private API (from C++ bindings)
535 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500536 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400537
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500538 SkSurface: {
539 // public API (from C++ bindings)
540 /** @return {CanvasKit.SkCanvas} */
541 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400542 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500543 /** @return {CanvasKit.SkImage} */
544 makeImageSnapshot: function() {},
545 makeSurface: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400546 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500547 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400548
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500549 // private API
550 _flush: function() {},
551 _getRasterN32PremulSurface: function() {},
552 delete: function() {},
553 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500554
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500555 SkTextBlob: {
556 // public API (both C++ and JS bindings)
557 MakeFromRSXform: function() {},
558 MakeFromText: function() {},
559 MakeOnPath: function() {},
560 // private API (from C++ bindings)
561 _MakeFromRSXform: function() {},
562 _MakeFromText: function() {},
563 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500564
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500565 // These are defined in interface.js
566 SkVector: {
567 add: function() {},
568 sub: function() {},
569 dot: function() {},
570 cross: function() {},
571 normalize: function() {},
572 mulScalar: function() {},
573 length: function() {},
574 lengthSquared: function() {},
575 dist: function() {},
576 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400577
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500578 SkVertices: {
579 // public API (from C++ bindings)
580 bounds: function() {},
581 mode: function() {},
582 uniqueID: function() {},
583 vertexCount: function() {},
584 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400585
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 _SkVerticesBuilder: {
587 colors: function() {},
588 detach: function() {},
589 indices: function() {},
590 positions: function() {},
591 texCoords: function() {},
592 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400593
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500594 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400595
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 // Constants and Enums
597 gpu: {},
598 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400599
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500600 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400601 BLACK: {},
602 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500603 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400604 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500605 BLUE: {},
606 YELLOW: {},
607 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400608 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500609
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500610 MOVE_VERB: {},
611 LINE_VERB: {},
612 QUAD_VERB: {},
613 CONIC_VERB: {},
614 CUBIC_VERB: {},
615 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500616
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 NoDecoration: {},
618 UnderlineDecoration: {},
619 OverlineDecoration: {},
620 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400621
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500622 SaveLayerInitWithPrevious: {},
623 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400624
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500625 Affinity: {
626 Upstream: {},
627 Downstream: {},
628 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400629
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 AlphaType: {
631 Opaque: {},
632 Premul: {},
633 Unpremul: {},
634 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 BlendMode: {
637 Clear: {},
638 Src: {},
639 Dst: {},
640 SrcOver: {},
641 DstOver: {},
642 SrcIn: {},
643 DstIn: {},
644 SrcOut: {},
645 DstOut: {},
646 SrcATop: {},
647 DstATop: {},
648 Xor: {},
649 Plus: {},
650 Modulate: {},
651 Screen: {},
652 Overlay: {},
653 Darken: {},
654 Lighten: {},
655 ColorDodge: {},
656 ColorBurn: {},
657 HardLight: {},
658 SoftLight: {},
659 Difference: {},
660 Exclusion: {},
661 Multiply: {},
662 Hue: {},
663 Saturation: {},
664 Color: {},
665 Luminosity: {},
666 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500667
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500668 BlurStyle: {
669 Normal: {},
670 Solid: {},
671 Outer: {},
672 Inner: {},
673 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500674
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500675 ClipOp: {
676 Difference: {},
677 Intersect: {},
678 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500679
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500680 ColorType: {
681 Alpha_8: {},
682 RGB_565: {},
683 ARGB_4444: {},
684 RGBA_8888: {},
685 RGB_888x: {},
686 BGRA_8888: {},
687 RGBA_1010102: {},
688 RGB_101010x: {},
689 Gray_8: {},
690 RGBA_F16: {},
691 RGBA_F32: {},
692 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500693
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500694 FillType: {
695 Winding: {},
696 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400698
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 FilterQuality: {
700 None: {},
701 Low: {},
702 Medium: {},
703 High: {},
704 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500705
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 FontSlant: {
707 Upright: {},
708 Italic: {},
709 Oblique: {},
710 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400711
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500712 FontHinting: {
713 None: {},
714 Slight: {},
715 Normal: {},
716 Full: {},
717 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500718
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500719 FontWeight: {
720 Invisible: {},
721 Thin: {},
722 ExtraLight: {},
723 Light: {},
724 Normal: {},
725 Medium: {},
726 SemiBold: {},
727 Bold: {},
728 ExtraBold: {},
729 Black: {},
730 ExtraBlack: {},
731 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400732
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 FontWidth: {
734 UltraCondensed: {},
735 ExtraCondensed: {},
736 Condensed: {},
737 SemiCondensed: {},
738 Normal: {},
739 SemiExpanded: {},
740 Expanded: {},
741 ExtraExpanded: {},
742 UltraExpanded: {},
743 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400744
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500745 ImageFormat: {
746 PNG: {},
747 JPEG: {},
748 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300749
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500750 PaintStyle: {
751 Fill: {},
752 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500753 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500754
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500755 PathOp: {
756 Difference: {},
757 Intersect: {},
758 Union: {},
759 XOR: {},
760 ReverseDifference: {},
761 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500762
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500763 PointMode: {
764 Points: {},
765 Lines: {},
766 Polygon: {},
767 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500768
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500769 RectHeightStyle: {
770 Tight: {},
771 Max: {},
772 IncludeLineSpacingMiddle: {},
773 IncludeLineSpacingTop: {},
774 IncludeLineSpacingBottom: {},
775 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400776
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500777 RectWidthStyle: {
778 Tight: {},
779 Max: {},
780 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400781
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500782 StrokeCap: {
783 Butt: {},
784 Round: {},
785 Square: {},
786 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 StrokeJoin: {
789 Miter: {},
790 Round: {},
791 Bevel: {},
792 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500793
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500794 TextAlign: {
795 Left: {},
796 Right: {},
797 Center: {},
798 Justify: {},
799 Start: {},
800 End: {},
801 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400802
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500803 TextDirection: {
804 LTR: {},
805 RTL: {},
806 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400807
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500808 TileMode: {
809 Clamp: {},
810 Repeat: {},
811 Mirror: {},
812 Decal: {},
813 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 VertexMode: {
816 Triangles: {},
817 TrianglesStrip: {},
818 TriangleFan: {},
819 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500820
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500821 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400822
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500823 /**
824 * @type {Float32Array}
825 */
826 HEAPF32: {},
827 /**
828 * @type {Float64Array}
829 */
830 HEAPF64: {},
831 /**
832 * @type {Uint8Array}
833 */
834 HEAPU8: {},
835 /**
836 * @type {Uint16Array}
837 */
838 HEAPU16: {},
839 /**
840 * @type {Uint32Array}
841 */
842 HEAPU32: {},
843 /**
844 * @type {Int8Array}
845 */
846 HEAP8: {},
847 /**
848 * @type {Int16Array}
849 */
850 HEAP16: {},
851 /**
852 * @type {Int32Array}
853 */
854 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400855
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500856 _malloc: function() {},
857 _free: function() {},
858 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400859};
Kevin Lubick217056c2018-09-20 17:39:31 -0400860
Kevin Lubick006a6f32018-10-19 14:34:34 -0400861// Public API things that are newly declared in the JS should go here.
862// It's not enough to declare them above, because closure can still erase them
863// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400864CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
865
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500866CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400867CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400868CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500869CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500870CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500871CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300872CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400873CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400874CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400875CanvasKit.SkPath.prototype.conicTo = function() {};
876CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400877CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400878CanvasKit.SkPath.prototype.lineTo = function() {};
879CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400880CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400881CanvasKit.SkPath.prototype.op = function() {};
882CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400883CanvasKit.SkPath.prototype.rArcTo = function() {};
884CanvasKit.SkPath.prototype.rConicTo = function() {};
885CanvasKit.SkPath.prototype.rCubicTo = function() {};
886CanvasKit.SkPath.prototype.rLineTo = function() {};
887CanvasKit.SkPath.prototype.rMoveTo = function() {};
888CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400889CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400890CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400891CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400892CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400893CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400894
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500895CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400896
Kevin Lubick5b90b842018-10-17 07:57:18 -0400897CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400898CanvasKit.SkSurface.prototype.flush = function() {};
899CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800900CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400901CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400902
Alexander Khovansky3e119332018-11-15 02:01:19 +0300903CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400904CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300905
Kevin Lubick6bffe392020-04-02 15:24:15 -0400906CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400907CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400908CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500909CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500910CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400911CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
912CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
913CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400914CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500915/** @return {Uint8Array} */
916CanvasKit.SkCanvas.prototype.readPixels = function() {};
917CanvasKit.SkCanvas.prototype.writePixels = function() {};
918
Kevin Lubickddd0a332018-12-12 10:35:13 -0500919CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
920
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400921CanvasKit.SkFont.prototype.getWidths = function() {};
922
923CanvasKit.RSXFormBuilder.prototype.build = function() {};
924CanvasKit.RSXFormBuilder.prototype.delete = function() {};
925CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400926CanvasKit.RSXFormBuilder.prototype.set = function() {};
927
928CanvasKit.SkColorBuilder.prototype.build = function() {};
929CanvasKit.SkColorBuilder.prototype.delete = function() {};
930CanvasKit.SkColorBuilder.prototype.push = function() {};
931CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400932
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500933CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500934CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500935
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500936CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
937CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
938
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400939// Define StrokeOpts object
940var StrokeOpts = {};
941StrokeOpts.prototype.width;
942StrokeOpts.prototype.miter_limit;
943StrokeOpts.prototype.cap;
944StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500945StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400946
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500947// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500948var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500949HTMLCanvas.prototype.decodeImage = function() {};
950HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500951HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500952HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500953HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500954HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500955
Elliot Evans28796192020-06-15 12:53:27 -0600956var ImageBitmapRenderingContext = {};
957ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
958
Kevin Lubickb9db3902018-11-26 11:47:54 -0500959var CanvasRenderingContext2D = {};
960CanvasRenderingContext2D.prototype.addHitRegion = function() {};
961CanvasRenderingContext2D.prototype.arc = function() {};
962CanvasRenderingContext2D.prototype.arcTo = function() {};
963CanvasRenderingContext2D.prototype.beginPath = function() {};
964CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
965CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500966CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500967CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500968CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500969CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500970CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500971CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500972CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500973CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500974CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500975CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500976CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500977CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500978CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500979CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500980CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500981CanvasRenderingContext2D.prototype.isPointInPath = function() {};
982CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500983CanvasRenderingContext2D.prototype.lineTo = function() {};
984CanvasRenderingContext2D.prototype.measureText = function() {};
985CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500986CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500987CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
988CanvasRenderingContext2D.prototype.rect = function() {};
989CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
990CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500991CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500992CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500993CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500994CanvasRenderingContext2D.prototype.scale = function() {};
995CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500996CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500997CanvasRenderingContext2D.prototype.setTransform = function() {};
998CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500999CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001000CanvasRenderingContext2D.prototype.strokeText = function() {};
1001CanvasRenderingContext2D.prototype.transform = function() {};
1002CanvasRenderingContext2D.prototype.translate = function() {};
1003
Kevin Lubicka40f8322018-12-17 16:01:36 -05001004var Path2D = {};
1005Path2D.prototype.addPath = function() {};
1006Path2D.prototype.arc = function() {};
1007Path2D.prototype.arcTo = function() {};
1008Path2D.prototype.bezierCurveTo = function() {};
1009Path2D.prototype.closePath = function() {};
1010Path2D.prototype.ellipse = function() {};
1011Path2D.prototype.lineTo = function() {};
1012Path2D.prototype.moveTo = function() {};
1013Path2D.prototype.quadraticCurveTo = function() {};
1014Path2D.prototype.rect = function() {};
1015
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001016var LinearCanvasGradient = {};
1017LinearCanvasGradient.prototype.addColorStop = function() {};
1018var RadialCanvasGradient = {};
1019RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001020var CanvasPattern = {};
1021CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001022
Kevin Lubick52b9f372018-12-04 13:57:36 -05001023var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001024 /**
1025 * @type {Uint8ClampedArray}
1026 */
1027 data: {},
1028 height: {},
1029 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001030};
1031
Kevin Lubickd29edd72018-12-07 08:29:52 -05001032var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001033 a: {},
1034 b: {},
1035 c: {},
1036 d: {},
1037 e: {},
1038 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001039};
1040
Kevin Lubick217056c2018-09-20 17:39:31 -04001041// Not sure why this is needed - might be a bug in emsdk that this isn't properly declared.
Kevin Lubick6fccc9d2018-11-20 15:55:10 -05001042function loadWebAssemblyModule() {};