blob: ed2a4a66cb6583d7f533288edf86e20482f096b0 [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050029 /** @return {CanvasKit.SkRect} */
30 LTRBRect: function() {},
31 /** @return {CanvasKit.SkRect} */
32 XYWHRect: function() {},
33 /** @return {CanvasKit.SkRRect} */
34 RRectXY: function() {},
35 /** @return {ImageData} */
36 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050037
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050038 GetWebGLContext: function() {},
39 MakeBlurMaskFilter: function() {},
40 MakeCanvas: function() {},
41 MakeCanvasSurface: function() {},
42 MakeGrContext: function() {},
43 /** @return {CanvasKit.SkAnimatedImage} */
44 MakeAnimatedImageFromEncoded: function() {},
45 /** @return {CanvasKit.SkImage} */
46 MakeImage: function() {},
47 /** @return {CanvasKit.SkImage} */
48 MakeImageFromEncoded: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050049 MakeOnScreenGLSurface: function() {},
50 MakePathFromCmds: function() {},
51 MakePathFromOp: function() {},
52 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050053 MakeRenderTarget: function() {},
54 MakeSkPicture: function() {},
55 MakeSWCanvasSurface: function() {},
56 MakeManagedAnimation: function() {},
57 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050058 MakeSkVertices: function() {},
59 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 MakeWebGLCanvasSurface: function() {},
61 /** @return {TypedArray} */
62 Malloc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050063 computeTonalColors: function() {},
64 currentContext: function() {},
65 getColorComponents: function() {},
66 getDecodeCacheLimitBytes: function() {},
67 getDecodeCacheUsageBytes: function() {},
68 getSkDataBytes: function() {},
69 multiplyByAlpha: function() {},
70 parseColorString: function() {},
71 setCurrentContext: function() {},
72 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040073
Kevin Lubicke70af512020-05-14 14:50:54 -040074 // Defined by emscripten.
75 createContext:function() {},
76
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 // private API (i.e. things declared in the bindings that we use
78 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040079 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeImage: function() {},
81 _MakeLinearGradientShader: function() {},
82 _MakePathFromCmds: function() {},
83 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070084 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050085 _MakeManagedAnimation: function() {},
86 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050087 _MakeSkPicture: function() {},
88 _MakeSkVertices: function() {},
89 _MakeTwoPointConicalGradientShader: function() {},
90 _decodeAnimatedImage: function() {},
91 _decodeImage: function() {},
92 _drawShapedText: function() {},
93 _getRasterDirectSurface: function() {},
94 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040095
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050096 // The testing object is meant to expose internal functions
97 // for more fine-grained testing, e.g. parseColor
98 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050099
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500100 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 GrContext: {
103 // public API (from C++ bindings)
104 getResourceCacheLimitBytes: function() {},
105 getResourceCacheUsageBytes: function() {},
106 releaseResourcesAndAbandonContext: function() {},
107 setResourceCacheLimitBytes: function() {},
108 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400109
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400110 ManagedAnimation: {
111 prototype: {
112 setColor: function() {},
113 },
114 },
115
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500116 Paragraph: {
117 // public API (from C++ bindings)
118 didExceedMaxLines: function() {},
119 getAlphabeticBaseline: function() {},
120 getGlyphPositionAtCoordinate: function() {},
121 getHeight: function() {},
122 getIdeographicBaseline: function() {},
123 getLongestLine: function() {},
124 getMaxIntrinsicWidth: function() {},
125 getMaxWidth: function() {},
126 getMinIntrinsicWidth: function() {},
127 getWordBoundary: function() {},
128 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400129
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 // private API
131 /** @return {Float32Array} */
132 _getRectsForRange: function() {},
133 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400134
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400135 ParagraphBuilder: {
136 Make: function() {},
137 addText: function() {},
138 build: function() {},
139 pop: function() {},
140
141 prototype: {
142 pushStyle: function() {},
143 },
144
145 // private API
146 _Make: function() {},
147 _pushStyle: function() {},
148 },
149
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500150 SkRuntimeEffect: {
151 // public API (from C++ bindings)
152 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500153
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500154 // private API
155 _makeShader: function() {},
156 _makeShaderWithChildren: function() {},
157 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500158
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500159 ParagraphStyle: function() {},
160 RSXFormBuilder: function() {},
161 SkColorBuilder: function() {},
162 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400163
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500164 ShapedText: {
165 // public API (from C++ bindings)
166 getBounds: function() {},
167 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500168
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500169 SkAnimatedImage: {
170 // public API (from C++ bindings)
171 decodeNextFrame: function() {},
172 getFrameCount: function() {},
173 getRepetitionCount: function() {},
174 height: function() {},
175 reset: function() {},
176 width: function() {},
177 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400178
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500179 SkCanvas: {
180 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500181 clipPath: function() {},
182 clipRRect: function() {},
183 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 drawAnimatedImage: function() {},
185 drawArc: function() {},
186 drawCircle: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 drawDRRect: function() {},
188 drawImage: function() {},
189 drawImageNine: function() {},
190 drawImageRect: function() {},
191 drawLine: function() {},
192 drawOval: function() {},
193 drawPaint: function() {},
194 drawParagraph: function() {},
195 drawPath: function() {},
196 drawPicture: function() {},
197 drawRRect: function() {},
198 drawRect: function() {},
199 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 drawText: function() {},
201 drawTextBlob: function() {},
202 drawVertices: function() {},
203 flush: function() {},
204 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400206 markCTM: function() {},
207 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 restore: function() {},
209 restoreToCount: function() {},
210 rotate: function() {},
211 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000212 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 scale: function() {},
214 skew: function() {},
215 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400216
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400217 prototype: {
218 clear: function() {},
219 drawColor: function() {},
220 drawShadow: function() {},
221 },
222
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500223 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400225 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500226 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400227 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500228 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400229 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500230 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400231 _getLocalToCamera: function() {},
232 _getLocalToDevice: function() {},
233 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400234 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400235 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500236 _readPixels: function() {},
237 _writePixels: function() {},
238 delete: function() {},
239 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400240
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500241 SkColorFilter: {
242 // public API (from C++ bindings and JS interface)
243 MakeBlend: function() {},
244 MakeCompose: function() {},
245 MakeLerp: function() {},
246 MakeLinearToSRGBGamma: function() {},
247 MakeMatrix: function() {},
248 MakeSRGBToLinearGamma: function() {},
249 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400250 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500251 _makeMatrix: function() {},
252 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400253
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500254 SkColorMatrix: {
255 concat: function() {},
256 identity: function() {},
257 postTranslate: function() {},
258 rotated: function() {},
259 scaled: function() {},
260 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400261
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500262 SkContourMeasureIter: {
263 next: function() {},
264 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500265
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500266 SkContourMeasure: {
267 getPosTan: function() {},
268 getSegment: function() {},
269 isClosed: function() {},
270 length: function() {},
271 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500272
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500273 SkFont: {
274 // public API (from C++ bindings)
275 getScaleX: function() {},
276 getSize: function() {},
277 getSkewX: function() {},
278 getTypeface: function() {},
279 measureText: function() {},
280 setHinting: function() {},
281 setLinearMetrics: function() {},
282 setScaleX: function() {},
283 setSize: function() {},
284 setSkewX: function() {},
285 setSubpixel: function() {},
286 setTypeface: function() {},
287 // private API (from C++ bindings)
288 _getWidths: function() {},
289 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500290
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500291 SkFontMgr: {
292 // public API (from C++ and JS bindings)
293 FromData: function() {},
294 RefDefault: function() {},
295 countFamilies: function() {},
296 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500297
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500298 // private API
299 _makeTypefaceFromData: function() {},
300 _fromData: function() {},
301 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500302
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500303 SkImage: {
304 // public API (from C++ bindings)
305 height: function() {},
306 width: function() {},
307 // private API
308 _encodeToData: function() {},
309 _encodeToDataWithFormat: function() {},
310 _makeShader: function() {},
311 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400312
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500313 SkImageFilter: {
314 MakeBlur: function() {},
315 MakeColorFilter: function() {},
316 MakeCompose: function() {},
317 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400318
319 // private API
320 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500321 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400322
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500323 // These are defined in interface.js
324 SkM44: {
325 identity: function() {},
326 invert: function() {},
327 multiply: function() {},
328 rotatedUnitSinCos: function() {},
329 rotated: function() {},
330 scaled: function() {},
331 translated: function() {},
332 lookat: function() {},
333 perspective: function() {},
334 rc: function() {},
335 transpose: function() {},
336 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500337
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500338 SkMatrix: {
339 identity: function() {},
340 invert: function() {},
341 mapPoints: function() {},
342 multiply: function() {},
343 rotated: function() {},
344 scaled: function() {},
345 skewed: function() {},
346 translated: function() {},
347 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500348
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500349 SkMaskFilter: {
350 MakeBlur: function() {},
351 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400352
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500353 SkPaint: {
354 // public API (from C++ bindings)
355 /** @return {CanvasKit.SkPaint} */
356 copy: function() {},
357 getBlendMode: function() {},
358 getColor: function() {},
359 getFilterQuality: function() {},
360 getStrokeCap: function() {},
361 getStrokeJoin: function() {},
362 getStrokeMiter: function() {},
363 getStrokeWidth: function() {},
364 setAntiAlias: function() {},
365 setBlendMode: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500366 setFilterQuality: function() {},
367 setImageFilter: function() {},
368 setMaskFilter: function() {},
369 setPathEffect: function() {},
370 setShader: function() {},
371 setStrokeCap: function() {},
372 setStrokeJoin: function() {},
373 setStrokeMiter: function() {},
374 setStrokeWidth: function() {},
375 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500376
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400377 prototype: {
378 setColor: function() {},
379 },
380
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500381 // Private API
382 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400383 _getColor: function() {},
384 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500385 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500386
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500387 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400388 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500389 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400390 MakeDiscrete: function() {},
391
392 // Private C++ API
393 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500395
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500396 SkParticleEffect: {
397 // public API (from C++ bindings)
398 draw: function() {},
399 getEffectUniform: function() {},
400 getEffectUniformCount: function() {},
401 getEffectUniformFloatCount: function() {},
402 getEffectUniformName: function() {},
403 getParticleUniformCount: function() {},
404 getParticleUniformFloatCount: function() {},
405 getParticleUniformName: function() {},
406 getParticleUniform: function() {},
407 setPosition: function() {},
408 setRate: function() {},
409 start: function() {},
410 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500411
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500412 // private API (from C++ bindings)
413 _effectUniformPtr: function() {},
414 _particleUniformPtr: function() {},
415 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500416
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500417 SkPath: {
418 // public API (from C++ bindings)
419 computeTightBounds: function() {},
420 contains: function() {},
421 /** @return {CanvasKit.SkPath} */
422 copy: function() {},
423 countPoints: function() {},
424 equals: function() {},
425 getBounds: function() {},
426 getFillType: function() {},
427 getPoint: function() {},
428 isEmpty: function() {},
429 isVolatile: function() {},
430 reset: function() {},
431 rewind: function() {},
432 setFillType: function() {},
433 setIsVolatile: function() {},
434 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400435
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500436 // private API
437 _addArc: function() {},
438 _addOval: function() {},
439 _addPath: function() {},
440 _addRect: function() {},
441 _addPoly: function() {},
442 _addRoundRect: function() {},
443 _arc: function() {},
444 _arcTo: function() {},
445 _close: function() {},
446 _conicTo: function() {},
447 _cubicTo: function() {},
448 _dash: function() {},
449 _lineTo: function() {},
450 _moveTo: function() {},
451 _op: function() {},
452 _quadTo: function() {},
453 _rArcTo: function() {},
454 _rConicTo: function() {},
455 _rCubicTo: function() {},
456 _rLineTo: function() {},
457 _rMoveTo: function() {},
458 _rQuadTo: function() {},
459 _rect: function() {},
460 _simplify: function() {},
461 _stroke: function() {},
462 _transform: function() {},
463 _trim: function() {},
464 delete: function() {},
465 dump: function() {},
466 dumpHex: function() {},
467 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400468
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500469 SkPathMeasure: {
470 getLength: function() {},
471 getSegment: function() {},
472 getPosTan: function() {},
473 isClosed: function() {},
474 nextContour: function() {},
475 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400476
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500477 SkPicture: {
478 serialize: function() {},
479 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400480
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500481 SkPictureRecorder: {
482 beginRecording: function() {},
483 finishRecordingAsPicture: function() {},
484 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400485
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500486 SkRect: {
487 fLeft: {},
488 fTop: {},
489 fRight: {},
490 fBottom: {},
491 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400492
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500493 SkRRect: {
494 rect: {},
495 rx1: {},
496 ry1: {},
497 rx2: {},
498 ry2: {},
499 rx3: {},
500 ry3: {},
501 rx4: {},
502 ry4: {},
503 },
Kevin Lubick62836902019-12-09 09:04:26 -0500504
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500505 SkShader: {
506 Blend: function() {},
507 Color: function() {},
508 Empty: function() {},
509 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400510 MakeLinearGradient: function() {},
511 MakeRadialGradient: function() {},
512 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700513 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400514
515 // private API (from C++ bindings)
516 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500517 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400518
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500519 SkSurface: {
520 // public API (from C++ bindings)
521 /** @return {CanvasKit.SkCanvas} */
522 getCanvas: function() {},
523 /** @return {CanvasKit.SkImage} */
524 makeImageSnapshot: function() {},
525 makeSurface: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400526 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500527 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400528
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500529 // private API
530 _flush: function() {},
531 _getRasterN32PremulSurface: function() {},
532 delete: function() {},
533 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500534
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500535 SkTextBlob: {
536 // public API (both C++ and JS bindings)
537 MakeFromRSXform: function() {},
538 MakeFromText: function() {},
539 MakeOnPath: function() {},
540 // private API (from C++ bindings)
541 _MakeFromRSXform: function() {},
542 _MakeFromText: function() {},
543 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500544
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500545 // These are defined in interface.js
546 SkVector: {
547 add: function() {},
548 sub: function() {},
549 dot: function() {},
550 cross: function() {},
551 normalize: function() {},
552 mulScalar: function() {},
553 length: function() {},
554 lengthSquared: function() {},
555 dist: function() {},
556 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400557
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500558 SkVertices: {
559 // public API (from C++ bindings)
560 bounds: function() {},
561 mode: function() {},
562 uniqueID: function() {},
563 vertexCount: function() {},
564 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400565
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500566 _SkVerticesBuilder: {
567 colors: function() {},
568 detach: function() {},
569 indices: function() {},
570 positions: function() {},
571 texCoords: function() {},
572 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400573
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400575
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500576 // Constants and Enums
577 gpu: {},
578 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400579
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500580 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400581 BLACK: {},
582 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500583 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400584 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500585 BLUE: {},
586 YELLOW: {},
587 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400588 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500589
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500590 MOVE_VERB: {},
591 LINE_VERB: {},
592 QUAD_VERB: {},
593 CONIC_VERB: {},
594 CUBIC_VERB: {},
595 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500596
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500597 NoDecoration: {},
598 UnderlineDecoration: {},
599 OverlineDecoration: {},
600 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400601
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 SaveLayerInitWithPrevious: {},
603 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400604
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500605 Affinity: {
606 Upstream: {},
607 Downstream: {},
608 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400609
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500610 AlphaType: {
611 Opaque: {},
612 Premul: {},
613 Unpremul: {},
614 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500615
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500616 BlendMode: {
617 Clear: {},
618 Src: {},
619 Dst: {},
620 SrcOver: {},
621 DstOver: {},
622 SrcIn: {},
623 DstIn: {},
624 SrcOut: {},
625 DstOut: {},
626 SrcATop: {},
627 DstATop: {},
628 Xor: {},
629 Plus: {},
630 Modulate: {},
631 Screen: {},
632 Overlay: {},
633 Darken: {},
634 Lighten: {},
635 ColorDodge: {},
636 ColorBurn: {},
637 HardLight: {},
638 SoftLight: {},
639 Difference: {},
640 Exclusion: {},
641 Multiply: {},
642 Hue: {},
643 Saturation: {},
644 Color: {},
645 Luminosity: {},
646 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500647
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500648 BlurStyle: {
649 Normal: {},
650 Solid: {},
651 Outer: {},
652 Inner: {},
653 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500654
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500655 ClipOp: {
656 Difference: {},
657 Intersect: {},
658 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500659
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500660 ColorType: {
661 Alpha_8: {},
662 RGB_565: {},
663 ARGB_4444: {},
664 RGBA_8888: {},
665 RGB_888x: {},
666 BGRA_8888: {},
667 RGBA_1010102: {},
668 RGB_101010x: {},
669 Gray_8: {},
670 RGBA_F16: {},
671 RGBA_F32: {},
672 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500673
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500674 FillType: {
675 Winding: {},
676 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500677 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400678
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 FilterQuality: {
680 None: {},
681 Low: {},
682 Medium: {},
683 High: {},
684 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500685
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500686 FontSlant: {
687 Upright: {},
688 Italic: {},
689 Oblique: {},
690 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400691
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 FontHinting: {
693 None: {},
694 Slight: {},
695 Normal: {},
696 Full: {},
697 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500698
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 FontWeight: {
700 Invisible: {},
701 Thin: {},
702 ExtraLight: {},
703 Light: {},
704 Normal: {},
705 Medium: {},
706 SemiBold: {},
707 Bold: {},
708 ExtraBold: {},
709 Black: {},
710 ExtraBlack: {},
711 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 FontWidth: {
714 UltraCondensed: {},
715 ExtraCondensed: {},
716 Condensed: {},
717 SemiCondensed: {},
718 Normal: {},
719 SemiExpanded: {},
720 Expanded: {},
721 ExtraExpanded: {},
722 UltraExpanded: {},
723 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 ImageFormat: {
726 PNG: {},
727 JPEG: {},
728 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 PaintStyle: {
731 Fill: {},
732 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500734
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500735 PathOp: {
736 Difference: {},
737 Intersect: {},
738 Union: {},
739 XOR: {},
740 ReverseDifference: {},
741 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500742
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500743 PointMode: {
744 Points: {},
745 Lines: {},
746 Polygon: {},
747 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500748
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500749 RectHeightStyle: {
750 Tight: {},
751 Max: {},
752 IncludeLineSpacingMiddle: {},
753 IncludeLineSpacingTop: {},
754 IncludeLineSpacingBottom: {},
755 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400756
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500757 RectWidthStyle: {
758 Tight: {},
759 Max: {},
760 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400761
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500762 StrokeCap: {
763 Butt: {},
764 Round: {},
765 Square: {},
766 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500767
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500768 StrokeJoin: {
769 Miter: {},
770 Round: {},
771 Bevel: {},
772 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500773
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500774 TextAlign: {
775 Left: {},
776 Right: {},
777 Center: {},
778 Justify: {},
779 Start: {},
780 End: {},
781 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 TextDirection: {
784 LTR: {},
785 RTL: {},
786 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 TileMode: {
789 Clamp: {},
790 Repeat: {},
791 Mirror: {},
792 Decal: {},
793 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 VertexMode: {
796 Triangles: {},
797 TrianglesStrip: {},
798 TriangleFan: {},
799 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500800
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500801 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400802
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500803 /**
804 * @type {Float32Array}
805 */
806 HEAPF32: {},
807 /**
808 * @type {Float64Array}
809 */
810 HEAPF64: {},
811 /**
812 * @type {Uint8Array}
813 */
814 HEAPU8: {},
815 /**
816 * @type {Uint16Array}
817 */
818 HEAPU16: {},
819 /**
820 * @type {Uint32Array}
821 */
822 HEAPU32: {},
823 /**
824 * @type {Int8Array}
825 */
826 HEAP8: {},
827 /**
828 * @type {Int16Array}
829 */
830 HEAP16: {},
831 /**
832 * @type {Int32Array}
833 */
834 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400835
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500836 _malloc: function() {},
837 _free: function() {},
838 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400839};
Kevin Lubick217056c2018-09-20 17:39:31 -0400840
Kevin Lubick006a6f32018-10-19 14:34:34 -0400841// Public API things that are newly declared in the JS should go here.
842// It's not enough to declare them above, because closure can still erase them
843// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400844CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
845
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500846CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400847CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400848CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500849CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500850CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500851CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300852CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400853CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400854CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400855CanvasKit.SkPath.prototype.conicTo = function() {};
856CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400857CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400858CanvasKit.SkPath.prototype.lineTo = function() {};
859CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400860CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400861CanvasKit.SkPath.prototype.op = function() {};
862CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400863CanvasKit.SkPath.prototype.rArcTo = function() {};
864CanvasKit.SkPath.prototype.rConicTo = function() {};
865CanvasKit.SkPath.prototype.rCubicTo = function() {};
866CanvasKit.SkPath.prototype.rLineTo = function() {};
867CanvasKit.SkPath.prototype.rMoveTo = function() {};
868CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400869CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400870CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400871CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400872CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400873CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400874
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500875CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400876
Kevin Lubick5b90b842018-10-17 07:57:18 -0400877CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400878CanvasKit.SkSurface.prototype.flush = function() {};
879CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800880CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400881CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400882
Alexander Khovansky3e119332018-11-15 02:01:19 +0300883CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400884CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300885
Kevin Lubick6bffe392020-04-02 15:24:15 -0400886CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400887CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400888CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500889CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500890CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400891CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
892CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
893CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400894CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500895/** @return {Uint8Array} */
896CanvasKit.SkCanvas.prototype.readPixels = function() {};
897CanvasKit.SkCanvas.prototype.writePixels = function() {};
898
Kevin Lubickddd0a332018-12-12 10:35:13 -0500899CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
900
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400901CanvasKit.SkFont.prototype.getWidths = function() {};
902
903CanvasKit.RSXFormBuilder.prototype.build = function() {};
904CanvasKit.RSXFormBuilder.prototype.delete = function() {};
905CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400906CanvasKit.RSXFormBuilder.prototype.set = function() {};
907
908CanvasKit.SkColorBuilder.prototype.build = function() {};
909CanvasKit.SkColorBuilder.prototype.delete = function() {};
910CanvasKit.SkColorBuilder.prototype.push = function() {};
911CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400912
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500913CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500914CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500915
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500916CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
917CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
918
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400919// Define StrokeOpts object
920var StrokeOpts = {};
921StrokeOpts.prototype.width;
922StrokeOpts.prototype.miter_limit;
923StrokeOpts.prototype.cap;
924StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500925StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400926
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500927// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500928var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500929HTMLCanvas.prototype.decodeImage = function() {};
930HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500931HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500932HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500933HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500934HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500935
936var CanvasRenderingContext2D = {};
937CanvasRenderingContext2D.prototype.addHitRegion = function() {};
938CanvasRenderingContext2D.prototype.arc = function() {};
939CanvasRenderingContext2D.prototype.arcTo = function() {};
940CanvasRenderingContext2D.prototype.beginPath = function() {};
941CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
942CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500943CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500944CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500945CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500946CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500947CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500948CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500949CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500950CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500951CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500952CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500953CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500954CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500955CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500956CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500957CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500958CanvasRenderingContext2D.prototype.isPointInPath = function() {};
959CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500960CanvasRenderingContext2D.prototype.lineTo = function() {};
961CanvasRenderingContext2D.prototype.measureText = function() {};
962CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500963CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500964CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
965CanvasRenderingContext2D.prototype.rect = function() {};
966CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
967CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500968CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500969CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500970CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500971CanvasRenderingContext2D.prototype.scale = function() {};
972CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500973CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500974CanvasRenderingContext2D.prototype.setTransform = function() {};
975CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500976CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500977CanvasRenderingContext2D.prototype.strokeText = function() {};
978CanvasRenderingContext2D.prototype.transform = function() {};
979CanvasRenderingContext2D.prototype.translate = function() {};
980
Kevin Lubicka40f8322018-12-17 16:01:36 -0500981var Path2D = {};
982Path2D.prototype.addPath = function() {};
983Path2D.prototype.arc = function() {};
984Path2D.prototype.arcTo = function() {};
985Path2D.prototype.bezierCurveTo = function() {};
986Path2D.prototype.closePath = function() {};
987Path2D.prototype.ellipse = function() {};
988Path2D.prototype.lineTo = function() {};
989Path2D.prototype.moveTo = function() {};
990Path2D.prototype.quadraticCurveTo = function() {};
991Path2D.prototype.rect = function() {};
992
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500993var LinearCanvasGradient = {};
994LinearCanvasGradient.prototype.addColorStop = function() {};
995var RadialCanvasGradient = {};
996RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500997var CanvasPattern = {};
998CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500999
Kevin Lubick52b9f372018-12-04 13:57:36 -05001000var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001001 /**
1002 * @type {Uint8ClampedArray}
1003 */
1004 data: {},
1005 height: {},
1006 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001007};
1008
Kevin Lubickd29edd72018-12-07 08:29:52 -05001009var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001010 a: {},
1011 b: {},
1012 c: {},
1013 d: {},
1014 e: {},
1015 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001016};
1017
Kevin Lubick217056c2018-09-20 17:39:31 -04001018// 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 -05001019function loadWebAssemblyModule() {};