blob: 70e96c7d0c0d8d661c46c6946bdf4b70c0847091 [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() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400471 _arcToOval: function() {},
472 _arcToTangent: function() {},
473 _arcToRotated: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500474 _close: function() {},
475 _conicTo: function() {},
476 _cubicTo: function() {},
477 _dash: function() {},
478 _lineTo: function() {},
479 _moveTo: function() {},
480 _op: function() {},
481 _quadTo: function() {},
482 _rArcTo: function() {},
483 _rConicTo: function() {},
484 _rCubicTo: function() {},
485 _rLineTo: function() {},
486 _rMoveTo: function() {},
487 _rQuadTo: function() {},
488 _rect: function() {},
489 _simplify: function() {},
490 _stroke: function() {},
491 _transform: function() {},
492 _trim: function() {},
493 delete: function() {},
494 dump: function() {},
495 dumpHex: function() {},
496 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400497
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500498 SkPathMeasure: {
499 getLength: function() {},
500 getSegment: function() {},
501 getPosTan: function() {},
502 isClosed: function() {},
503 nextContour: function() {},
504 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400505
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500506 SkPicture: {
507 serialize: function() {},
508 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400509
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500510 SkPictureRecorder: {
511 beginRecording: function() {},
512 finishRecordingAsPicture: function() {},
513 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400514
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500515 SkRect: {
516 fLeft: {},
517 fTop: {},
518 fRight: {},
519 fBottom: {},
520 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400521
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500522 SkRRect: {
523 rect: {},
524 rx1: {},
525 ry1: {},
526 rx2: {},
527 ry2: {},
528 rx3: {},
529 ry3: {},
530 rx4: {},
531 ry4: {},
532 },
Kevin Lubick62836902019-12-09 09:04:26 -0500533
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500534 SkShader: {
535 Blend: function() {},
536 Color: function() {},
537 Empty: function() {},
538 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400539 MakeLinearGradient: function() {},
540 MakeRadialGradient: function() {},
541 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700542 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400543
544 // private API (from C++ bindings)
545 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500546 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400547
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 SkSurface: {
549 // public API (from C++ bindings)
550 /** @return {CanvasKit.SkCanvas} */
551 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400552 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500553 /** @return {CanvasKit.SkImage} */
554 makeImageSnapshot: function() {},
555 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600556 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400557 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500558 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400559
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500560 // private API
561 _flush: function() {},
562 _getRasterN32PremulSurface: function() {},
563 delete: function() {},
564 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500565
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500566 SkTextBlob: {
567 // public API (both C++ and JS bindings)
568 MakeFromRSXform: function() {},
569 MakeFromText: function() {},
570 MakeOnPath: function() {},
571 // private API (from C++ bindings)
572 _MakeFromRSXform: function() {},
573 _MakeFromText: function() {},
574 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500575
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500576 // These are defined in interface.js
577 SkVector: {
578 add: function() {},
579 sub: function() {},
580 dot: function() {},
581 cross: function() {},
582 normalize: function() {},
583 mulScalar: function() {},
584 length: function() {},
585 lengthSquared: function() {},
586 dist: function() {},
587 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400588
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500589 SkVertices: {
590 // public API (from C++ bindings)
591 bounds: function() {},
592 mode: function() {},
593 uniqueID: function() {},
594 vertexCount: function() {},
595 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400596
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500597 _SkVerticesBuilder: {
598 colors: function() {},
599 detach: function() {},
600 indices: function() {},
601 positions: function() {},
602 texCoords: function() {},
603 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400604
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500605 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400606
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 // Constants and Enums
608 gpu: {},
609 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400610
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400612 BLACK: {},
613 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500614 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400615 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500616 BLUE: {},
617 YELLOW: {},
618 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400619 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500620
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500621 MOVE_VERB: {},
622 LINE_VERB: {},
623 QUAD_VERB: {},
624 CONIC_VERB: {},
625 CUBIC_VERB: {},
626 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500627
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 NoDecoration: {},
629 UnderlineDecoration: {},
630 OverlineDecoration: {},
631 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400632
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 SaveLayerInitWithPrevious: {},
634 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 Affinity: {
637 Upstream: {},
638 Downstream: {},
639 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400640
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 AlphaType: {
642 Opaque: {},
643 Premul: {},
644 Unpremul: {},
645 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500646
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500647 BlendMode: {
648 Clear: {},
649 Src: {},
650 Dst: {},
651 SrcOver: {},
652 DstOver: {},
653 SrcIn: {},
654 DstIn: {},
655 SrcOut: {},
656 DstOut: {},
657 SrcATop: {},
658 DstATop: {},
659 Xor: {},
660 Plus: {},
661 Modulate: {},
662 Screen: {},
663 Overlay: {},
664 Darken: {},
665 Lighten: {},
666 ColorDodge: {},
667 ColorBurn: {},
668 HardLight: {},
669 SoftLight: {},
670 Difference: {},
671 Exclusion: {},
672 Multiply: {},
673 Hue: {},
674 Saturation: {},
675 Color: {},
676 Luminosity: {},
677 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500678
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 BlurStyle: {
680 Normal: {},
681 Solid: {},
682 Outer: {},
683 Inner: {},
684 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500685
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500686 ClipOp: {
687 Difference: {},
688 Intersect: {},
689 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500690
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500691 ColorType: {
692 Alpha_8: {},
693 RGB_565: {},
694 ARGB_4444: {},
695 RGBA_8888: {},
696 RGB_888x: {},
697 BGRA_8888: {},
698 RGBA_1010102: {},
699 RGB_101010x: {},
700 Gray_8: {},
701 RGBA_F16: {},
702 RGBA_F32: {},
703 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 FillType: {
706 Winding: {},
707 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400709
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500710 FilterQuality: {
711 None: {},
712 Low: {},
713 Medium: {},
714 High: {},
715 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500716
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500717 FontSlant: {
718 Upright: {},
719 Italic: {},
720 Oblique: {},
721 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400722
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500723 FontHinting: {
724 None: {},
725 Slight: {},
726 Normal: {},
727 Full: {},
728 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 FontWeight: {
731 Invisible: {},
732 Thin: {},
733 ExtraLight: {},
734 Light: {},
735 Normal: {},
736 Medium: {},
737 SemiBold: {},
738 Bold: {},
739 ExtraBold: {},
740 Black: {},
741 ExtraBlack: {},
742 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400743
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500744 FontWidth: {
745 UltraCondensed: {},
746 ExtraCondensed: {},
747 Condensed: {},
748 SemiCondensed: {},
749 Normal: {},
750 SemiExpanded: {},
751 Expanded: {},
752 ExtraExpanded: {},
753 UltraExpanded: {},
754 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400755
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500756 ImageFormat: {
757 PNG: {},
758 JPEG: {},
759 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300760
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500761 PaintStyle: {
762 Fill: {},
763 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500764 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500765
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500766 PathOp: {
767 Difference: {},
768 Intersect: {},
769 Union: {},
770 XOR: {},
771 ReverseDifference: {},
772 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500773
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500774 PointMode: {
775 Points: {},
776 Lines: {},
777 Polygon: {},
778 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500779
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 RectHeightStyle: {
781 Tight: {},
782 Max: {},
783 IncludeLineSpacingMiddle: {},
784 IncludeLineSpacingTop: {},
785 IncludeLineSpacingBottom: {},
786 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 RectWidthStyle: {
789 Tight: {},
790 Max: {},
791 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400792
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500793 StrokeCap: {
794 Butt: {},
795 Round: {},
796 Square: {},
797 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500798
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500799 StrokeJoin: {
800 Miter: {},
801 Round: {},
802 Bevel: {},
803 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500804
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500805 TextAlign: {
806 Left: {},
807 Right: {},
808 Center: {},
809 Justify: {},
810 Start: {},
811 End: {},
812 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 TextDirection: {
815 LTR: {},
816 RTL: {},
817 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400818
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500819 TileMode: {
820 Clamp: {},
821 Repeat: {},
822 Mirror: {},
823 Decal: {},
824 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500825
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500826 VertexMode: {
827 Triangles: {},
828 TrianglesStrip: {},
829 TriangleFan: {},
830 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500831
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500832 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400833
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500834 /**
835 * @type {Float32Array}
836 */
837 HEAPF32: {},
838 /**
839 * @type {Float64Array}
840 */
841 HEAPF64: {},
842 /**
843 * @type {Uint8Array}
844 */
845 HEAPU8: {},
846 /**
847 * @type {Uint16Array}
848 */
849 HEAPU16: {},
850 /**
851 * @type {Uint32Array}
852 */
853 HEAPU32: {},
854 /**
855 * @type {Int8Array}
856 */
857 HEAP8: {},
858 /**
859 * @type {Int16Array}
860 */
861 HEAP16: {},
862 /**
863 * @type {Int32Array}
864 */
865 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400866
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500867 _malloc: function() {},
868 _free: function() {},
869 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400870};
Kevin Lubick217056c2018-09-20 17:39:31 -0400871
Kevin Lubick006a6f32018-10-19 14:34:34 -0400872// Public API things that are newly declared in the JS should go here.
873// It's not enough to declare them above, because closure can still erase them
874// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400875CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
876
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500877CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400878CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400879CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500880CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500881CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500882CanvasKit.SkPath.prototype.addRoundRect = function() {};
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400883CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300884CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400885CanvasKit.SkPath.prototype.arcTo = function() {};
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400886CanvasKit.SkPath.prototype.arcToOval = function() {};
887CanvasKit.SkPath.prototype.arcToTangent = function() {};
888CanvasKit.SkPath.prototype.arcToRotated = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400889CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400890CanvasKit.SkPath.prototype.conicTo = function() {};
891CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400892CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400893CanvasKit.SkPath.prototype.lineTo = function() {};
894CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400895CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400896CanvasKit.SkPath.prototype.op = function() {};
897CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400898CanvasKit.SkPath.prototype.rArcTo = function() {};
899CanvasKit.SkPath.prototype.rConicTo = function() {};
900CanvasKit.SkPath.prototype.rCubicTo = function() {};
901CanvasKit.SkPath.prototype.rLineTo = function() {};
902CanvasKit.SkPath.prototype.rMoveTo = function() {};
903CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400904CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400905CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400906CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400907CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400908CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400909
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500910CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400911
Kevin Lubick5b90b842018-10-17 07:57:18 -0400912CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400913CanvasKit.SkSurface.prototype.flush = function() {};
914CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800915CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400916CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400917
Alexander Khovansky3e119332018-11-15 02:01:19 +0300918CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400919CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300920
Kevin Lubick6bffe392020-04-02 15:24:15 -0400921CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400922CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400923CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500924CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500925CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400926CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
927CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
928CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400929CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500930/** @return {Uint8Array} */
931CanvasKit.SkCanvas.prototype.readPixels = function() {};
932CanvasKit.SkCanvas.prototype.writePixels = function() {};
933
Kevin Lubickddd0a332018-12-12 10:35:13 -0500934CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
935
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400936CanvasKit.SkFont.prototype.getWidths = function() {};
937
938CanvasKit.RSXFormBuilder.prototype.build = function() {};
939CanvasKit.RSXFormBuilder.prototype.delete = function() {};
940CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400941CanvasKit.RSXFormBuilder.prototype.set = function() {};
942
943CanvasKit.SkColorBuilder.prototype.build = function() {};
944CanvasKit.SkColorBuilder.prototype.delete = function() {};
945CanvasKit.SkColorBuilder.prototype.push = function() {};
946CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400947
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500948CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500949CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500950
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500951CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
952CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
953
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400954// Define StrokeOpts object
955var StrokeOpts = {};
956StrokeOpts.prototype.width;
957StrokeOpts.prototype.miter_limit;
958StrokeOpts.prototype.cap;
959StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500960StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400961
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500962// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500963var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500964HTMLCanvas.prototype.decodeImage = function() {};
965HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500966HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500967HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500968HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500969HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500970
Elliot Evans28796192020-06-15 12:53:27 -0600971var ImageBitmapRenderingContext = {};
972ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
973
Kevin Lubickb9db3902018-11-26 11:47:54 -0500974var CanvasRenderingContext2D = {};
975CanvasRenderingContext2D.prototype.addHitRegion = function() {};
976CanvasRenderingContext2D.prototype.arc = function() {};
977CanvasRenderingContext2D.prototype.arcTo = function() {};
978CanvasRenderingContext2D.prototype.beginPath = function() {};
979CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
980CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500981CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500982CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500983CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500984CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500985CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500986CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500987CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500988CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500989CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500990CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500991CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500992CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500993CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500994CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500995CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500996CanvasRenderingContext2D.prototype.isPointInPath = function() {};
997CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500998CanvasRenderingContext2D.prototype.lineTo = function() {};
999CanvasRenderingContext2D.prototype.measureText = function() {};
1000CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001001CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001002CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1003CanvasRenderingContext2D.prototype.rect = function() {};
1004CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1005CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001006CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001007CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001008CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001009CanvasRenderingContext2D.prototype.scale = function() {};
1010CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001011CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001012CanvasRenderingContext2D.prototype.setTransform = function() {};
1013CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001014CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001015CanvasRenderingContext2D.prototype.strokeText = function() {};
1016CanvasRenderingContext2D.prototype.transform = function() {};
1017CanvasRenderingContext2D.prototype.translate = function() {};
1018
Kevin Lubicka40f8322018-12-17 16:01:36 -05001019var Path2D = {};
1020Path2D.prototype.addPath = function() {};
1021Path2D.prototype.arc = function() {};
1022Path2D.prototype.arcTo = function() {};
1023Path2D.prototype.bezierCurveTo = function() {};
1024Path2D.prototype.closePath = function() {};
1025Path2D.prototype.ellipse = function() {};
1026Path2D.prototype.lineTo = function() {};
1027Path2D.prototype.moveTo = function() {};
1028Path2D.prototype.quadraticCurveTo = function() {};
1029Path2D.prototype.rect = function() {};
1030
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001031var LinearCanvasGradient = {};
1032LinearCanvasGradient.prototype.addColorStop = function() {};
1033var RadialCanvasGradient = {};
1034RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001035var CanvasPattern = {};
1036CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001037
Kevin Lubick52b9f372018-12-04 13:57:36 -05001038var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001039 /**
1040 * @type {Uint8ClampedArray}
1041 */
1042 data: {},
1043 height: {},
1044 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001045};
1046
Kevin Lubickd29edd72018-12-07 08:29:52 -05001047var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001048 a: {},
1049 b: {},
1050 c: {},
1051 d: {},
1052 e: {},
1053 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001054};
1055
Kevin Lubick217056c2018-09-20 17:39:31 -04001056// 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 -05001057function loadWebAssemblyModule() {};