blob: 905400e7fc1d691f58a9a07c1f8b99bfa614c5cd [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeOnScreenGLSurface: function() {},
51 MakePathFromCmds: function() {},
52 MakePathFromOp: function() {},
53 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050054 MakeRenderTarget: function() {},
55 MakeSkPicture: function() {},
56 MakeSWCanvasSurface: function() {},
57 MakeManagedAnimation: function() {},
58 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 MakeSkVertices: function() {},
60 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050061 MakeWebGLCanvasSurface: function() {},
62 /** @return {TypedArray} */
63 Malloc: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040064 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050065 computeTonalColors: function() {},
66 currentContext: function() {},
67 getColorComponents: function() {},
68 getDecodeCacheLimitBytes: function() {},
69 getDecodeCacheUsageBytes: function() {},
70 getSkDataBytes: function() {},
71 multiplyByAlpha: function() {},
72 parseColorString: function() {},
73 setCurrentContext: function() {},
74 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040075
Kevin Lubicke70af512020-05-14 14:50:54 -040076 // Defined by emscripten.
77 createContext:function() {},
78
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050079 // private API (i.e. things declared in the bindings that we use
80 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040081 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050082 _MakeImage: function() {},
83 _MakeLinearGradientShader: function() {},
84 _MakePathFromCmds: function() {},
85 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070086 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050087 _MakeManagedAnimation: function() {},
88 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050089 _MakeSkPicture: function() {},
90 _MakeSkVertices: function() {},
91 _MakeTwoPointConicalGradientShader: function() {},
92 _decodeAnimatedImage: function() {},
93 _decodeImage: function() {},
94 _drawShapedText: function() {},
95 _getRasterDirectSurface: function() {},
96 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040097
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050098 // The testing object is meant to expose internal functions
99 // for more fine-grained testing, e.g. parseColor
100 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400103
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500104 GrContext: {
105 // public API (from C++ bindings)
106 getResourceCacheLimitBytes: function() {},
107 getResourceCacheUsageBytes: function() {},
108 releaseResourcesAndAbandonContext: function() {},
109 setResourceCacheLimitBytes: function() {},
110 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400111
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400112 ManagedAnimation: {
113 prototype: {
114 setColor: function() {},
115 },
116 },
117
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500118 Paragraph: {
119 // public API (from C++ bindings)
120 didExceedMaxLines: function() {},
121 getAlphabeticBaseline: function() {},
122 getGlyphPositionAtCoordinate: function() {},
123 getHeight: function() {},
124 getIdeographicBaseline: function() {},
125 getLongestLine: function() {},
126 getMaxIntrinsicWidth: function() {},
127 getMaxWidth: function() {},
128 getMinIntrinsicWidth: function() {},
129 getWordBoundary: function() {},
130 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400131
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500132 // private API
133 /** @return {Float32Array} */
134 _getRectsForRange: function() {},
135 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400136
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400137 ParagraphBuilder: {
138 Make: function() {},
139 addText: function() {},
140 build: function() {},
141 pop: function() {},
142
143 prototype: {
144 pushStyle: function() {},
145 },
146
147 // private API
148 _Make: function() {},
149 _pushStyle: function() {},
150 },
151
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500152 SkRuntimeEffect: {
153 // public API (from C++ bindings)
154 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500155
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500156 // private API
157 _makeShader: function() {},
158 _makeShaderWithChildren: function() {},
159 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500160
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500161 ParagraphStyle: function() {},
162 RSXFormBuilder: function() {},
163 SkColorBuilder: function() {},
164 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400165
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500166 ShapedText: {
167 // public API (from C++ bindings)
168 getBounds: function() {},
169 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500170
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500171 SkAnimatedImage: {
172 // public API (from C++ bindings)
173 decodeNextFrame: function() {},
174 getFrameCount: function() {},
175 getRepetitionCount: function() {},
176 height: function() {},
177 reset: function() {},
178 width: function() {},
179 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400180
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500181 SkCanvas: {
182 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500183 clipPath: function() {},
184 clipRRect: function() {},
185 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500186 drawAnimatedImage: function() {},
187 drawArc: function() {},
188 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400189 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500190 drawDRRect: function() {},
191 drawImage: function() {},
192 drawImageNine: function() {},
193 drawImageRect: function() {},
194 drawLine: function() {},
195 drawOval: function() {},
196 drawPaint: function() {},
197 drawParagraph: function() {},
198 drawPath: function() {},
199 drawPicture: function() {},
200 drawRRect: function() {},
201 drawRect: function() {},
202 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawText: function() {},
204 drawTextBlob: function() {},
205 drawVertices: function() {},
206 flush: function() {},
207 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400209 markCTM: function() {},
210 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500211 restore: function() {},
212 restoreToCount: function() {},
213 rotate: function() {},
214 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000215 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 scale: function() {},
217 skew: function() {},
218 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400219
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400220 prototype: {
221 clear: function() {},
222 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400223 drawColorComponents: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 drawShadow: function() {},
225 },
226
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500227 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400228 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400229 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500230 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400231 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500232 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400233 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500234 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400235 _getLocalToCamera: function() {},
236 _getLocalToDevice: function() {},
237 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400238 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400239 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500240 _readPixels: function() {},
241 _writePixels: function() {},
242 delete: function() {},
243 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400244
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500245 SkColorFilter: {
246 // public API (from C++ bindings and JS interface)
247 MakeBlend: function() {},
248 MakeCompose: function() {},
249 MakeLerp: function() {},
250 MakeLinearToSRGBGamma: function() {},
251 MakeMatrix: function() {},
252 MakeSRGBToLinearGamma: function() {},
253 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400254 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500255 _makeMatrix: function() {},
256 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400257
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500258 SkColorMatrix: {
259 concat: function() {},
260 identity: function() {},
261 postTranslate: function() {},
262 rotated: function() {},
263 scaled: function() {},
264 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400265
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400266 SkColorSpace: {
267 Equals: function() {},
268 SRGB: {},
269 DISPLAY_P3: {},
270 ADOBE_RGB: {},
271 // private API (from C++ bindings)
272 _MakeSRGB: function() {},
273 _MakeDisplayP3: function() {},
274 _MakeAdobeRGB: function() {},
275 },
276
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500277 SkContourMeasureIter: {
278 next: function() {},
279 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500280
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500281 SkContourMeasure: {
282 getPosTan: function() {},
283 getSegment: function() {},
284 isClosed: function() {},
285 length: function() {},
286 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500287
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500288 SkFont: {
289 // public API (from C++ bindings)
290 getScaleX: function() {},
291 getSize: function() {},
292 getSkewX: function() {},
293 getTypeface: function() {},
294 measureText: function() {},
295 setHinting: function() {},
296 setLinearMetrics: function() {},
297 setScaleX: function() {},
298 setSize: function() {},
299 setSkewX: function() {},
300 setSubpixel: function() {},
301 setTypeface: function() {},
302 // private API (from C++ bindings)
303 _getWidths: function() {},
304 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500305
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500306 SkFontMgr: {
307 // public API (from C++ and JS bindings)
308 FromData: function() {},
309 RefDefault: function() {},
310 countFamilies: function() {},
311 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500312
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500313 // private API
314 _makeTypefaceFromData: function() {},
315 _fromData: function() {},
316 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500317
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500318 SkImage: {
319 // public API (from C++ bindings)
320 height: function() {},
321 width: function() {},
322 // private API
323 _encodeToData: function() {},
324 _encodeToDataWithFormat: function() {},
325 _makeShader: function() {},
326 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400327
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500328 SkImageFilter: {
329 MakeBlur: function() {},
330 MakeColorFilter: function() {},
331 MakeCompose: function() {},
332 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400333
334 // private API
335 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500336 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400337
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500338 // These are defined in interface.js
339 SkM44: {
340 identity: function() {},
341 invert: function() {},
342 multiply: function() {},
343 rotatedUnitSinCos: function() {},
344 rotated: function() {},
345 scaled: function() {},
346 translated: function() {},
347 lookat: function() {},
348 perspective: function() {},
349 rc: function() {},
350 transpose: function() {},
351 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500352
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500353 SkMatrix: {
354 identity: function() {},
355 invert: function() {},
356 mapPoints: function() {},
357 multiply: function() {},
358 rotated: function() {},
359 scaled: function() {},
360 skewed: function() {},
361 translated: function() {},
362 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500363
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500364 SkMaskFilter: {
365 MakeBlur: function() {},
366 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400367
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500368 SkPaint: {
369 // public API (from C++ bindings)
370 /** @return {CanvasKit.SkPaint} */
371 copy: function() {},
372 getBlendMode: function() {},
373 getColor: function() {},
374 getFilterQuality: function() {},
375 getStrokeCap: function() {},
376 getStrokeJoin: function() {},
377 getStrokeMiter: function() {},
378 getStrokeWidth: function() {},
379 setAntiAlias: function() {},
380 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400381 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500382 setFilterQuality: function() {},
383 setImageFilter: function() {},
384 setMaskFilter: function() {},
385 setPathEffect: function() {},
386 setShader: function() {},
387 setStrokeCap: function() {},
388 setStrokeJoin: function() {},
389 setStrokeMiter: function() {},
390 setStrokeWidth: function() {},
391 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500392
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400393 prototype: {
394 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400395 setColorComponents: function() {},
396 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400397 },
398
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 // Private API
400 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400401 _getColor: function() {},
402 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500403 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500404
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500405 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400406 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400408 MakeDiscrete: function() {},
409
410 // Private C++ API
411 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500412 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500413
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500414 SkParticleEffect: {
415 // public API (from C++ bindings)
416 draw: function() {},
417 getEffectUniform: function() {},
418 getEffectUniformCount: function() {},
419 getEffectUniformFloatCount: function() {},
420 getEffectUniformName: function() {},
421 getParticleUniformCount: function() {},
422 getParticleUniformFloatCount: function() {},
423 getParticleUniformName: function() {},
424 getParticleUniform: function() {},
425 setPosition: function() {},
426 setRate: function() {},
427 start: function() {},
428 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500429
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500430 // private API (from C++ bindings)
431 _effectUniformPtr: function() {},
432 _particleUniformPtr: function() {},
433 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500434
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500435 SkPath: {
436 // public API (from C++ bindings)
437 computeTightBounds: function() {},
438 contains: function() {},
439 /** @return {CanvasKit.SkPath} */
440 copy: function() {},
441 countPoints: function() {},
442 equals: function() {},
443 getBounds: function() {},
444 getFillType: function() {},
445 getPoint: function() {},
446 isEmpty: function() {},
447 isVolatile: function() {},
448 reset: function() {},
449 rewind: function() {},
450 setFillType: function() {},
451 setIsVolatile: function() {},
452 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400453
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500454 // private API
455 _addArc: function() {},
456 _addOval: function() {},
457 _addPath: function() {},
458 _addRect: function() {},
459 _addPoly: function() {},
460 _addRoundRect: function() {},
461 _arc: function() {},
462 _arcTo: function() {},
463 _close: function() {},
464 _conicTo: function() {},
465 _cubicTo: function() {},
466 _dash: function() {},
467 _lineTo: function() {},
468 _moveTo: function() {},
469 _op: function() {},
470 _quadTo: function() {},
471 _rArcTo: function() {},
472 _rConicTo: function() {},
473 _rCubicTo: function() {},
474 _rLineTo: function() {},
475 _rMoveTo: function() {},
476 _rQuadTo: function() {},
477 _rect: function() {},
478 _simplify: function() {},
479 _stroke: function() {},
480 _transform: function() {},
481 _trim: function() {},
482 delete: function() {},
483 dump: function() {},
484 dumpHex: function() {},
485 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400486
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500487 SkPathMeasure: {
488 getLength: function() {},
489 getSegment: function() {},
490 getPosTan: function() {},
491 isClosed: function() {},
492 nextContour: function() {},
493 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400494
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500495 SkPicture: {
496 serialize: function() {},
497 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400498
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500499 SkPictureRecorder: {
500 beginRecording: function() {},
501 finishRecordingAsPicture: function() {},
502 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400503
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500504 SkRect: {
505 fLeft: {},
506 fTop: {},
507 fRight: {},
508 fBottom: {},
509 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400510
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500511 SkRRect: {
512 rect: {},
513 rx1: {},
514 ry1: {},
515 rx2: {},
516 ry2: {},
517 rx3: {},
518 ry3: {},
519 rx4: {},
520 ry4: {},
521 },
Kevin Lubick62836902019-12-09 09:04:26 -0500522
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500523 SkShader: {
524 Blend: function() {},
525 Color: function() {},
526 Empty: function() {},
527 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400528 MakeLinearGradient: function() {},
529 MakeRadialGradient: function() {},
530 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700531 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400532
533 // private API (from C++ bindings)
534 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500535 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400536
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500537 SkSurface: {
538 // public API (from C++ bindings)
539 /** @return {CanvasKit.SkCanvas} */
540 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400541 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500542 /** @return {CanvasKit.SkImage} */
543 makeImageSnapshot: function() {},
544 makeSurface: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400545 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500546 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400547
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 // private API
549 _flush: function() {},
550 _getRasterN32PremulSurface: function() {},
551 delete: function() {},
552 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500553
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500554 SkTextBlob: {
555 // public API (both C++ and JS bindings)
556 MakeFromRSXform: function() {},
557 MakeFromText: function() {},
558 MakeOnPath: function() {},
559 // private API (from C++ bindings)
560 _MakeFromRSXform: function() {},
561 _MakeFromText: function() {},
562 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500563
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500564 // These are defined in interface.js
565 SkVector: {
566 add: function() {},
567 sub: function() {},
568 dot: function() {},
569 cross: function() {},
570 normalize: function() {},
571 mulScalar: function() {},
572 length: function() {},
573 lengthSquared: function() {},
574 dist: function() {},
575 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400576
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 SkVertices: {
578 // public API (from C++ bindings)
579 bounds: function() {},
580 mode: function() {},
581 uniqueID: function() {},
582 vertexCount: function() {},
583 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400584
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500585 _SkVerticesBuilder: {
586 colors: function() {},
587 detach: function() {},
588 indices: function() {},
589 positions: function() {},
590 texCoords: function() {},
591 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400592
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500593 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400594
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 // Constants and Enums
596 gpu: {},
597 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400598
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500599 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400600 BLACK: {},
601 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400603 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 BLUE: {},
605 YELLOW: {},
606 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400607 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500608
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 MOVE_VERB: {},
610 LINE_VERB: {},
611 QUAD_VERB: {},
612 CONIC_VERB: {},
613 CUBIC_VERB: {},
614 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500615
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500616 NoDecoration: {},
617 UnderlineDecoration: {},
618 OverlineDecoration: {},
619 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400620
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500621 SaveLayerInitWithPrevious: {},
622 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400623
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500624 Affinity: {
625 Upstream: {},
626 Downstream: {},
627 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400628
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500629 AlphaType: {
630 Opaque: {},
631 Premul: {},
632 Unpremul: {},
633 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500634
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500635 BlendMode: {
636 Clear: {},
637 Src: {},
638 Dst: {},
639 SrcOver: {},
640 DstOver: {},
641 SrcIn: {},
642 DstIn: {},
643 SrcOut: {},
644 DstOut: {},
645 SrcATop: {},
646 DstATop: {},
647 Xor: {},
648 Plus: {},
649 Modulate: {},
650 Screen: {},
651 Overlay: {},
652 Darken: {},
653 Lighten: {},
654 ColorDodge: {},
655 ColorBurn: {},
656 HardLight: {},
657 SoftLight: {},
658 Difference: {},
659 Exclusion: {},
660 Multiply: {},
661 Hue: {},
662 Saturation: {},
663 Color: {},
664 Luminosity: {},
665 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500666
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 BlurStyle: {
668 Normal: {},
669 Solid: {},
670 Outer: {},
671 Inner: {},
672 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500673
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500674 ClipOp: {
675 Difference: {},
676 Intersect: {},
677 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500678
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 ColorType: {
680 Alpha_8: {},
681 RGB_565: {},
682 ARGB_4444: {},
683 RGBA_8888: {},
684 RGB_888x: {},
685 BGRA_8888: {},
686 RGBA_1010102: {},
687 RGB_101010x: {},
688 Gray_8: {},
689 RGBA_F16: {},
690 RGBA_F32: {},
691 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500692
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 FillType: {
694 Winding: {},
695 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400697
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500698 FilterQuality: {
699 None: {},
700 Low: {},
701 Medium: {},
702 High: {},
703 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 FontSlant: {
706 Upright: {},
707 Italic: {},
708 Oblique: {},
709 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400710
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 FontHinting: {
712 None: {},
713 Slight: {},
714 Normal: {},
715 Full: {},
716 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 FontWeight: {
719 Invisible: {},
720 Thin: {},
721 ExtraLight: {},
722 Light: {},
723 Normal: {},
724 Medium: {},
725 SemiBold: {},
726 Bold: {},
727 ExtraBold: {},
728 Black: {},
729 ExtraBlack: {},
730 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400731
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500732 FontWidth: {
733 UltraCondensed: {},
734 ExtraCondensed: {},
735 Condensed: {},
736 SemiCondensed: {},
737 Normal: {},
738 SemiExpanded: {},
739 Expanded: {},
740 ExtraExpanded: {},
741 UltraExpanded: {},
742 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400743
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500744 ImageFormat: {
745 PNG: {},
746 JPEG: {},
747 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300748
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500749 PaintStyle: {
750 Fill: {},
751 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500752 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500753
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500754 PathOp: {
755 Difference: {},
756 Intersect: {},
757 Union: {},
758 XOR: {},
759 ReverseDifference: {},
760 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500761
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500762 PointMode: {
763 Points: {},
764 Lines: {},
765 Polygon: {},
766 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500767
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500768 RectHeightStyle: {
769 Tight: {},
770 Max: {},
771 IncludeLineSpacingMiddle: {},
772 IncludeLineSpacingTop: {},
773 IncludeLineSpacingBottom: {},
774 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400775
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500776 RectWidthStyle: {
777 Tight: {},
778 Max: {},
779 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400780
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500781 StrokeCap: {
782 Butt: {},
783 Round: {},
784 Square: {},
785 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500786
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500787 StrokeJoin: {
788 Miter: {},
789 Round: {},
790 Bevel: {},
791 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500792
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500793 TextAlign: {
794 Left: {},
795 Right: {},
796 Center: {},
797 Justify: {},
798 Start: {},
799 End: {},
800 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 TextDirection: {
803 LTR: {},
804 RTL: {},
805 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400806
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500807 TileMode: {
808 Clamp: {},
809 Repeat: {},
810 Mirror: {},
811 Decal: {},
812 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 VertexMode: {
815 Triangles: {},
816 TrianglesStrip: {},
817 TriangleFan: {},
818 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500819
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500820 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400821
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500822 /**
823 * @type {Float32Array}
824 */
825 HEAPF32: {},
826 /**
827 * @type {Float64Array}
828 */
829 HEAPF64: {},
830 /**
831 * @type {Uint8Array}
832 */
833 HEAPU8: {},
834 /**
835 * @type {Uint16Array}
836 */
837 HEAPU16: {},
838 /**
839 * @type {Uint32Array}
840 */
841 HEAPU32: {},
842 /**
843 * @type {Int8Array}
844 */
845 HEAP8: {},
846 /**
847 * @type {Int16Array}
848 */
849 HEAP16: {},
850 /**
851 * @type {Int32Array}
852 */
853 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400854
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500855 _malloc: function() {},
856 _free: function() {},
857 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400858};
Kevin Lubick217056c2018-09-20 17:39:31 -0400859
Kevin Lubick006a6f32018-10-19 14:34:34 -0400860// Public API things that are newly declared in the JS should go here.
861// It's not enough to declare them above, because closure can still erase them
862// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400863CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
864
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500865CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400866CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400867CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500868CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500869CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500870CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300871CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400872CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400873CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400874CanvasKit.SkPath.prototype.conicTo = function() {};
875CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400876CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400877CanvasKit.SkPath.prototype.lineTo = function() {};
878CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400879CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400880CanvasKit.SkPath.prototype.op = function() {};
881CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400882CanvasKit.SkPath.prototype.rArcTo = function() {};
883CanvasKit.SkPath.prototype.rConicTo = function() {};
884CanvasKit.SkPath.prototype.rCubicTo = function() {};
885CanvasKit.SkPath.prototype.rLineTo = function() {};
886CanvasKit.SkPath.prototype.rMoveTo = function() {};
887CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400888CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400889CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400890CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400891CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400892CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400893
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500894CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400895
Kevin Lubick5b90b842018-10-17 07:57:18 -0400896CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400897CanvasKit.SkSurface.prototype.flush = function() {};
898CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800899CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400900CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400901
Alexander Khovansky3e119332018-11-15 02:01:19 +0300902CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400903CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300904
Kevin Lubick6bffe392020-04-02 15:24:15 -0400905CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400906CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400907CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500908CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500909CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400910CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
911CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
912CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400913CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500914/** @return {Uint8Array} */
915CanvasKit.SkCanvas.prototype.readPixels = function() {};
916CanvasKit.SkCanvas.prototype.writePixels = function() {};
917
Kevin Lubickddd0a332018-12-12 10:35:13 -0500918CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
919
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400920CanvasKit.SkFont.prototype.getWidths = function() {};
921
922CanvasKit.RSXFormBuilder.prototype.build = function() {};
923CanvasKit.RSXFormBuilder.prototype.delete = function() {};
924CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400925CanvasKit.RSXFormBuilder.prototype.set = function() {};
926
927CanvasKit.SkColorBuilder.prototype.build = function() {};
928CanvasKit.SkColorBuilder.prototype.delete = function() {};
929CanvasKit.SkColorBuilder.prototype.push = function() {};
930CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400931
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500932CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500933CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500934
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500935CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
936CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
937
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400938// Define StrokeOpts object
939var StrokeOpts = {};
940StrokeOpts.prototype.width;
941StrokeOpts.prototype.miter_limit;
942StrokeOpts.prototype.cap;
943StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500944StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400945
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500946// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500947var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500948HTMLCanvas.prototype.decodeImage = function() {};
949HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500950HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500951HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500952HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500953HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500954
955var CanvasRenderingContext2D = {};
956CanvasRenderingContext2D.prototype.addHitRegion = function() {};
957CanvasRenderingContext2D.prototype.arc = function() {};
958CanvasRenderingContext2D.prototype.arcTo = function() {};
959CanvasRenderingContext2D.prototype.beginPath = function() {};
960CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
961CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500962CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500963CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500964CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500965CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500966CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500967CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500968CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500969CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500970CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500971CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500972CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500973CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500974CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500975CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500976CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500977CanvasRenderingContext2D.prototype.isPointInPath = function() {};
978CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500979CanvasRenderingContext2D.prototype.lineTo = function() {};
980CanvasRenderingContext2D.prototype.measureText = function() {};
981CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500982CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500983CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
984CanvasRenderingContext2D.prototype.rect = function() {};
985CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
986CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500987CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500988CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500989CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500990CanvasRenderingContext2D.prototype.scale = function() {};
991CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500992CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500993CanvasRenderingContext2D.prototype.setTransform = function() {};
994CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500995CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500996CanvasRenderingContext2D.prototype.strokeText = function() {};
997CanvasRenderingContext2D.prototype.transform = function() {};
998CanvasRenderingContext2D.prototype.translate = function() {};
999
Kevin Lubicka40f8322018-12-17 16:01:36 -05001000var Path2D = {};
1001Path2D.prototype.addPath = function() {};
1002Path2D.prototype.arc = function() {};
1003Path2D.prototype.arcTo = function() {};
1004Path2D.prototype.bezierCurveTo = function() {};
1005Path2D.prototype.closePath = function() {};
1006Path2D.prototype.ellipse = function() {};
1007Path2D.prototype.lineTo = function() {};
1008Path2D.prototype.moveTo = function() {};
1009Path2D.prototype.quadraticCurveTo = function() {};
1010Path2D.prototype.rect = function() {};
1011
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001012var LinearCanvasGradient = {};
1013LinearCanvasGradient.prototype.addColorStop = function() {};
1014var RadialCanvasGradient = {};
1015RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001016var CanvasPattern = {};
1017CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001018
Kevin Lubick52b9f372018-12-04 13:57:36 -05001019var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001020 /**
1021 * @type {Uint8ClampedArray}
1022 */
1023 data: {},
1024 height: {},
1025 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001026};
1027
Kevin Lubickd29edd72018-12-07 08:29:52 -05001028var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001029 a: {},
1030 b: {},
1031 c: {},
1032 d: {},
1033 e: {},
1034 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001035};
1036
Kevin Lubick217056c2018-09-20 17:39:31 -04001037// 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 -05001038function loadWebAssemblyModule() {};