blob: c1dc872349d9f17f3948f5ee0c07027e98244aa9 [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() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600546 sampleCnt: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400547 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400549
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500550 // private API
551 _flush: function() {},
552 _getRasterN32PremulSurface: function() {},
553 delete: function() {},
554 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500555
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500556 SkTextBlob: {
557 // public API (both C++ and JS bindings)
558 MakeFromRSXform: function() {},
559 MakeFromText: function() {},
560 MakeOnPath: function() {},
561 // private API (from C++ bindings)
562 _MakeFromRSXform: function() {},
563 _MakeFromText: function() {},
564 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500565
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500566 // These are defined in interface.js
567 SkVector: {
568 add: function() {},
569 sub: function() {},
570 dot: function() {},
571 cross: function() {},
572 normalize: function() {},
573 mulScalar: function() {},
574 length: function() {},
575 lengthSquared: function() {},
576 dist: function() {},
577 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400578
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500579 SkVertices: {
580 // public API (from C++ bindings)
581 bounds: function() {},
582 mode: function() {},
583 uniqueID: function() {},
584 vertexCount: function() {},
585 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400586
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 _SkVerticesBuilder: {
588 colors: function() {},
589 detach: function() {},
590 indices: function() {},
591 positions: function() {},
592 texCoords: function() {},
593 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400594
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400596
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500597 // Constants and Enums
598 gpu: {},
599 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400600
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500601 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400602 BLACK: {},
603 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400605 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500606 BLUE: {},
607 YELLOW: {},
608 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400609 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500610
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 MOVE_VERB: {},
612 LINE_VERB: {},
613 QUAD_VERB: {},
614 CONIC_VERB: {},
615 CUBIC_VERB: {},
616 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500617
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 NoDecoration: {},
619 UnderlineDecoration: {},
620 OverlineDecoration: {},
621 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400622
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500623 SaveLayerInitWithPrevious: {},
624 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400625
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500626 Affinity: {
627 Upstream: {},
628 Downstream: {},
629 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400630
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 AlphaType: {
632 Opaque: {},
633 Premul: {},
634 Unpremul: {},
635 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500636
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500637 BlendMode: {
638 Clear: {},
639 Src: {},
640 Dst: {},
641 SrcOver: {},
642 DstOver: {},
643 SrcIn: {},
644 DstIn: {},
645 SrcOut: {},
646 DstOut: {},
647 SrcATop: {},
648 DstATop: {},
649 Xor: {},
650 Plus: {},
651 Modulate: {},
652 Screen: {},
653 Overlay: {},
654 Darken: {},
655 Lighten: {},
656 ColorDodge: {},
657 ColorBurn: {},
658 HardLight: {},
659 SoftLight: {},
660 Difference: {},
661 Exclusion: {},
662 Multiply: {},
663 Hue: {},
664 Saturation: {},
665 Color: {},
666 Luminosity: {},
667 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500668
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 BlurStyle: {
670 Normal: {},
671 Solid: {},
672 Outer: {},
673 Inner: {},
674 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500675
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 ClipOp: {
677 Difference: {},
678 Intersect: {},
679 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500680
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 ColorType: {
682 Alpha_8: {},
683 RGB_565: {},
684 ARGB_4444: {},
685 RGBA_8888: {},
686 RGB_888x: {},
687 BGRA_8888: {},
688 RGBA_1010102: {},
689 RGB_101010x: {},
690 Gray_8: {},
691 RGBA_F16: {},
692 RGBA_F32: {},
693 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500694
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500695 FillType: {
696 Winding: {},
697 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500698 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 FilterQuality: {
701 None: {},
702 Low: {},
703 Medium: {},
704 High: {},
705 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500706
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500707 FontSlant: {
708 Upright: {},
709 Italic: {},
710 Oblique: {},
711 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 FontHinting: {
714 None: {},
715 Slight: {},
716 Normal: {},
717 Full: {},
718 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500719
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500720 FontWeight: {
721 Invisible: {},
722 Thin: {},
723 ExtraLight: {},
724 Light: {},
725 Normal: {},
726 Medium: {},
727 SemiBold: {},
728 Bold: {},
729 ExtraBold: {},
730 Black: {},
731 ExtraBlack: {},
732 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400733
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500734 FontWidth: {
735 UltraCondensed: {},
736 ExtraCondensed: {},
737 Condensed: {},
738 SemiCondensed: {},
739 Normal: {},
740 SemiExpanded: {},
741 Expanded: {},
742 ExtraExpanded: {},
743 UltraExpanded: {},
744 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400745
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500746 ImageFormat: {
747 PNG: {},
748 JPEG: {},
749 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300750
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500751 PaintStyle: {
752 Fill: {},
753 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500754 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500755
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500756 PathOp: {
757 Difference: {},
758 Intersect: {},
759 Union: {},
760 XOR: {},
761 ReverseDifference: {},
762 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500763
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500764 PointMode: {
765 Points: {},
766 Lines: {},
767 Polygon: {},
768 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500769
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500770 RectHeightStyle: {
771 Tight: {},
772 Max: {},
773 IncludeLineSpacingMiddle: {},
774 IncludeLineSpacingTop: {},
775 IncludeLineSpacingBottom: {},
776 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400777
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500778 RectWidthStyle: {
779 Tight: {},
780 Max: {},
781 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 StrokeCap: {
784 Butt: {},
785 Round: {},
786 Square: {},
787 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500788
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500789 StrokeJoin: {
790 Miter: {},
791 Round: {},
792 Bevel: {},
793 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 TextAlign: {
796 Left: {},
797 Right: {},
798 Center: {},
799 Justify: {},
800 Start: {},
801 End: {},
802 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400803
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500804 TextDirection: {
805 LTR: {},
806 RTL: {},
807 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400808
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500809 TileMode: {
810 Clamp: {},
811 Repeat: {},
812 Mirror: {},
813 Decal: {},
814 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 VertexMode: {
817 Triangles: {},
818 TrianglesStrip: {},
819 TriangleFan: {},
820 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500821
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500822 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400823
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500824 /**
825 * @type {Float32Array}
826 */
827 HEAPF32: {},
828 /**
829 * @type {Float64Array}
830 */
831 HEAPF64: {},
832 /**
833 * @type {Uint8Array}
834 */
835 HEAPU8: {},
836 /**
837 * @type {Uint16Array}
838 */
839 HEAPU16: {},
840 /**
841 * @type {Uint32Array}
842 */
843 HEAPU32: {},
844 /**
845 * @type {Int8Array}
846 */
847 HEAP8: {},
848 /**
849 * @type {Int16Array}
850 */
851 HEAP16: {},
852 /**
853 * @type {Int32Array}
854 */
855 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400856
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500857 _malloc: function() {},
858 _free: function() {},
859 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400860};
Kevin Lubick217056c2018-09-20 17:39:31 -0400861
Kevin Lubick006a6f32018-10-19 14:34:34 -0400862// Public API things that are newly declared in the JS should go here.
863// It's not enough to declare them above, because closure can still erase them
864// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400865CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
866
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500867CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400868CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400869CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500870CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500871CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500872CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300873CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400874CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400875CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400876CanvasKit.SkPath.prototype.conicTo = function() {};
877CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400878CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400879CanvasKit.SkPath.prototype.lineTo = function() {};
880CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400881CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400882CanvasKit.SkPath.prototype.op = function() {};
883CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400884CanvasKit.SkPath.prototype.rArcTo = function() {};
885CanvasKit.SkPath.prototype.rConicTo = function() {};
886CanvasKit.SkPath.prototype.rCubicTo = function() {};
887CanvasKit.SkPath.prototype.rLineTo = function() {};
888CanvasKit.SkPath.prototype.rMoveTo = function() {};
889CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400890CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400891CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400892CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400893CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400894CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400895
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500896CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400897
Kevin Lubick5b90b842018-10-17 07:57:18 -0400898CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400899CanvasKit.SkSurface.prototype.flush = function() {};
900CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800901CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400902CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400903
Alexander Khovansky3e119332018-11-15 02:01:19 +0300904CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400905CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300906
Kevin Lubick6bffe392020-04-02 15:24:15 -0400907CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400908CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400909CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500910CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500911CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400912CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
913CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
914CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400915CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500916/** @return {Uint8Array} */
917CanvasKit.SkCanvas.prototype.readPixels = function() {};
918CanvasKit.SkCanvas.prototype.writePixels = function() {};
919
Kevin Lubickddd0a332018-12-12 10:35:13 -0500920CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
921
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400922CanvasKit.SkFont.prototype.getWidths = function() {};
923
924CanvasKit.RSXFormBuilder.prototype.build = function() {};
925CanvasKit.RSXFormBuilder.prototype.delete = function() {};
926CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400927CanvasKit.RSXFormBuilder.prototype.set = function() {};
928
929CanvasKit.SkColorBuilder.prototype.build = function() {};
930CanvasKit.SkColorBuilder.prototype.delete = function() {};
931CanvasKit.SkColorBuilder.prototype.push = function() {};
932CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400933
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500934CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500935CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500936
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500937CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
938CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
939
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400940// Define StrokeOpts object
941var StrokeOpts = {};
942StrokeOpts.prototype.width;
943StrokeOpts.prototype.miter_limit;
944StrokeOpts.prototype.cap;
945StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500946StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400947
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500948// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500949var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500950HTMLCanvas.prototype.decodeImage = function() {};
951HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500952HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500953HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500954HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500955HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500956
Elliot Evans28796192020-06-15 12:53:27 -0600957var ImageBitmapRenderingContext = {};
958ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
959
Kevin Lubickb9db3902018-11-26 11:47:54 -0500960var CanvasRenderingContext2D = {};
961CanvasRenderingContext2D.prototype.addHitRegion = function() {};
962CanvasRenderingContext2D.prototype.arc = function() {};
963CanvasRenderingContext2D.prototype.arcTo = function() {};
964CanvasRenderingContext2D.prototype.beginPath = function() {};
965CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
966CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500967CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500968CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500969CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500970CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500971CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500972CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500973CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500974CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500975CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500976CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500977CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500978CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500979CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500980CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500981CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500982CanvasRenderingContext2D.prototype.isPointInPath = function() {};
983CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500984CanvasRenderingContext2D.prototype.lineTo = function() {};
985CanvasRenderingContext2D.prototype.measureText = function() {};
986CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500987CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500988CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
989CanvasRenderingContext2D.prototype.rect = function() {};
990CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
991CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500992CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500993CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500994CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500995CanvasRenderingContext2D.prototype.scale = function() {};
996CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500997CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500998CanvasRenderingContext2D.prototype.setTransform = function() {};
999CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001000CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001001CanvasRenderingContext2D.prototype.strokeText = function() {};
1002CanvasRenderingContext2D.prototype.transform = function() {};
1003CanvasRenderingContext2D.prototype.translate = function() {};
1004
Kevin Lubicka40f8322018-12-17 16:01:36 -05001005var Path2D = {};
1006Path2D.prototype.addPath = function() {};
1007Path2D.prototype.arc = function() {};
1008Path2D.prototype.arcTo = function() {};
1009Path2D.prototype.bezierCurveTo = function() {};
1010Path2D.prototype.closePath = function() {};
1011Path2D.prototype.ellipse = function() {};
1012Path2D.prototype.lineTo = function() {};
1013Path2D.prototype.moveTo = function() {};
1014Path2D.prototype.quadraticCurveTo = function() {};
1015Path2D.prototype.rect = function() {};
1016
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001017var LinearCanvasGradient = {};
1018LinearCanvasGradient.prototype.addColorStop = function() {};
1019var RadialCanvasGradient = {};
1020RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001021var CanvasPattern = {};
1022CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001023
Kevin Lubick52b9f372018-12-04 13:57:36 -05001024var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001025 /**
1026 * @type {Uint8ClampedArray}
1027 */
1028 data: {},
1029 height: {},
1030 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001031};
1032
Kevin Lubickd29edd72018-12-07 08:29:52 -05001033var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001034 a: {},
1035 b: {},
1036 c: {},
1037 d: {},
1038 e: {},
1039 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001040};
1041
Kevin Lubick217056c2018-09-20 17:39:31 -04001042// 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 -05001043function loadWebAssemblyModule() {};