blob: d6aef73bed398820e8ca900cc123e4d2c7221c94 [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() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400145 pushPaintStyle: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400146 },
147
148 // private API
149 _Make: function() {},
150 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400151 _pushPaintStyle: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400152 },
153
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500154 SkRuntimeEffect: {
155 // public API (from C++ bindings)
156 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500157
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500158 // private API
159 _makeShader: function() {},
160 _makeShaderWithChildren: function() {},
161 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500162
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500163 ParagraphStyle: function() {},
164 RSXFormBuilder: function() {},
165 SkColorBuilder: function() {},
166 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400167
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500168 ShapedText: {
169 // public API (from C++ bindings)
170 getBounds: function() {},
171 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500172
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500173 SkAnimatedImage: {
174 // public API (from C++ bindings)
175 decodeNextFrame: function() {},
176 getFrameCount: function() {},
177 getRepetitionCount: function() {},
178 height: function() {},
179 reset: function() {},
180 width: function() {},
181 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400182
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500183 SkCanvas: {
184 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500185 clipPath: function() {},
186 clipRRect: function() {},
187 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500188 drawAnimatedImage: function() {},
189 drawArc: function() {},
190 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400191 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500192 drawDRRect: function() {},
193 drawImage: function() {},
194 drawImageNine: function() {},
195 drawImageRect: function() {},
196 drawLine: function() {},
197 drawOval: function() {},
198 drawPaint: function() {},
199 drawParagraph: function() {},
200 drawPath: function() {},
201 drawPicture: function() {},
202 drawRRect: function() {},
203 drawRect: function() {},
204 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 drawText: function() {},
206 drawTextBlob: function() {},
207 drawVertices: function() {},
208 flush: function() {},
209 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500210 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400211 markCTM: function() {},
212 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 restore: function() {},
214 restoreToCount: function() {},
215 rotate: function() {},
216 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000217 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500218 scale: function() {},
219 skew: function() {},
220 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400221
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400222 prototype: {
223 clear: function() {},
224 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400225 drawColorComponents: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400226 drawShadow: function() {},
227 },
228
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500229 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400230 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400231 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500232 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400233 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500234 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400235 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500236 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400237 _getLocalToCamera: function() {},
238 _getLocalToDevice: function() {},
239 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400240 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400241 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500242 _readPixels: function() {},
243 _writePixels: function() {},
244 delete: function() {},
245 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400246
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500247 SkColorFilter: {
248 // public API (from C++ bindings and JS interface)
249 MakeBlend: function() {},
250 MakeCompose: function() {},
251 MakeLerp: function() {},
252 MakeLinearToSRGBGamma: function() {},
253 MakeMatrix: function() {},
254 MakeSRGBToLinearGamma: function() {},
255 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400256 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500257 _makeMatrix: function() {},
258 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400259
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500260 SkColorMatrix: {
261 concat: function() {},
262 identity: function() {},
263 postTranslate: function() {},
264 rotated: function() {},
265 scaled: function() {},
266 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400267
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400268 SkColorSpace: {
269 Equals: function() {},
270 SRGB: {},
271 DISPLAY_P3: {},
272 ADOBE_RGB: {},
273 // private API (from C++ bindings)
274 _MakeSRGB: function() {},
275 _MakeDisplayP3: function() {},
276 _MakeAdobeRGB: function() {},
277 },
278
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500279 SkContourMeasureIter: {
280 next: function() {},
281 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500282
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500283 SkContourMeasure: {
284 getPosTan: function() {},
285 getSegment: function() {},
286 isClosed: function() {},
287 length: function() {},
288 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500289
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500290 SkFont: {
291 // public API (from C++ bindings)
292 getScaleX: function() {},
293 getSize: function() {},
294 getSkewX: function() {},
295 getTypeface: function() {},
296 measureText: function() {},
297 setHinting: function() {},
298 setLinearMetrics: function() {},
299 setScaleX: function() {},
300 setSize: function() {},
301 setSkewX: function() {},
302 setSubpixel: function() {},
303 setTypeface: function() {},
304 // private API (from C++ bindings)
305 _getWidths: function() {},
306 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500307
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500308 SkFontMgr: {
309 // public API (from C++ and JS bindings)
310 FromData: function() {},
311 RefDefault: function() {},
312 countFamilies: function() {},
313 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500314
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500315 // private API
316 _makeTypefaceFromData: function() {},
317 _fromData: function() {},
318 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500319
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500320 SkImage: {
321 // public API (from C++ bindings)
322 height: function() {},
323 width: function() {},
324 // private API
325 _encodeToData: function() {},
326 _encodeToDataWithFormat: function() {},
327 _makeShader: function() {},
328 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400329
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500330 SkImageFilter: {
331 MakeBlur: function() {},
332 MakeColorFilter: function() {},
333 MakeCompose: function() {},
334 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400335
336 // private API
337 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500338 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400339
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500340 // These are defined in interface.js
341 SkM44: {
342 identity: function() {},
343 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400344 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500345 multiply: function() {},
346 rotatedUnitSinCos: function() {},
347 rotated: function() {},
348 scaled: function() {},
349 translated: function() {},
350 lookat: function() {},
351 perspective: function() {},
352 rc: function() {},
353 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400354 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500355 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500356
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500357 SkMatrix: {
358 identity: function() {},
359 invert: function() {},
360 mapPoints: function() {},
361 multiply: function() {},
362 rotated: function() {},
363 scaled: function() {},
364 skewed: function() {},
365 translated: function() {},
366 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500367
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500368 SkMaskFilter: {
369 MakeBlur: function() {},
370 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400371
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500372 SkPaint: {
373 // public API (from C++ bindings)
374 /** @return {CanvasKit.SkPaint} */
375 copy: function() {},
376 getBlendMode: function() {},
377 getColor: function() {},
378 getFilterQuality: function() {},
379 getStrokeCap: function() {},
380 getStrokeJoin: function() {},
381 getStrokeMiter: function() {},
382 getStrokeWidth: function() {},
383 setAntiAlias: function() {},
384 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400385 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500386 setFilterQuality: function() {},
387 setImageFilter: function() {},
388 setMaskFilter: function() {},
389 setPathEffect: function() {},
390 setShader: function() {},
391 setStrokeCap: function() {},
392 setStrokeJoin: function() {},
393 setStrokeMiter: function() {},
394 setStrokeWidth: function() {},
395 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500396
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400397 prototype: {
398 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400399 setColorComponents: function() {},
400 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400401 },
402
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500403 // Private API
404 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400405 _getColor: function() {},
406 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500408
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500409 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400410 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500411 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400412 MakeDiscrete: function() {},
413
414 // Private C++ API
415 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500416 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500417
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500418 SkParticleEffect: {
419 // public API (from C++ bindings)
420 draw: function() {},
421 getEffectUniform: function() {},
422 getEffectUniformCount: function() {},
423 getEffectUniformFloatCount: function() {},
424 getEffectUniformName: function() {},
425 getParticleUniformCount: function() {},
426 getParticleUniformFloatCount: function() {},
427 getParticleUniformName: function() {},
428 getParticleUniform: function() {},
429 setPosition: function() {},
430 setRate: function() {},
431 start: function() {},
432 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500433
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500434 // private API (from C++ bindings)
435 _effectUniformPtr: function() {},
436 _particleUniformPtr: function() {},
437 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500438
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500439 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400440 // public API (from C++ and JS bindings)
441 MakeFromCmds: function() {},
442 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500443 computeTightBounds: function() {},
444 contains: function() {},
445 /** @return {CanvasKit.SkPath} */
446 copy: function() {},
447 countPoints: function() {},
448 equals: function() {},
449 getBounds: function() {},
450 getFillType: function() {},
451 getPoint: function() {},
452 isEmpty: function() {},
453 isVolatile: function() {},
454 reset: function() {},
455 rewind: function() {},
456 setFillType: function() {},
457 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400458 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500459 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400460
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500461 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400462 _MakeFromCmds: function() {},
463 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500464 _addArc: function() {},
465 _addOval: function() {},
466 _addPath: function() {},
467 _addRect: function() {},
468 _addPoly: function() {},
469 _addRoundRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400470 _addVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500471 _arc: function() {},
472 _arcTo: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400473 _arcToOval: function() {},
474 _arcToTangent: function() {},
475 _arcToRotated: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500476 _close: function() {},
477 _conicTo: function() {},
478 _cubicTo: function() {},
479 _dash: function() {},
480 _lineTo: function() {},
481 _moveTo: function() {},
482 _op: function() {},
483 _quadTo: function() {},
484 _rArcTo: function() {},
485 _rConicTo: function() {},
486 _rCubicTo: function() {},
487 _rLineTo: function() {},
488 _rMoveTo: function() {},
489 _rQuadTo: function() {},
490 _rect: function() {},
491 _simplify: function() {},
492 _stroke: function() {},
493 _transform: function() {},
494 _trim: function() {},
495 delete: function() {},
496 dump: function() {},
497 dumpHex: function() {},
498 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400499
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500500 SkPathMeasure: {
501 getLength: function() {},
502 getSegment: function() {},
503 getPosTan: function() {},
504 isClosed: function() {},
505 nextContour: function() {},
506 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400507
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500508 SkPicture: {
509 serialize: function() {},
510 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400511
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 SkPictureRecorder: {
513 beginRecording: function() {},
514 finishRecordingAsPicture: function() {},
515 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400516
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500517 SkRect: {
518 fLeft: {},
519 fTop: {},
520 fRight: {},
521 fBottom: {},
522 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400523
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500524 SkRRect: {
525 rect: {},
526 rx1: {},
527 ry1: {},
528 rx2: {},
529 ry2: {},
530 rx3: {},
531 ry3: {},
532 rx4: {},
533 ry4: {},
534 },
Kevin Lubick62836902019-12-09 09:04:26 -0500535
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500536 SkShader: {
537 Blend: function() {},
538 Color: function() {},
539 Empty: function() {},
540 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400541 MakeLinearGradient: function() {},
542 MakeRadialGradient: function() {},
543 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700544 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400545
546 // private API (from C++ bindings)
547 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400549
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500550 SkSurface: {
551 // public API (from C++ bindings)
552 /** @return {CanvasKit.SkCanvas} */
553 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400554 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500555 /** @return {CanvasKit.SkImage} */
556 makeImageSnapshot: function() {},
557 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600558 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400559 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500560 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400561 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400562
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500563 // private API
564 _flush: function() {},
565 _getRasterN32PremulSurface: function() {},
566 delete: function() {},
567 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500568
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500569 SkTextBlob: {
570 // public API (both C++ and JS bindings)
571 MakeFromRSXform: function() {},
572 MakeFromText: function() {},
573 MakeOnPath: function() {},
574 // private API (from C++ bindings)
575 _MakeFromRSXform: function() {},
576 _MakeFromText: function() {},
577 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500578
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500579 // These are defined in interface.js
580 SkVector: {
581 add: function() {},
582 sub: function() {},
583 dot: function() {},
584 cross: function() {},
585 normalize: function() {},
586 mulScalar: function() {},
587 length: function() {},
588 lengthSquared: function() {},
589 dist: function() {},
590 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400591
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500592 SkVertices: {
593 // public API (from C++ bindings)
594 bounds: function() {},
595 mode: function() {},
596 uniqueID: function() {},
597 vertexCount: function() {},
598 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400599
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500600 _SkVerticesBuilder: {
601 colors: function() {},
602 detach: function() {},
603 indices: function() {},
604 positions: function() {},
605 texCoords: function() {},
606 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400607
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400609
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500610 // Constants and Enums
611 gpu: {},
612 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400613
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500614 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400615 BLACK: {},
616 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400618 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500619 BLUE: {},
620 YELLOW: {},
621 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400622 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500623
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500624 MOVE_VERB: {},
625 LINE_VERB: {},
626 QUAD_VERB: {},
627 CONIC_VERB: {},
628 CUBIC_VERB: {},
629 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500630
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 NoDecoration: {},
632 UnderlineDecoration: {},
633 OverlineDecoration: {},
634 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 SaveLayerInitWithPrevious: {},
637 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400638
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500639 Affinity: {
640 Upstream: {},
641 Downstream: {},
642 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400643
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 AlphaType: {
645 Opaque: {},
646 Premul: {},
647 Unpremul: {},
648 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500649
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500650 BlendMode: {
651 Clear: {},
652 Src: {},
653 Dst: {},
654 SrcOver: {},
655 DstOver: {},
656 SrcIn: {},
657 DstIn: {},
658 SrcOut: {},
659 DstOut: {},
660 SrcATop: {},
661 DstATop: {},
662 Xor: {},
663 Plus: {},
664 Modulate: {},
665 Screen: {},
666 Overlay: {},
667 Darken: {},
668 Lighten: {},
669 ColorDodge: {},
670 ColorBurn: {},
671 HardLight: {},
672 SoftLight: {},
673 Difference: {},
674 Exclusion: {},
675 Multiply: {},
676 Hue: {},
677 Saturation: {},
678 Color: {},
679 Luminosity: {},
680 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500681
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500682 BlurStyle: {
683 Normal: {},
684 Solid: {},
685 Outer: {},
686 Inner: {},
687 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500688
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500689 ClipOp: {
690 Difference: {},
691 Intersect: {},
692 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500693
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500694 ColorType: {
695 Alpha_8: {},
696 RGB_565: {},
697 ARGB_4444: {},
698 RGBA_8888: {},
699 RGB_888x: {},
700 BGRA_8888: {},
701 RGBA_1010102: {},
702 RGB_101010x: {},
703 Gray_8: {},
704 RGBA_F16: {},
705 RGBA_F32: {},
706 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500707
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 FillType: {
709 Winding: {},
710 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 FilterQuality: {
714 None: {},
715 Low: {},
716 Medium: {},
717 High: {},
718 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500719
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500720 FontSlant: {
721 Upright: {},
722 Italic: {},
723 Oblique: {},
724 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 FontHinting: {
727 None: {},
728 Slight: {},
729 Normal: {},
730 Full: {},
731 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500732
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 FontWeight: {
734 Invisible: {},
735 Thin: {},
736 ExtraLight: {},
737 Light: {},
738 Normal: {},
739 Medium: {},
740 SemiBold: {},
741 Bold: {},
742 ExtraBold: {},
743 Black: {},
744 ExtraBlack: {},
745 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400746
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500747 FontWidth: {
748 UltraCondensed: {},
749 ExtraCondensed: {},
750 Condensed: {},
751 SemiCondensed: {},
752 Normal: {},
753 SemiExpanded: {},
754 Expanded: {},
755 ExtraExpanded: {},
756 UltraExpanded: {},
757 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400758
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500759 ImageFormat: {
760 PNG: {},
761 JPEG: {},
762 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300763
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500764 PaintStyle: {
765 Fill: {},
766 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500767 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500768
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500769 PathOp: {
770 Difference: {},
771 Intersect: {},
772 Union: {},
773 XOR: {},
774 ReverseDifference: {},
775 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500776
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500777 PointMode: {
778 Points: {},
779 Lines: {},
780 Polygon: {},
781 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 RectHeightStyle: {
784 Tight: {},
785 Max: {},
786 IncludeLineSpacingMiddle: {},
787 IncludeLineSpacingTop: {},
788 IncludeLineSpacingBottom: {},
789 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400790
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500791 RectWidthStyle: {
792 Tight: {},
793 Max: {},
794 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400795
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500796 StrokeCap: {
797 Butt: {},
798 Round: {},
799 Square: {},
800 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 StrokeJoin: {
803 Miter: {},
804 Round: {},
805 Bevel: {},
806 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500807
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500808 TextAlign: {
809 Left: {},
810 Right: {},
811 Center: {},
812 Justify: {},
813 Start: {},
814 End: {},
815 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400816
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500817 TextDirection: {
818 LTR: {},
819 RTL: {},
820 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400821
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500822 TileMode: {
823 Clamp: {},
824 Repeat: {},
825 Mirror: {},
826 Decal: {},
827 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500828
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500829 VertexMode: {
830 Triangles: {},
831 TrianglesStrip: {},
832 TriangleFan: {},
833 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500834
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500835 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400836
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500837 /**
838 * @type {Float32Array}
839 */
840 HEAPF32: {},
841 /**
842 * @type {Float64Array}
843 */
844 HEAPF64: {},
845 /**
846 * @type {Uint8Array}
847 */
848 HEAPU8: {},
849 /**
850 * @type {Uint16Array}
851 */
852 HEAPU16: {},
853 /**
854 * @type {Uint32Array}
855 */
856 HEAPU32: {},
857 /**
858 * @type {Int8Array}
859 */
860 HEAP8: {},
861 /**
862 * @type {Int16Array}
863 */
864 HEAP16: {},
865 /**
866 * @type {Int32Array}
867 */
868 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400869
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500870 _malloc: function() {},
871 _free: function() {},
872 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400873};
Kevin Lubick217056c2018-09-20 17:39:31 -0400874
Kevin Lubick006a6f32018-10-19 14:34:34 -0400875// Public API things that are newly declared in the JS should go here.
876// It's not enough to declare them above, because closure can still erase them
877// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400878CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
879
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500880CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400881CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400882CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500883CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500884CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500885CanvasKit.SkPath.prototype.addRoundRect = function() {};
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400886CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300887CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400888CanvasKit.SkPath.prototype.arcTo = function() {};
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400889CanvasKit.SkPath.prototype.arcToOval = function() {};
890CanvasKit.SkPath.prototype.arcToTangent = function() {};
891CanvasKit.SkPath.prototype.arcToRotated = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400892CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400893CanvasKit.SkPath.prototype.conicTo = function() {};
894CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400895CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400896CanvasKit.SkPath.prototype.lineTo = function() {};
897CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400898CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400899CanvasKit.SkPath.prototype.op = function() {};
900CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400901CanvasKit.SkPath.prototype.rArcTo = function() {};
902CanvasKit.SkPath.prototype.rConicTo = function() {};
903CanvasKit.SkPath.prototype.rCubicTo = function() {};
904CanvasKit.SkPath.prototype.rLineTo = function() {};
905CanvasKit.SkPath.prototype.rMoveTo = function() {};
906CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400907CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400908CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400909CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400910CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400911CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400912
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500913CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400914
Kevin Lubick5b90b842018-10-17 07:57:18 -0400915CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400916CanvasKit.SkSurface.prototype.flush = function() {};
917CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800918CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400919CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400920
Alexander Khovansky3e119332018-11-15 02:01:19 +0300921CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400922CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300923
Kevin Lubick6bffe392020-04-02 15:24:15 -0400924CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400925CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400926CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500927CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500928CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400929CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
930CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
931CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400932CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500933/** @return {Uint8Array} */
934CanvasKit.SkCanvas.prototype.readPixels = function() {};
935CanvasKit.SkCanvas.prototype.writePixels = function() {};
936
Kevin Lubickddd0a332018-12-12 10:35:13 -0500937CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
938
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400939CanvasKit.SkFont.prototype.getWidths = function() {};
940
941CanvasKit.RSXFormBuilder.prototype.build = function() {};
942CanvasKit.RSXFormBuilder.prototype.delete = function() {};
943CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400944CanvasKit.RSXFormBuilder.prototype.set = function() {};
945
946CanvasKit.SkColorBuilder.prototype.build = function() {};
947CanvasKit.SkColorBuilder.prototype.delete = function() {};
948CanvasKit.SkColorBuilder.prototype.push = function() {};
949CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400950
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500951CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500952CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500953
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500954CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
955CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
956
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400957// Define StrokeOpts object
958var StrokeOpts = {};
959StrokeOpts.prototype.width;
960StrokeOpts.prototype.miter_limit;
961StrokeOpts.prototype.cap;
962StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500963StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400964
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500965// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500966var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500967HTMLCanvas.prototype.decodeImage = function() {};
968HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500969HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500970HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500971HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500972HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500973
Elliot Evans28796192020-06-15 12:53:27 -0600974var ImageBitmapRenderingContext = {};
975ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
976
Kevin Lubickb9db3902018-11-26 11:47:54 -0500977var CanvasRenderingContext2D = {};
978CanvasRenderingContext2D.prototype.addHitRegion = function() {};
979CanvasRenderingContext2D.prototype.arc = function() {};
980CanvasRenderingContext2D.prototype.arcTo = function() {};
981CanvasRenderingContext2D.prototype.beginPath = function() {};
982CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
983CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500984CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500985CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500986CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500987CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500988CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500989CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500990CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500991CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500992CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500993CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500994CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500995CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500996CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500997CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500998CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500999CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1000CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001001CanvasRenderingContext2D.prototype.lineTo = function() {};
1002CanvasRenderingContext2D.prototype.measureText = function() {};
1003CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001004CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001005CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1006CanvasRenderingContext2D.prototype.rect = function() {};
1007CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1008CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001009CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001010CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001011CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001012CanvasRenderingContext2D.prototype.scale = function() {};
1013CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001014CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001015CanvasRenderingContext2D.prototype.setTransform = function() {};
1016CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001017CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001018CanvasRenderingContext2D.prototype.strokeText = function() {};
1019CanvasRenderingContext2D.prototype.transform = function() {};
1020CanvasRenderingContext2D.prototype.translate = function() {};
1021
Kevin Lubicka40f8322018-12-17 16:01:36 -05001022var Path2D = {};
1023Path2D.prototype.addPath = function() {};
1024Path2D.prototype.arc = function() {};
1025Path2D.prototype.arcTo = function() {};
1026Path2D.prototype.bezierCurveTo = function() {};
1027Path2D.prototype.closePath = function() {};
1028Path2D.prototype.ellipse = function() {};
1029Path2D.prototype.lineTo = function() {};
1030Path2D.prototype.moveTo = function() {};
1031Path2D.prototype.quadraticCurveTo = function() {};
1032Path2D.prototype.rect = function() {};
1033
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001034var LinearCanvasGradient = {};
1035LinearCanvasGradient.prototype.addColorStop = function() {};
1036var RadialCanvasGradient = {};
1037RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001038var CanvasPattern = {};
1039CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001040
Kevin Lubick52b9f372018-12-04 13:57:36 -05001041var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001042 /**
1043 * @type {Uint8ClampedArray}
1044 */
1045 data: {},
1046 height: {},
1047 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001048};
1049
Kevin Lubickd29edd72018-12-07 08:29:52 -05001050var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001051 a: {},
1052 b: {},
1053 c: {},
1054 d: {},
1055 e: {},
1056 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001057};
1058
Kevin Lubick217056c2018-09-20 17:39:31 -04001059// 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 -05001060function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001061
1062// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1063// to override it in the puppeteer tests
1064var LibraryEGL = {
1065 contextAttributes: {
1066 majorVersion: {}
1067 }
1068}