blob: 0a88787c028dc0f88722a1ff7e104562e7ef6a8d [file] [log] [blame]
Kevin Lubick217056c2018-09-20 17:39:31 -04001/*
2 * This externs file prevents the Closure JS compiler from minifying away
3 * names of objects created by Emscripten.
4 * Basically, by defining empty objects and functions here, Closure will
5 * know not to rename them. This is needed because of our pre-js files,
6 * that is, the JS we hand-write to bundle into the output. That JS will be
7 * hit by the closure compiler and thus needs to know about what functions
8 * have special names and should not be minified.
9 *
10 * Emscripten does not support automatically generating an externs file, so we
11 * do it by hand. The general process is to write some JS code, and then put any
12 * calls to CanvasKit or related things in here. Running ./compile.sh and then
13 * looking at the minified results or running the Release trybot should
14 * verify nothing was missed. Optionally, looking directly at the minified
15 * pathkit.js can be useful when developing locally.
16 *
17 * Docs:
18 * https://github.com/cljsjs/packages/wiki/Creating-Externs
19 * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
20 *
21 * Example externs:
22 * https://github.com/google/closure-compiler/tree/master/externs
23 */
24
25var CanvasKit = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
27 Color: function() {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -040028 Color4f: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -040029 ColorAsInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050030 /** @return {CanvasKit.SkRect} */
31 LTRBRect: function() {},
32 /** @return {CanvasKit.SkRect} */
33 XYWHRect: function() {},
34 /** @return {CanvasKit.SkRRect} */
35 RRectXY: function() {},
36 /** @return {ImageData} */
37 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050038
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050039 GetWebGLContext: function() {},
40 MakeBlurMaskFilter: function() {},
41 MakeCanvas: function() {},
42 MakeCanvasSurface: function() {},
43 MakeGrContext: function() {},
44 /** @return {CanvasKit.SkAnimatedImage} */
45 MakeAnimatedImageFromEncoded: function() {},
46 /** @return {CanvasKit.SkImage} */
47 MakeImage: function() {},
48 /** @return {CanvasKit.SkImage} */
49 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060050 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050051 MakeOnScreenGLSurface: function() {},
52 MakePathFromCmds: function() {},
53 MakePathFromOp: function() {},
54 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050055 MakeRenderTarget: function() {},
56 MakeSkPicture: function() {},
57 MakeSWCanvasSurface: function() {},
58 MakeManagedAnimation: function() {},
59 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 MakeSkVertices: function() {},
61 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 MakeWebGLCanvasSurface: function() {},
63 /** @return {TypedArray} */
64 Malloc: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040065 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050066 computeTonalColors: function() {},
67 currentContext: function() {},
68 getColorComponents: function() {},
69 getDecodeCacheLimitBytes: function() {},
70 getDecodeCacheUsageBytes: function() {},
71 getSkDataBytes: function() {},
72 multiplyByAlpha: function() {},
73 parseColorString: function() {},
74 setCurrentContext: function() {},
75 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040076
Kevin Lubicke70af512020-05-14 14:50:54 -040077 // Defined by emscripten.
78 createContext:function() {},
79
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 // private API (i.e. things declared in the bindings that we use
81 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040082 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050083 _MakeImage: function() {},
84 _MakeLinearGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050085 _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() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400342 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500343 multiply: function() {},
344 rotatedUnitSinCos: function() {},
345 rotated: function() {},
346 scaled: function() {},
347 translated: function() {},
348 lookat: function() {},
349 perspective: function() {},
350 rc: function() {},
351 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400352 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500353 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500354
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500355 SkMatrix: {
356 identity: function() {},
357 invert: function() {},
358 mapPoints: function() {},
359 multiply: function() {},
360 rotated: function() {},
361 scaled: function() {},
362 skewed: function() {},
363 translated: function() {},
364 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500365
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500366 SkMaskFilter: {
367 MakeBlur: function() {},
368 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400369
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500370 SkPaint: {
371 // public API (from C++ bindings)
372 /** @return {CanvasKit.SkPaint} */
373 copy: function() {},
374 getBlendMode: function() {},
375 getColor: function() {},
376 getFilterQuality: function() {},
377 getStrokeCap: function() {},
378 getStrokeJoin: function() {},
379 getStrokeMiter: function() {},
380 getStrokeWidth: function() {},
381 setAntiAlias: function() {},
382 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400383 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500384 setFilterQuality: function() {},
385 setImageFilter: function() {},
386 setMaskFilter: function() {},
387 setPathEffect: function() {},
388 setShader: function() {},
389 setStrokeCap: function() {},
390 setStrokeJoin: function() {},
391 setStrokeMiter: function() {},
392 setStrokeWidth: function() {},
393 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500394
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400395 prototype: {
396 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400397 setColorComponents: function() {},
398 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400399 },
400
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500401 // Private API
402 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400403 _getColor: function() {},
404 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500405 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500406
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400408 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500409 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400410 MakeDiscrete: function() {},
411
412 // Private C++ API
413 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500414 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500415
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500416 SkParticleEffect: {
417 // public API (from C++ bindings)
418 draw: function() {},
419 getEffectUniform: function() {},
420 getEffectUniformCount: function() {},
421 getEffectUniformFloatCount: function() {},
422 getEffectUniformName: function() {},
423 getParticleUniformCount: function() {},
424 getParticleUniformFloatCount: function() {},
425 getParticleUniformName: function() {},
426 getParticleUniform: function() {},
427 setPosition: function() {},
428 setRate: function() {},
429 start: function() {},
430 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500431
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500432 // private API (from C++ bindings)
433 _effectUniformPtr: function() {},
434 _particleUniformPtr: function() {},
435 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500436
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500437 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400438 // public API (from C++ and JS bindings)
439 MakeFromCmds: function() {},
440 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500441 computeTightBounds: function() {},
442 contains: function() {},
443 /** @return {CanvasKit.SkPath} */
444 copy: function() {},
445 countPoints: function() {},
446 equals: function() {},
447 getBounds: function() {},
448 getFillType: function() {},
449 getPoint: function() {},
450 isEmpty: function() {},
451 isVolatile: function() {},
452 reset: function() {},
453 rewind: function() {},
454 setFillType: function() {},
455 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400456 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500457 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400458
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500459 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400460 _MakeFromCmds: function() {},
461 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500462 _addArc: function() {},
463 _addOval: function() {},
464 _addPath: function() {},
465 _addRect: function() {},
466 _addPoly: function() {},
467 _addRoundRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400468 _addVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500469 _arc: function() {},
470 _arcTo: function() {},
471 _close: function() {},
472 _conicTo: function() {},
473 _cubicTo: function() {},
474 _dash: function() {},
475 _lineTo: function() {},
476 _moveTo: function() {},
477 _op: function() {},
478 _quadTo: function() {},
479 _rArcTo: function() {},
480 _rConicTo: function() {},
481 _rCubicTo: function() {},
482 _rLineTo: function() {},
483 _rMoveTo: function() {},
484 _rQuadTo: function() {},
485 _rect: function() {},
486 _simplify: function() {},
487 _stroke: function() {},
488 _transform: function() {},
489 _trim: function() {},
490 delete: function() {},
491 dump: function() {},
492 dumpHex: function() {},
493 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400494
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500495 SkPathMeasure: {
496 getLength: function() {},
497 getSegment: function() {},
498 getPosTan: function() {},
499 isClosed: function() {},
500 nextContour: function() {},
501 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400502
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500503 SkPicture: {
504 serialize: function() {},
505 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400506
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500507 SkPictureRecorder: {
508 beginRecording: function() {},
509 finishRecordingAsPicture: function() {},
510 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400511
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 SkRect: {
513 fLeft: {},
514 fTop: {},
515 fRight: {},
516 fBottom: {},
517 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400518
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500519 SkRRect: {
520 rect: {},
521 rx1: {},
522 ry1: {},
523 rx2: {},
524 ry2: {},
525 rx3: {},
526 ry3: {},
527 rx4: {},
528 ry4: {},
529 },
Kevin Lubick62836902019-12-09 09:04:26 -0500530
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500531 SkShader: {
532 Blend: function() {},
533 Color: function() {},
534 Empty: function() {},
535 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400536 MakeLinearGradient: function() {},
537 MakeRadialGradient: function() {},
538 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700539 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400540
541 // private API (from C++ bindings)
542 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500543 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400544
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500545 SkSurface: {
546 // public API (from C++ bindings)
547 /** @return {CanvasKit.SkCanvas} */
548 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400549 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500550 /** @return {CanvasKit.SkImage} */
551 makeImageSnapshot: function() {},
552 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600553 sampleCnt: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400554 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500555 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400556
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500557 // private API
558 _flush: function() {},
559 _getRasterN32PremulSurface: function() {},
560 delete: function() {},
561 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500562
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500563 SkTextBlob: {
564 // public API (both C++ and JS bindings)
565 MakeFromRSXform: function() {},
566 MakeFromText: function() {},
567 MakeOnPath: function() {},
568 // private API (from C++ bindings)
569 _MakeFromRSXform: function() {},
570 _MakeFromText: function() {},
571 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500572
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500573 // These are defined in interface.js
574 SkVector: {
575 add: function() {},
576 sub: function() {},
577 dot: function() {},
578 cross: function() {},
579 normalize: function() {},
580 mulScalar: function() {},
581 length: function() {},
582 lengthSquared: function() {},
583 dist: function() {},
584 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400585
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 SkVertices: {
587 // public API (from C++ bindings)
588 bounds: function() {},
589 mode: function() {},
590 uniqueID: function() {},
591 vertexCount: function() {},
592 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400593
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500594 _SkVerticesBuilder: {
595 colors: function() {},
596 detach: function() {},
597 indices: function() {},
598 positions: function() {},
599 texCoords: function() {},
600 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400601
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400603
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 // Constants and Enums
605 gpu: {},
606 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400607
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400609 BLACK: {},
610 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400612 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500613 BLUE: {},
614 YELLOW: {},
615 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400616 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500617
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 MOVE_VERB: {},
619 LINE_VERB: {},
620 QUAD_VERB: {},
621 CONIC_VERB: {},
622 CUBIC_VERB: {},
623 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500624
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500625 NoDecoration: {},
626 UnderlineDecoration: {},
627 OverlineDecoration: {},
628 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400629
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 SaveLayerInitWithPrevious: {},
631 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400632
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 Affinity: {
634 Upstream: {},
635 Downstream: {},
636 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400637
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500638 AlphaType: {
639 Opaque: {},
640 Premul: {},
641 Unpremul: {},
642 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500643
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 BlendMode: {
645 Clear: {},
646 Src: {},
647 Dst: {},
648 SrcOver: {},
649 DstOver: {},
650 SrcIn: {},
651 DstIn: {},
652 SrcOut: {},
653 DstOut: {},
654 SrcATop: {},
655 DstATop: {},
656 Xor: {},
657 Plus: {},
658 Modulate: {},
659 Screen: {},
660 Overlay: {},
661 Darken: {},
662 Lighten: {},
663 ColorDodge: {},
664 ColorBurn: {},
665 HardLight: {},
666 SoftLight: {},
667 Difference: {},
668 Exclusion: {},
669 Multiply: {},
670 Hue: {},
671 Saturation: {},
672 Color: {},
673 Luminosity: {},
674 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500675
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 BlurStyle: {
677 Normal: {},
678 Solid: {},
679 Outer: {},
680 Inner: {},
681 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500682
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 ClipOp: {
684 Difference: {},
685 Intersect: {},
686 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500687
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500688 ColorType: {
689 Alpha_8: {},
690 RGB_565: {},
691 ARGB_4444: {},
692 RGBA_8888: {},
693 RGB_888x: {},
694 BGRA_8888: {},
695 RGBA_1010102: {},
696 RGB_101010x: {},
697 Gray_8: {},
698 RGBA_F16: {},
699 RGBA_F32: {},
700 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500701
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500702 FillType: {
703 Winding: {},
704 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400706
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500707 FilterQuality: {
708 None: {},
709 Low: {},
710 Medium: {},
711 High: {},
712 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500713
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500714 FontSlant: {
715 Upright: {},
716 Italic: {},
717 Oblique: {},
718 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400719
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500720 FontHinting: {
721 None: {},
722 Slight: {},
723 Normal: {},
724 Full: {},
725 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500726
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500727 FontWeight: {
728 Invisible: {},
729 Thin: {},
730 ExtraLight: {},
731 Light: {},
732 Normal: {},
733 Medium: {},
734 SemiBold: {},
735 Bold: {},
736 ExtraBold: {},
737 Black: {},
738 ExtraBlack: {},
739 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400740
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500741 FontWidth: {
742 UltraCondensed: {},
743 ExtraCondensed: {},
744 Condensed: {},
745 SemiCondensed: {},
746 Normal: {},
747 SemiExpanded: {},
748 Expanded: {},
749 ExtraExpanded: {},
750 UltraExpanded: {},
751 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400752
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500753 ImageFormat: {
754 PNG: {},
755 JPEG: {},
756 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300757
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500758 PaintStyle: {
759 Fill: {},
760 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500761 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500762
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500763 PathOp: {
764 Difference: {},
765 Intersect: {},
766 Union: {},
767 XOR: {},
768 ReverseDifference: {},
769 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500770
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500771 PointMode: {
772 Points: {},
773 Lines: {},
774 Polygon: {},
775 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500776
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500777 RectHeightStyle: {
778 Tight: {},
779 Max: {},
780 IncludeLineSpacingMiddle: {},
781 IncludeLineSpacingTop: {},
782 IncludeLineSpacingBottom: {},
783 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400784
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500785 RectWidthStyle: {
786 Tight: {},
787 Max: {},
788 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400789
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500790 StrokeCap: {
791 Butt: {},
792 Round: {},
793 Square: {},
794 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500795
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500796 StrokeJoin: {
797 Miter: {},
798 Round: {},
799 Bevel: {},
800 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 TextAlign: {
803 Left: {},
804 Right: {},
805 Center: {},
806 Justify: {},
807 Start: {},
808 End: {},
809 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400810
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500811 TextDirection: {
812 LTR: {},
813 RTL: {},
814 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 TileMode: {
817 Clamp: {},
818 Repeat: {},
819 Mirror: {},
820 Decal: {},
821 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500822
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500823 VertexMode: {
824 Triangles: {},
825 TrianglesStrip: {},
826 TriangleFan: {},
827 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500828
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500829 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400830
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500831 /**
832 * @type {Float32Array}
833 */
834 HEAPF32: {},
835 /**
836 * @type {Float64Array}
837 */
838 HEAPF64: {},
839 /**
840 * @type {Uint8Array}
841 */
842 HEAPU8: {},
843 /**
844 * @type {Uint16Array}
845 */
846 HEAPU16: {},
847 /**
848 * @type {Uint32Array}
849 */
850 HEAPU32: {},
851 /**
852 * @type {Int8Array}
853 */
854 HEAP8: {},
855 /**
856 * @type {Int16Array}
857 */
858 HEAP16: {},
859 /**
860 * @type {Int32Array}
861 */
862 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400863
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500864 _malloc: function() {},
865 _free: function() {},
866 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400867};
Kevin Lubick217056c2018-09-20 17:39:31 -0400868
Kevin Lubick006a6f32018-10-19 14:34:34 -0400869// Public API things that are newly declared in the JS should go here.
870// It's not enough to declare them above, because closure can still erase them
871// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400872CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
873
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500874CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400875CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400876CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500877CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500878CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500879CanvasKit.SkPath.prototype.addRoundRect = function() {};
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400880CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300881CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400882CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400883CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400884CanvasKit.SkPath.prototype.conicTo = function() {};
885CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400886CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400887CanvasKit.SkPath.prototype.lineTo = function() {};
888CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400889CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400890CanvasKit.SkPath.prototype.op = function() {};
891CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400892CanvasKit.SkPath.prototype.rArcTo = function() {};
893CanvasKit.SkPath.prototype.rConicTo = function() {};
894CanvasKit.SkPath.prototype.rCubicTo = function() {};
895CanvasKit.SkPath.prototype.rLineTo = function() {};
896CanvasKit.SkPath.prototype.rMoveTo = function() {};
897CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400898CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400899CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400900CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400901CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400902CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400903
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500904CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400905
Kevin Lubick5b90b842018-10-17 07:57:18 -0400906CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400907CanvasKit.SkSurface.prototype.flush = function() {};
908CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800909CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400910CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400911
Alexander Khovansky3e119332018-11-15 02:01:19 +0300912CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400913CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300914
Kevin Lubick6bffe392020-04-02 15:24:15 -0400915CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400916CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400917CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500918CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500919CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400920CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
921CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
922CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400923CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500924/** @return {Uint8Array} */
925CanvasKit.SkCanvas.prototype.readPixels = function() {};
926CanvasKit.SkCanvas.prototype.writePixels = function() {};
927
Kevin Lubickddd0a332018-12-12 10:35:13 -0500928CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
929
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400930CanvasKit.SkFont.prototype.getWidths = function() {};
931
932CanvasKit.RSXFormBuilder.prototype.build = function() {};
933CanvasKit.RSXFormBuilder.prototype.delete = function() {};
934CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400935CanvasKit.RSXFormBuilder.prototype.set = function() {};
936
937CanvasKit.SkColorBuilder.prototype.build = function() {};
938CanvasKit.SkColorBuilder.prototype.delete = function() {};
939CanvasKit.SkColorBuilder.prototype.push = function() {};
940CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400941
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500942CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500943CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500944
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500945CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
946CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
947
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400948// Define StrokeOpts object
949var StrokeOpts = {};
950StrokeOpts.prototype.width;
951StrokeOpts.prototype.miter_limit;
952StrokeOpts.prototype.cap;
953StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500954StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400955
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500956// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500957var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500958HTMLCanvas.prototype.decodeImage = function() {};
959HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500960HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500961HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500962HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500963HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500964
Elliot Evans28796192020-06-15 12:53:27 -0600965var ImageBitmapRenderingContext = {};
966ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
967
Kevin Lubickb9db3902018-11-26 11:47:54 -0500968var CanvasRenderingContext2D = {};
969CanvasRenderingContext2D.prototype.addHitRegion = function() {};
970CanvasRenderingContext2D.prototype.arc = function() {};
971CanvasRenderingContext2D.prototype.arcTo = function() {};
972CanvasRenderingContext2D.prototype.beginPath = function() {};
973CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
974CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500975CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500976CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500977CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500978CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500979CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500980CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500981CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500982CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500983CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500984CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500985CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500986CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500987CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500988CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500989CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500990CanvasRenderingContext2D.prototype.isPointInPath = function() {};
991CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500992CanvasRenderingContext2D.prototype.lineTo = function() {};
993CanvasRenderingContext2D.prototype.measureText = function() {};
994CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500995CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500996CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
997CanvasRenderingContext2D.prototype.rect = function() {};
998CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
999CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001000CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001001CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001002CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001003CanvasRenderingContext2D.prototype.scale = function() {};
1004CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001005CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001006CanvasRenderingContext2D.prototype.setTransform = function() {};
1007CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001008CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001009CanvasRenderingContext2D.prototype.strokeText = function() {};
1010CanvasRenderingContext2D.prototype.transform = function() {};
1011CanvasRenderingContext2D.prototype.translate = function() {};
1012
Kevin Lubicka40f8322018-12-17 16:01:36 -05001013var Path2D = {};
1014Path2D.prototype.addPath = function() {};
1015Path2D.prototype.arc = function() {};
1016Path2D.prototype.arcTo = function() {};
1017Path2D.prototype.bezierCurveTo = function() {};
1018Path2D.prototype.closePath = function() {};
1019Path2D.prototype.ellipse = function() {};
1020Path2D.prototype.lineTo = function() {};
1021Path2D.prototype.moveTo = function() {};
1022Path2D.prototype.quadraticCurveTo = function() {};
1023Path2D.prototype.rect = function() {};
1024
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001025var LinearCanvasGradient = {};
1026LinearCanvasGradient.prototype.addColorStop = function() {};
1027var RadialCanvasGradient = {};
1028RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001029var CanvasPattern = {};
1030CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001031
Kevin Lubick52b9f372018-12-04 13:57:36 -05001032var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001033 /**
1034 * @type {Uint8ClampedArray}
1035 */
1036 data: {},
1037 height: {},
1038 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001039};
1040
Kevin Lubickd29edd72018-12-07 08:29:52 -05001041var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001042 a: {},
1043 b: {},
1044 c: {},
1045 d: {},
1046 e: {},
1047 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001048};
1049
Kevin Lubick217056c2018-09-20 17:39:31 -04001050// 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 -05001051function loadWebAssemblyModule() {};