blob: c4bb4a5eba7c8df25265eaa5adb982156d523bd5 [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() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040063 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050064 computeTonalColors: function() {},
65 currentContext: function() {},
66 getColorComponents: function() {},
67 getDecodeCacheLimitBytes: function() {},
68 getDecodeCacheUsageBytes: function() {},
69 getSkDataBytes: function() {},
70 multiplyByAlpha: function() {},
71 parseColorString: function() {},
72 setCurrentContext: function() {},
73 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040074
Kevin Lubicke70af512020-05-14 14:50:54 -040075 // Defined by emscripten.
76 createContext:function() {},
77
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050078 // private API (i.e. things declared in the bindings that we use
79 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040080 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeImage: function() {},
82 _MakeLinearGradientShader: function() {},
83 _MakePathFromCmds: function() {},
84 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070085 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050086 _MakeManagedAnimation: function() {},
87 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050088 _MakeSkPicture: function() {},
89 _MakeSkVertices: function() {},
90 _MakeTwoPointConicalGradientShader: function() {},
91 _decodeAnimatedImage: function() {},
92 _decodeImage: function() {},
93 _drawShapedText: function() {},
94 _getRasterDirectSurface: function() {},
95 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040096
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050097 // The testing object is meant to expose internal functions
98 // for more fine-grained testing, e.g. parseColor
99 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500100
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500101 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400102
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500103 GrContext: {
104 // public API (from C++ bindings)
105 getResourceCacheLimitBytes: function() {},
106 getResourceCacheUsageBytes: function() {},
107 releaseResourcesAndAbandonContext: function() {},
108 setResourceCacheLimitBytes: function() {},
109 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400110
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400111 ManagedAnimation: {
112 prototype: {
113 setColor: function() {},
114 },
115 },
116
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500117 Paragraph: {
118 // public API (from C++ bindings)
119 didExceedMaxLines: function() {},
120 getAlphabeticBaseline: function() {},
121 getGlyphPositionAtCoordinate: function() {},
122 getHeight: function() {},
123 getIdeographicBaseline: function() {},
124 getLongestLine: function() {},
125 getMaxIntrinsicWidth: function() {},
126 getMaxWidth: function() {},
127 getMinIntrinsicWidth: function() {},
128 getWordBoundary: function() {},
129 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400130
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500131 // private API
132 /** @return {Float32Array} */
133 _getRectsForRange: function() {},
134 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400135
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400136 ParagraphBuilder: {
137 Make: function() {},
138 addText: function() {},
139 build: function() {},
140 pop: function() {},
141
142 prototype: {
143 pushStyle: function() {},
144 },
145
146 // private API
147 _Make: function() {},
148 _pushStyle: function() {},
149 },
150
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500151 SkRuntimeEffect: {
152 // public API (from C++ bindings)
153 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500154
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500155 // private API
156 _makeShader: function() {},
157 _makeShaderWithChildren: function() {},
158 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500159
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500160 ParagraphStyle: function() {},
161 RSXFormBuilder: function() {},
162 SkColorBuilder: function() {},
163 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400164
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500165 ShapedText: {
166 // public API (from C++ bindings)
167 getBounds: function() {},
168 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500169
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500170 SkAnimatedImage: {
171 // public API (from C++ bindings)
172 decodeNextFrame: function() {},
173 getFrameCount: function() {},
174 getRepetitionCount: function() {},
175 height: function() {},
176 reset: function() {},
177 width: function() {},
178 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400179
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500180 SkCanvas: {
181 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500182 clipPath: function() {},
183 clipRRect: function() {},
184 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500185 drawAnimatedImage: function() {},
186 drawArc: function() {},
187 drawCircle: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500188 drawDRRect: function() {},
189 drawImage: function() {},
190 drawImageNine: function() {},
191 drawImageRect: function() {},
192 drawLine: function() {},
193 drawOval: function() {},
194 drawPaint: function() {},
195 drawParagraph: function() {},
196 drawPath: function() {},
197 drawPicture: function() {},
198 drawRRect: function() {},
199 drawRect: function() {},
200 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500201 drawText: function() {},
202 drawTextBlob: function() {},
203 drawVertices: function() {},
204 flush: function() {},
205 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500206 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400207 markCTM: function() {},
208 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500209 restore: function() {},
210 restoreToCount: function() {},
211 rotate: function() {},
212 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000213 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500214 scale: function() {},
215 skew: function() {},
216 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400217
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400218 prototype: {
219 clear: function() {},
220 drawColor: function() {},
221 drawShadow: function() {},
222 },
223
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500224 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400225 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400226 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500227 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400228 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500229 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400230 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500231 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400232 _getLocalToCamera: function() {},
233 _getLocalToDevice: function() {},
234 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400235 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400236 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500237 _readPixels: function() {},
238 _writePixels: function() {},
239 delete: function() {},
240 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400241
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500242 SkColorFilter: {
243 // public API (from C++ bindings and JS interface)
244 MakeBlend: function() {},
245 MakeCompose: function() {},
246 MakeLerp: function() {},
247 MakeLinearToSRGBGamma: function() {},
248 MakeMatrix: function() {},
249 MakeSRGBToLinearGamma: function() {},
250 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400251 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500252 _makeMatrix: function() {},
253 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400254
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500255 SkColorMatrix: {
256 concat: function() {},
257 identity: function() {},
258 postTranslate: function() {},
259 rotated: function() {},
260 scaled: function() {},
261 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400262
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400263 SkColorSpace: {
264 Equals: function() {},
265 SRGB: {},
266 DISPLAY_P3: {},
267 ADOBE_RGB: {},
268 // private API (from C++ bindings)
269 _MakeSRGB: function() {},
270 _MakeDisplayP3: function() {},
271 _MakeAdobeRGB: function() {},
272 },
273
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500274 SkContourMeasureIter: {
275 next: function() {},
276 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500277
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500278 SkContourMeasure: {
279 getPosTan: function() {},
280 getSegment: function() {},
281 isClosed: function() {},
282 length: function() {},
283 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500284
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500285 SkFont: {
286 // public API (from C++ bindings)
287 getScaleX: function() {},
288 getSize: function() {},
289 getSkewX: function() {},
290 getTypeface: function() {},
291 measureText: function() {},
292 setHinting: function() {},
293 setLinearMetrics: function() {},
294 setScaleX: function() {},
295 setSize: function() {},
296 setSkewX: function() {},
297 setSubpixel: function() {},
298 setTypeface: function() {},
299 // private API (from C++ bindings)
300 _getWidths: function() {},
301 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500302
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500303 SkFontMgr: {
304 // public API (from C++ and JS bindings)
305 FromData: function() {},
306 RefDefault: function() {},
307 countFamilies: function() {},
308 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500309
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500310 // private API
311 _makeTypefaceFromData: function() {},
312 _fromData: function() {},
313 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500314
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500315 SkImage: {
316 // public API (from C++ bindings)
317 height: function() {},
318 width: function() {},
319 // private API
320 _encodeToData: function() {},
321 _encodeToDataWithFormat: function() {},
322 _makeShader: function() {},
323 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400324
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500325 SkImageFilter: {
326 MakeBlur: function() {},
327 MakeColorFilter: function() {},
328 MakeCompose: function() {},
329 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400330
331 // private API
332 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500333 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400334
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500335 // These are defined in interface.js
336 SkM44: {
337 identity: function() {},
338 invert: function() {},
339 multiply: function() {},
340 rotatedUnitSinCos: function() {},
341 rotated: function() {},
342 scaled: function() {},
343 translated: function() {},
344 lookat: function() {},
345 perspective: function() {},
346 rc: function() {},
347 transpose: function() {},
348 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500349
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 SkMatrix: {
351 identity: function() {},
352 invert: function() {},
353 mapPoints: function() {},
354 multiply: function() {},
355 rotated: function() {},
356 scaled: function() {},
357 skewed: function() {},
358 translated: function() {},
359 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500360
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500361 SkMaskFilter: {
362 MakeBlur: function() {},
363 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400364
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500365 SkPaint: {
366 // public API (from C++ bindings)
367 /** @return {CanvasKit.SkPaint} */
368 copy: function() {},
369 getBlendMode: function() {},
370 getColor: function() {},
371 getFilterQuality: function() {},
372 getStrokeCap: function() {},
373 getStrokeJoin: function() {},
374 getStrokeMiter: function() {},
375 getStrokeWidth: function() {},
376 setAntiAlias: function() {},
377 setBlendMode: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500378 setFilterQuality: function() {},
379 setImageFilter: function() {},
380 setMaskFilter: function() {},
381 setPathEffect: function() {},
382 setShader: function() {},
383 setStrokeCap: function() {},
384 setStrokeJoin: function() {},
385 setStrokeMiter: function() {},
386 setStrokeWidth: function() {},
387 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500388
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400389 prototype: {
390 setColor: function() {},
391 },
392
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500393 // Private API
394 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400395 _getColor: function() {},
396 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500398
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400400 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500401 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400402 MakeDiscrete: function() {},
403
404 // Private C++ API
405 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500406 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500407
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500408 SkParticleEffect: {
409 // public API (from C++ bindings)
410 draw: function() {},
411 getEffectUniform: function() {},
412 getEffectUniformCount: function() {},
413 getEffectUniformFloatCount: function() {},
414 getEffectUniformName: function() {},
415 getParticleUniformCount: function() {},
416 getParticleUniformFloatCount: function() {},
417 getParticleUniformName: function() {},
418 getParticleUniform: function() {},
419 setPosition: function() {},
420 setRate: function() {},
421 start: function() {},
422 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500423
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500424 // private API (from C++ bindings)
425 _effectUniformPtr: function() {},
426 _particleUniformPtr: function() {},
427 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500428
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500429 SkPath: {
430 // public API (from C++ bindings)
431 computeTightBounds: function() {},
432 contains: function() {},
433 /** @return {CanvasKit.SkPath} */
434 copy: function() {},
435 countPoints: function() {},
436 equals: function() {},
437 getBounds: function() {},
438 getFillType: function() {},
439 getPoint: function() {},
440 isEmpty: function() {},
441 isVolatile: function() {},
442 reset: function() {},
443 rewind: function() {},
444 setFillType: function() {},
445 setIsVolatile: function() {},
446 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400447
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500448 // private API
449 _addArc: function() {},
450 _addOval: function() {},
451 _addPath: function() {},
452 _addRect: function() {},
453 _addPoly: function() {},
454 _addRoundRect: function() {},
455 _arc: function() {},
456 _arcTo: function() {},
457 _close: function() {},
458 _conicTo: function() {},
459 _cubicTo: function() {},
460 _dash: function() {},
461 _lineTo: function() {},
462 _moveTo: function() {},
463 _op: function() {},
464 _quadTo: function() {},
465 _rArcTo: function() {},
466 _rConicTo: function() {},
467 _rCubicTo: function() {},
468 _rLineTo: function() {},
469 _rMoveTo: function() {},
470 _rQuadTo: function() {},
471 _rect: function() {},
472 _simplify: function() {},
473 _stroke: function() {},
474 _transform: function() {},
475 _trim: function() {},
476 delete: function() {},
477 dump: function() {},
478 dumpHex: function() {},
479 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400480
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500481 SkPathMeasure: {
482 getLength: function() {},
483 getSegment: function() {},
484 getPosTan: function() {},
485 isClosed: function() {},
486 nextContour: function() {},
487 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400488
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500489 SkPicture: {
490 serialize: function() {},
491 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400492
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500493 SkPictureRecorder: {
494 beginRecording: function() {},
495 finishRecordingAsPicture: function() {},
496 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400497
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500498 SkRect: {
499 fLeft: {},
500 fTop: {},
501 fRight: {},
502 fBottom: {},
503 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400504
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500505 SkRRect: {
506 rect: {},
507 rx1: {},
508 ry1: {},
509 rx2: {},
510 ry2: {},
511 rx3: {},
512 ry3: {},
513 rx4: {},
514 ry4: {},
515 },
Kevin Lubick62836902019-12-09 09:04:26 -0500516
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500517 SkShader: {
518 Blend: function() {},
519 Color: function() {},
520 Empty: function() {},
521 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400522 MakeLinearGradient: function() {},
523 MakeRadialGradient: function() {},
524 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700525 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400526
527 // private API (from C++ bindings)
528 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500529 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400530
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500531 SkSurface: {
532 // public API (from C++ bindings)
533 /** @return {CanvasKit.SkCanvas} */
534 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400535 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500536 /** @return {CanvasKit.SkImage} */
537 makeImageSnapshot: function() {},
538 makeSurface: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400539 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500540 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400541
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500542 // private API
543 _flush: function() {},
544 _getRasterN32PremulSurface: function() {},
545 delete: function() {},
546 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500547
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 SkTextBlob: {
549 // public API (both C++ and JS bindings)
550 MakeFromRSXform: function() {},
551 MakeFromText: function() {},
552 MakeOnPath: function() {},
553 // private API (from C++ bindings)
554 _MakeFromRSXform: function() {},
555 _MakeFromText: function() {},
556 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500557
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500558 // These are defined in interface.js
559 SkVector: {
560 add: function() {},
561 sub: function() {},
562 dot: function() {},
563 cross: function() {},
564 normalize: function() {},
565 mulScalar: function() {},
566 length: function() {},
567 lengthSquared: function() {},
568 dist: function() {},
569 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400570
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500571 SkVertices: {
572 // public API (from C++ bindings)
573 bounds: function() {},
574 mode: function() {},
575 uniqueID: function() {},
576 vertexCount: function() {},
577 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400578
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500579 _SkVerticesBuilder: {
580 colors: function() {},
581 detach: function() {},
582 indices: function() {},
583 positions: function() {},
584 texCoords: function() {},
585 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400586
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400588
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500589 // Constants and Enums
590 gpu: {},
591 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400592
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500593 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400594 BLACK: {},
595 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400597 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500598 BLUE: {},
599 YELLOW: {},
600 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400601 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500602
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500603 MOVE_VERB: {},
604 LINE_VERB: {},
605 QUAD_VERB: {},
606 CONIC_VERB: {},
607 CUBIC_VERB: {},
608 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500609
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500610 NoDecoration: {},
611 UnderlineDecoration: {},
612 OverlineDecoration: {},
613 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400614
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500615 SaveLayerInitWithPrevious: {},
616 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400617
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 Affinity: {
619 Upstream: {},
620 Downstream: {},
621 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400622
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500623 AlphaType: {
624 Opaque: {},
625 Premul: {},
626 Unpremul: {},
627 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500628
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500629 BlendMode: {
630 Clear: {},
631 Src: {},
632 Dst: {},
633 SrcOver: {},
634 DstOver: {},
635 SrcIn: {},
636 DstIn: {},
637 SrcOut: {},
638 DstOut: {},
639 SrcATop: {},
640 DstATop: {},
641 Xor: {},
642 Plus: {},
643 Modulate: {},
644 Screen: {},
645 Overlay: {},
646 Darken: {},
647 Lighten: {},
648 ColorDodge: {},
649 ColorBurn: {},
650 HardLight: {},
651 SoftLight: {},
652 Difference: {},
653 Exclusion: {},
654 Multiply: {},
655 Hue: {},
656 Saturation: {},
657 Color: {},
658 Luminosity: {},
659 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500660
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 BlurStyle: {
662 Normal: {},
663 Solid: {},
664 Outer: {},
665 Inner: {},
666 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500667
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500668 ClipOp: {
669 Difference: {},
670 Intersect: {},
671 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500672
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500673 ColorType: {
674 Alpha_8: {},
675 RGB_565: {},
676 ARGB_4444: {},
677 RGBA_8888: {},
678 RGB_888x: {},
679 BGRA_8888: {},
680 RGBA_1010102: {},
681 RGB_101010x: {},
682 Gray_8: {},
683 RGBA_F16: {},
684 RGBA_F32: {},
685 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500686
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 FillType: {
688 Winding: {},
689 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500690 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400691
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 FilterQuality: {
693 None: {},
694 Low: {},
695 Medium: {},
696 High: {},
697 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500698
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 FontSlant: {
700 Upright: {},
701 Italic: {},
702 Oblique: {},
703 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 FontHinting: {
706 None: {},
707 Slight: {},
708 Normal: {},
709 Full: {},
710 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500711
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500712 FontWeight: {
713 Invisible: {},
714 Thin: {},
715 ExtraLight: {},
716 Light: {},
717 Normal: {},
718 Medium: {},
719 SemiBold: {},
720 Bold: {},
721 ExtraBold: {},
722 Black: {},
723 ExtraBlack: {},
724 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 FontWidth: {
727 UltraCondensed: {},
728 ExtraCondensed: {},
729 Condensed: {},
730 SemiCondensed: {},
731 Normal: {},
732 SemiExpanded: {},
733 Expanded: {},
734 ExtraExpanded: {},
735 UltraExpanded: {},
736 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400737
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500738 ImageFormat: {
739 PNG: {},
740 JPEG: {},
741 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300742
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500743 PaintStyle: {
744 Fill: {},
745 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500746 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500747
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500748 PathOp: {
749 Difference: {},
750 Intersect: {},
751 Union: {},
752 XOR: {},
753 ReverseDifference: {},
754 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500755
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500756 PointMode: {
757 Points: {},
758 Lines: {},
759 Polygon: {},
760 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500761
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500762 RectHeightStyle: {
763 Tight: {},
764 Max: {},
765 IncludeLineSpacingMiddle: {},
766 IncludeLineSpacingTop: {},
767 IncludeLineSpacingBottom: {},
768 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400769
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500770 RectWidthStyle: {
771 Tight: {},
772 Max: {},
773 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400774
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500775 StrokeCap: {
776 Butt: {},
777 Round: {},
778 Square: {},
779 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500780
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500781 StrokeJoin: {
782 Miter: {},
783 Round: {},
784 Bevel: {},
785 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500786
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500787 TextAlign: {
788 Left: {},
789 Right: {},
790 Center: {},
791 Justify: {},
792 Start: {},
793 End: {},
794 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400795
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500796 TextDirection: {
797 LTR: {},
798 RTL: {},
799 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400800
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500801 TileMode: {
802 Clamp: {},
803 Repeat: {},
804 Mirror: {},
805 Decal: {},
806 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500807
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500808 VertexMode: {
809 Triangles: {},
810 TrianglesStrip: {},
811 TriangleFan: {},
812 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 /**
817 * @type {Float32Array}
818 */
819 HEAPF32: {},
820 /**
821 * @type {Float64Array}
822 */
823 HEAPF64: {},
824 /**
825 * @type {Uint8Array}
826 */
827 HEAPU8: {},
828 /**
829 * @type {Uint16Array}
830 */
831 HEAPU16: {},
832 /**
833 * @type {Uint32Array}
834 */
835 HEAPU32: {},
836 /**
837 * @type {Int8Array}
838 */
839 HEAP8: {},
840 /**
841 * @type {Int16Array}
842 */
843 HEAP16: {},
844 /**
845 * @type {Int32Array}
846 */
847 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400848
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500849 _malloc: function() {},
850 _free: function() {},
851 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400852};
Kevin Lubick217056c2018-09-20 17:39:31 -0400853
Kevin Lubick006a6f32018-10-19 14:34:34 -0400854// Public API things that are newly declared in the JS should go here.
855// It's not enough to declare them above, because closure can still erase them
856// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400857CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
858
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500859CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400860CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400861CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500862CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500863CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500864CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300865CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400866CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400867CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400868CanvasKit.SkPath.prototype.conicTo = function() {};
869CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400870CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400871CanvasKit.SkPath.prototype.lineTo = function() {};
872CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400873CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400874CanvasKit.SkPath.prototype.op = function() {};
875CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400876CanvasKit.SkPath.prototype.rArcTo = function() {};
877CanvasKit.SkPath.prototype.rConicTo = function() {};
878CanvasKit.SkPath.prototype.rCubicTo = function() {};
879CanvasKit.SkPath.prototype.rLineTo = function() {};
880CanvasKit.SkPath.prototype.rMoveTo = function() {};
881CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400882CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400883CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400884CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400885CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400886CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400887
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500888CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400889
Kevin Lubick5b90b842018-10-17 07:57:18 -0400890CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400891CanvasKit.SkSurface.prototype.flush = function() {};
892CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800893CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400894CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400895
Alexander Khovansky3e119332018-11-15 02:01:19 +0300896CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400897CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300898
Kevin Lubick6bffe392020-04-02 15:24:15 -0400899CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400900CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400901CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500902CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500903CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400904CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
905CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
906CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400907CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500908/** @return {Uint8Array} */
909CanvasKit.SkCanvas.prototype.readPixels = function() {};
910CanvasKit.SkCanvas.prototype.writePixels = function() {};
911
Kevin Lubickddd0a332018-12-12 10:35:13 -0500912CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
913
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400914CanvasKit.SkFont.prototype.getWidths = function() {};
915
916CanvasKit.RSXFormBuilder.prototype.build = function() {};
917CanvasKit.RSXFormBuilder.prototype.delete = function() {};
918CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400919CanvasKit.RSXFormBuilder.prototype.set = function() {};
920
921CanvasKit.SkColorBuilder.prototype.build = function() {};
922CanvasKit.SkColorBuilder.prototype.delete = function() {};
923CanvasKit.SkColorBuilder.prototype.push = function() {};
924CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400925
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500926CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500927CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500928
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500929CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
930CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
931
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400932// Define StrokeOpts object
933var StrokeOpts = {};
934StrokeOpts.prototype.width;
935StrokeOpts.prototype.miter_limit;
936StrokeOpts.prototype.cap;
937StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500938StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400939
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500940// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500941var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500942HTMLCanvas.prototype.decodeImage = function() {};
943HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500944HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500945HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500946HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500947HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500948
949var CanvasRenderingContext2D = {};
950CanvasRenderingContext2D.prototype.addHitRegion = function() {};
951CanvasRenderingContext2D.prototype.arc = function() {};
952CanvasRenderingContext2D.prototype.arcTo = function() {};
953CanvasRenderingContext2D.prototype.beginPath = function() {};
954CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
955CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500956CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500957CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500958CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500959CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500960CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500961CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500962CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500963CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500964CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500965CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500966CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500967CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500968CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500969CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500970CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500971CanvasRenderingContext2D.prototype.isPointInPath = function() {};
972CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500973CanvasRenderingContext2D.prototype.lineTo = function() {};
974CanvasRenderingContext2D.prototype.measureText = function() {};
975CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500976CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500977CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
978CanvasRenderingContext2D.prototype.rect = function() {};
979CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
980CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500981CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500982CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500983CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500984CanvasRenderingContext2D.prototype.scale = function() {};
985CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500986CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500987CanvasRenderingContext2D.prototype.setTransform = function() {};
988CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500989CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500990CanvasRenderingContext2D.prototype.strokeText = function() {};
991CanvasRenderingContext2D.prototype.transform = function() {};
992CanvasRenderingContext2D.prototype.translate = function() {};
993
Kevin Lubicka40f8322018-12-17 16:01:36 -0500994var Path2D = {};
995Path2D.prototype.addPath = function() {};
996Path2D.prototype.arc = function() {};
997Path2D.prototype.arcTo = function() {};
998Path2D.prototype.bezierCurveTo = function() {};
999Path2D.prototype.closePath = function() {};
1000Path2D.prototype.ellipse = function() {};
1001Path2D.prototype.lineTo = function() {};
1002Path2D.prototype.moveTo = function() {};
1003Path2D.prototype.quadraticCurveTo = function() {};
1004Path2D.prototype.rect = function() {};
1005
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001006var LinearCanvasGradient = {};
1007LinearCanvasGradient.prototype.addColorStop = function() {};
1008var RadialCanvasGradient = {};
1009RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001010var CanvasPattern = {};
1011CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001012
Kevin Lubick52b9f372018-12-04 13:57:36 -05001013var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001014 /**
1015 * @type {Uint8ClampedArray}
1016 */
1017 data: {},
1018 height: {},
1019 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001020};
1021
Kevin Lubickd29edd72018-12-07 08:29:52 -05001022var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001023 a: {},
1024 b: {},
1025 c: {},
1026 d: {},
1027 e: {},
1028 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001029};
1030
Kevin Lubick217056c2018-09-20 17:39:31 -04001031// 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 -05001032function loadWebAssemblyModule() {};