blob: 4e2603eb8145424eedff06ddca31971cd37befd5 [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() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700139 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400140 addText: function() {},
141 build: function() {},
142 pop: function() {},
143
144 prototype: {
145 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400146 pushPaintStyle: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400147 },
148
149 // private API
150 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700151 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400152 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400153 _pushPaintStyle: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400154 },
155
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500156 SkRuntimeEffect: {
157 // public API (from C++ bindings)
158 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500159
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500160 // private API
161 _makeShader: function() {},
162 _makeShaderWithChildren: function() {},
163 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500164
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500165 ParagraphStyle: function() {},
166 RSXFormBuilder: function() {},
167 SkColorBuilder: function() {},
168 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400169
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500170 ShapedText: {
171 // public API (from C++ bindings)
172 getBounds: function() {},
173 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500174
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500175 SkAnimatedImage: {
176 // public API (from C++ bindings)
177 decodeNextFrame: function() {},
178 getFrameCount: function() {},
179 getRepetitionCount: function() {},
180 height: function() {},
181 reset: function() {},
182 width: function() {},
183 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400184
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500185 SkCanvas: {
186 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 clipPath: function() {},
188 clipRRect: function() {},
189 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500190 drawAnimatedImage: function() {},
191 drawArc: function() {},
192 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400193 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500194 drawDRRect: function() {},
195 drawImage: function() {},
196 drawImageNine: function() {},
197 drawImageRect: function() {},
198 drawLine: function() {},
199 drawOval: function() {},
200 drawPaint: function() {},
201 drawParagraph: function() {},
202 drawPath: function() {},
203 drawPicture: function() {},
204 drawRRect: function() {},
205 drawRect: function() {},
206 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500207 drawText: function() {},
208 drawTextBlob: function() {},
209 drawVertices: function() {},
210 flush: function() {},
211 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500212 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400213 markCTM: function() {},
214 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500215 restore: function() {},
216 restoreToCount: function() {},
217 rotate: function() {},
218 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000219 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500220 scale: function() {},
221 skew: function() {},
222 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400223
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 prototype: {
225 clear: function() {},
226 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400227 drawColorComponents: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400228 drawShadow: function() {},
229 },
230
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500231 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400232 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400233 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500234 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400235 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500236 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400237 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500238 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400239 _getLocalToCamera: function() {},
240 _getLocalToDevice: function() {},
241 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400242 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400243 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500244 _readPixels: function() {},
245 _writePixels: function() {},
246 delete: function() {},
247 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400248
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500249 SkColorFilter: {
250 // public API (from C++ bindings and JS interface)
251 MakeBlend: function() {},
252 MakeCompose: function() {},
253 MakeLerp: function() {},
254 MakeLinearToSRGBGamma: function() {},
255 MakeMatrix: function() {},
256 MakeSRGBToLinearGamma: function() {},
257 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400258 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500259 _makeMatrix: function() {},
260 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400261
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500262 SkColorMatrix: {
263 concat: function() {},
264 identity: function() {},
265 postTranslate: function() {},
266 rotated: function() {},
267 scaled: function() {},
268 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400269
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400270 SkColorSpace: {
271 Equals: function() {},
272 SRGB: {},
273 DISPLAY_P3: {},
274 ADOBE_RGB: {},
275 // private API (from C++ bindings)
276 _MakeSRGB: function() {},
277 _MakeDisplayP3: function() {},
278 _MakeAdobeRGB: function() {},
279 },
280
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500281 SkContourMeasureIter: {
282 next: function() {},
283 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500284
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500285 SkContourMeasure: {
286 getPosTan: function() {},
287 getSegment: function() {},
288 isClosed: function() {},
289 length: function() {},
290 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500291
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500292 SkFont: {
293 // public API (from C++ bindings)
294 getScaleX: function() {},
295 getSize: function() {},
296 getSkewX: function() {},
297 getTypeface: function() {},
298 measureText: function() {},
299 setHinting: function() {},
300 setLinearMetrics: function() {},
301 setScaleX: function() {},
302 setSize: function() {},
303 setSkewX: function() {},
304 setSubpixel: function() {},
305 setTypeface: function() {},
306 // private API (from C++ bindings)
307 _getWidths: function() {},
308 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500309
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500310 SkFontMgr: {
311 // public API (from C++ and JS bindings)
312 FromData: function() {},
313 RefDefault: function() {},
314 countFamilies: function() {},
315 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500316
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500317 // private API
318 _makeTypefaceFromData: function() {},
319 _fromData: function() {},
320 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500321
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700322 TypefaceFontProvider: {
323 // public API (from C++ and JS bindings)
324 Make: function() {},
325 registerFont: function() {},
326
327 // private API
328 _registerFont: function() {},
329 },
330
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500331 SkImage: {
332 // public API (from C++ bindings)
333 height: function() {},
334 width: function() {},
335 // private API
336 _encodeToData: function() {},
337 _encodeToDataWithFormat: function() {},
338 _makeShader: function() {},
339 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400340
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500341 SkImageFilter: {
342 MakeBlur: function() {},
343 MakeColorFilter: function() {},
344 MakeCompose: function() {},
345 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400346
347 // private API
348 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500349 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400350
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500351 // These are defined in interface.js
352 SkM44: {
353 identity: function() {},
354 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400355 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500356 multiply: function() {},
357 rotatedUnitSinCos: function() {},
358 rotated: function() {},
359 scaled: function() {},
360 translated: function() {},
361 lookat: function() {},
362 perspective: function() {},
363 rc: function() {},
364 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400365 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500366 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500367
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500368 SkMatrix: {
369 identity: function() {},
370 invert: function() {},
371 mapPoints: function() {},
372 multiply: function() {},
373 rotated: function() {},
374 scaled: function() {},
375 skewed: function() {},
376 translated: function() {},
377 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500378
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500379 SkMaskFilter: {
380 MakeBlur: function() {},
381 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400382
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500383 SkPaint: {
384 // public API (from C++ bindings)
385 /** @return {CanvasKit.SkPaint} */
386 copy: function() {},
387 getBlendMode: function() {},
388 getColor: function() {},
389 getFilterQuality: function() {},
390 getStrokeCap: function() {},
391 getStrokeJoin: function() {},
392 getStrokeMiter: function() {},
393 getStrokeWidth: function() {},
394 setAntiAlias: function() {},
395 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400396 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 setFilterQuality: function() {},
398 setImageFilter: function() {},
399 setMaskFilter: function() {},
400 setPathEffect: function() {},
401 setShader: function() {},
402 setStrokeCap: function() {},
403 setStrokeJoin: function() {},
404 setStrokeMiter: function() {},
405 setStrokeWidth: function() {},
406 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500407
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400408 prototype: {
409 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400410 setColorComponents: function() {},
411 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400412 },
413
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500414 // Private API
415 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400416 _getColor: function() {},
417 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500418 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500419
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500420 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400421 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500422 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400423 MakeDiscrete: function() {},
424
425 // Private C++ API
426 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500427 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500428
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500429 SkParticleEffect: {
430 // public API (from C++ bindings)
431 draw: function() {},
432 getEffectUniform: function() {},
433 getEffectUniformCount: function() {},
434 getEffectUniformFloatCount: function() {},
435 getEffectUniformName: function() {},
436 getParticleUniformCount: function() {},
437 getParticleUniformFloatCount: function() {},
438 getParticleUniformName: function() {},
439 getParticleUniform: function() {},
440 setPosition: function() {},
441 setRate: function() {},
442 start: function() {},
443 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500444
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500445 // private API (from C++ bindings)
446 _effectUniformPtr: function() {},
447 _particleUniformPtr: function() {},
448 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500449
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500450 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400451 // public API (from C++ and JS bindings)
452 MakeFromCmds: function() {},
453 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500454 computeTightBounds: function() {},
455 contains: function() {},
456 /** @return {CanvasKit.SkPath} */
457 copy: function() {},
458 countPoints: function() {},
459 equals: function() {},
460 getBounds: function() {},
461 getFillType: function() {},
462 getPoint: function() {},
463 isEmpty: function() {},
464 isVolatile: function() {},
465 reset: function() {},
466 rewind: function() {},
467 setFillType: function() {},
468 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400469 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500470 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400471
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500472 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400473 _MakeFromCmds: function() {},
474 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500475 _addArc: function() {},
476 _addOval: function() {},
477 _addPath: function() {},
478 _addRect: function() {},
479 _addPoly: function() {},
480 _addRoundRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400481 _addVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500482 _arc: function() {},
483 _arcTo: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400484 _arcToOval: function() {},
485 _arcToTangent: function() {},
486 _arcToRotated: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500487 _close: function() {},
488 _conicTo: function() {},
489 _cubicTo: function() {},
490 _dash: function() {},
491 _lineTo: function() {},
492 _moveTo: function() {},
493 _op: function() {},
494 _quadTo: function() {},
495 _rArcTo: function() {},
496 _rConicTo: function() {},
497 _rCubicTo: function() {},
498 _rLineTo: function() {},
499 _rMoveTo: function() {},
500 _rQuadTo: function() {},
501 _rect: function() {},
502 _simplify: function() {},
503 _stroke: function() {},
504 _transform: function() {},
505 _trim: function() {},
506 delete: function() {},
507 dump: function() {},
508 dumpHex: function() {},
509 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400510
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500511 SkPathMeasure: {
512 getLength: function() {},
513 getSegment: function() {},
514 getPosTan: function() {},
515 isClosed: function() {},
516 nextContour: function() {},
517 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400518
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500519 SkPicture: {
520 serialize: function() {},
521 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400522
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500523 SkPictureRecorder: {
524 beginRecording: function() {},
525 finishRecordingAsPicture: function() {},
526 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400527
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500528 SkRect: {
529 fLeft: {},
530 fTop: {},
531 fRight: {},
532 fBottom: {},
533 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400534
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500535 SkRRect: {
536 rect: {},
537 rx1: {},
538 ry1: {},
539 rx2: {},
540 ry2: {},
541 rx3: {},
542 ry3: {},
543 rx4: {},
544 ry4: {},
545 },
Kevin Lubick62836902019-12-09 09:04:26 -0500546
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500547 SkShader: {
548 Blend: function() {},
549 Color: function() {},
550 Empty: function() {},
551 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400552 MakeLinearGradient: function() {},
553 MakeRadialGradient: function() {},
554 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700555 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400556
557 // private API (from C++ bindings)
558 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500559 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400560
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500561 SkSurface: {
562 // public API (from C++ bindings)
563 /** @return {CanvasKit.SkCanvas} */
564 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400565 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500566 /** @return {CanvasKit.SkImage} */
567 makeImageSnapshot: function() {},
568 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600569 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400570 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500571 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400572 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400573
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 // private API
575 _flush: function() {},
576 _getRasterN32PremulSurface: function() {},
577 delete: function() {},
578 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500579
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500580 SkTextBlob: {
581 // public API (both C++ and JS bindings)
582 MakeFromRSXform: function() {},
583 MakeFromText: function() {},
584 MakeOnPath: function() {},
585 // private API (from C++ bindings)
586 _MakeFromRSXform: function() {},
587 _MakeFromText: function() {},
588 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500589
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500590 // These are defined in interface.js
591 SkVector: {
592 add: function() {},
593 sub: function() {},
594 dot: function() {},
595 cross: function() {},
596 normalize: function() {},
597 mulScalar: function() {},
598 length: function() {},
599 lengthSquared: function() {},
600 dist: function() {},
601 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400602
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500603 SkVertices: {
604 // public API (from C++ bindings)
605 bounds: function() {},
606 mode: function() {},
607 uniqueID: function() {},
608 vertexCount: function() {},
609 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400610
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 _SkVerticesBuilder: {
612 colors: function() {},
613 detach: function() {},
614 indices: function() {},
615 positions: function() {},
616 texCoords: function() {},
617 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400618
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500619 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400620
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500621 // Constants and Enums
622 gpu: {},
623 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400624
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500625 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400626 BLACK: {},
627 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400629 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 BLUE: {},
631 YELLOW: {},
632 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400633 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500634
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500635 MOVE_VERB: {},
636 LINE_VERB: {},
637 QUAD_VERB: {},
638 CONIC_VERB: {},
639 CUBIC_VERB: {},
640 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500641
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500642 NoDecoration: {},
643 UnderlineDecoration: {},
644 OverlineDecoration: {},
645 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400646
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500647 SaveLayerInitWithPrevious: {},
648 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400649
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500650 Affinity: {
651 Upstream: {},
652 Downstream: {},
653 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400654
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500655 AlphaType: {
656 Opaque: {},
657 Premul: {},
658 Unpremul: {},
659 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500660
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 BlendMode: {
662 Clear: {},
663 Src: {},
664 Dst: {},
665 SrcOver: {},
666 DstOver: {},
667 SrcIn: {},
668 DstIn: {},
669 SrcOut: {},
670 DstOut: {},
671 SrcATop: {},
672 DstATop: {},
673 Xor: {},
674 Plus: {},
675 Modulate: {},
676 Screen: {},
677 Overlay: {},
678 Darken: {},
679 Lighten: {},
680 ColorDodge: {},
681 ColorBurn: {},
682 HardLight: {},
683 SoftLight: {},
684 Difference: {},
685 Exclusion: {},
686 Multiply: {},
687 Hue: {},
688 Saturation: {},
689 Color: {},
690 Luminosity: {},
691 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500692
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 BlurStyle: {
694 Normal: {},
695 Solid: {},
696 Outer: {},
697 Inner: {},
698 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 ClipOp: {
701 Difference: {},
702 Intersect: {},
703 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 ColorType: {
706 Alpha_8: {},
707 RGB_565: {},
708 ARGB_4444: {},
709 RGBA_8888: {},
710 RGB_888x: {},
711 BGRA_8888: {},
712 RGBA_1010102: {},
713 RGB_101010x: {},
714 Gray_8: {},
715 RGBA_F16: {},
716 RGBA_F32: {},
717 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500718
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500719 FillType: {
720 Winding: {},
721 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400723
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500724 FilterQuality: {
725 None: {},
726 Low: {},
727 Medium: {},
728 High: {},
729 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 FontSlant: {
732 Upright: {},
733 Italic: {},
734 Oblique: {},
735 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400736
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500737 FontHinting: {
738 None: {},
739 Slight: {},
740 Normal: {},
741 Full: {},
742 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500743
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500744 FontWeight: {
745 Invisible: {},
746 Thin: {},
747 ExtraLight: {},
748 Light: {},
749 Normal: {},
750 Medium: {},
751 SemiBold: {},
752 Bold: {},
753 ExtraBold: {},
754 Black: {},
755 ExtraBlack: {},
756 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400757
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500758 FontWidth: {
759 UltraCondensed: {},
760 ExtraCondensed: {},
761 Condensed: {},
762 SemiCondensed: {},
763 Normal: {},
764 SemiExpanded: {},
765 Expanded: {},
766 ExtraExpanded: {},
767 UltraExpanded: {},
768 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400769
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500770 ImageFormat: {
771 PNG: {},
772 JPEG: {},
773 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300774
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500775 PaintStyle: {
776 Fill: {},
777 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500778 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500779
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 PathOp: {
781 Difference: {},
782 Intersect: {},
783 Union: {},
784 XOR: {},
785 ReverseDifference: {},
786 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 PointMode: {
789 Points: {},
790 Lines: {},
791 Polygon: {},
792 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500793
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500794 RectHeightStyle: {
795 Tight: {},
796 Max: {},
797 IncludeLineSpacingMiddle: {},
798 IncludeLineSpacingTop: {},
799 IncludeLineSpacingBottom: {},
800 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 RectWidthStyle: {
803 Tight: {},
804 Max: {},
805 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400806
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500807 StrokeCap: {
808 Butt: {},
809 Round: {},
810 Square: {},
811 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500812
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500813 StrokeJoin: {
814 Miter: {},
815 Round: {},
816 Bevel: {},
817 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500818
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500819 TextAlign: {
820 Left: {},
821 Right: {},
822 Center: {},
823 Justify: {},
824 Start: {},
825 End: {},
826 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400827
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500828 TextDirection: {
829 LTR: {},
830 RTL: {},
831 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400832
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500833 TileMode: {
834 Clamp: {},
835 Repeat: {},
836 Mirror: {},
837 Decal: {},
838 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500839
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500840 VertexMode: {
841 Triangles: {},
842 TrianglesStrip: {},
843 TriangleFan: {},
844 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500845
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500846 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400847
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500848 /**
849 * @type {Float32Array}
850 */
851 HEAPF32: {},
852 /**
853 * @type {Float64Array}
854 */
855 HEAPF64: {},
856 /**
857 * @type {Uint8Array}
858 */
859 HEAPU8: {},
860 /**
861 * @type {Uint16Array}
862 */
863 HEAPU16: {},
864 /**
865 * @type {Uint32Array}
866 */
867 HEAPU32: {},
868 /**
869 * @type {Int8Array}
870 */
871 HEAP8: {},
872 /**
873 * @type {Int16Array}
874 */
875 HEAP16: {},
876 /**
877 * @type {Int32Array}
878 */
879 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400880
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500881 _malloc: function() {},
882 _free: function() {},
883 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400884};
Kevin Lubick217056c2018-09-20 17:39:31 -0400885
Kevin Lubick006a6f32018-10-19 14:34:34 -0400886// Public API things that are newly declared in the JS should go here.
887// It's not enough to declare them above, because closure can still erase them
888// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400889CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
890
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500891CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400892CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400893CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500894CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500895CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500896CanvasKit.SkPath.prototype.addRoundRect = function() {};
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400897CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300898CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400899CanvasKit.SkPath.prototype.arcTo = function() {};
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400900CanvasKit.SkPath.prototype.arcToOval = function() {};
901CanvasKit.SkPath.prototype.arcToTangent = function() {};
902CanvasKit.SkPath.prototype.arcToRotated = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400903CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400904CanvasKit.SkPath.prototype.conicTo = function() {};
905CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400906CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400907CanvasKit.SkPath.prototype.lineTo = function() {};
908CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400909CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400910CanvasKit.SkPath.prototype.op = function() {};
911CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400912CanvasKit.SkPath.prototype.rArcTo = function() {};
913CanvasKit.SkPath.prototype.rConicTo = function() {};
914CanvasKit.SkPath.prototype.rCubicTo = function() {};
915CanvasKit.SkPath.prototype.rLineTo = function() {};
916CanvasKit.SkPath.prototype.rMoveTo = function() {};
917CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400918CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400919CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400920CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400921CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400922CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400923
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500924CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400925
Kevin Lubick5b90b842018-10-17 07:57:18 -0400926CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400927CanvasKit.SkSurface.prototype.flush = function() {};
928CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800929CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400930CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400931
Alexander Khovansky3e119332018-11-15 02:01:19 +0300932CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400933CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300934
Kevin Lubick6bffe392020-04-02 15:24:15 -0400935CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400936CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400937CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500938CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500939CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400940CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
941CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
942CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400943CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500944/** @return {Uint8Array} */
945CanvasKit.SkCanvas.prototype.readPixels = function() {};
946CanvasKit.SkCanvas.prototype.writePixels = function() {};
947
Kevin Lubickddd0a332018-12-12 10:35:13 -0500948CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
949
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400950CanvasKit.SkFont.prototype.getWidths = function() {};
951
952CanvasKit.RSXFormBuilder.prototype.build = function() {};
953CanvasKit.RSXFormBuilder.prototype.delete = function() {};
954CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400955CanvasKit.RSXFormBuilder.prototype.set = function() {};
956
957CanvasKit.SkColorBuilder.prototype.build = function() {};
958CanvasKit.SkColorBuilder.prototype.delete = function() {};
959CanvasKit.SkColorBuilder.prototype.push = function() {};
960CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400961
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500962CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500963CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500964
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500965CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
966CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
967
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400968// Define StrokeOpts object
969var StrokeOpts = {};
970StrokeOpts.prototype.width;
971StrokeOpts.prototype.miter_limit;
972StrokeOpts.prototype.cap;
973StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500974StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400975
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500976// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500977var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500978HTMLCanvas.prototype.decodeImage = function() {};
979HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500980HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500981HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500982HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500983HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500984
Elliot Evans28796192020-06-15 12:53:27 -0600985var ImageBitmapRenderingContext = {};
986ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
987
Kevin Lubickb9db3902018-11-26 11:47:54 -0500988var CanvasRenderingContext2D = {};
989CanvasRenderingContext2D.prototype.addHitRegion = function() {};
990CanvasRenderingContext2D.prototype.arc = function() {};
991CanvasRenderingContext2D.prototype.arcTo = function() {};
992CanvasRenderingContext2D.prototype.beginPath = function() {};
993CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
994CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500995CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500996CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500997CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500998CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500999CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001000CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001001CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001002CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001003CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001004CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001005CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001006CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001007CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001008CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001009CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001010CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1011CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001012CanvasRenderingContext2D.prototype.lineTo = function() {};
1013CanvasRenderingContext2D.prototype.measureText = function() {};
1014CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001015CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001016CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1017CanvasRenderingContext2D.prototype.rect = function() {};
1018CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1019CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001020CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001021CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001022CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001023CanvasRenderingContext2D.prototype.scale = function() {};
1024CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001025CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001026CanvasRenderingContext2D.prototype.setTransform = function() {};
1027CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001028CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001029CanvasRenderingContext2D.prototype.strokeText = function() {};
1030CanvasRenderingContext2D.prototype.transform = function() {};
1031CanvasRenderingContext2D.prototype.translate = function() {};
1032
Kevin Lubicka40f8322018-12-17 16:01:36 -05001033var Path2D = {};
1034Path2D.prototype.addPath = function() {};
1035Path2D.prototype.arc = function() {};
1036Path2D.prototype.arcTo = function() {};
1037Path2D.prototype.bezierCurveTo = function() {};
1038Path2D.prototype.closePath = function() {};
1039Path2D.prototype.ellipse = function() {};
1040Path2D.prototype.lineTo = function() {};
1041Path2D.prototype.moveTo = function() {};
1042Path2D.prototype.quadraticCurveTo = function() {};
1043Path2D.prototype.rect = function() {};
1044
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001045var LinearCanvasGradient = {};
1046LinearCanvasGradient.prototype.addColorStop = function() {};
1047var RadialCanvasGradient = {};
1048RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001049var CanvasPattern = {};
1050CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001051
Kevin Lubick52b9f372018-12-04 13:57:36 -05001052var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001053 /**
1054 * @type {Uint8ClampedArray}
1055 */
1056 data: {},
1057 height: {},
1058 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001059};
1060
Kevin Lubickd29edd72018-12-07 08:29:52 -05001061var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001062 a: {},
1063 b: {},
1064 c: {},
1065 d: {},
1066 e: {},
1067 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001068};
1069
Kevin Lubick217056c2018-09-20 17:39:31 -04001070// 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 -05001071function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001072
1073// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1074// to override it in the puppeteer tests
1075var LibraryEGL = {
1076 contextAttributes: {
1077 majorVersion: {}
1078 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001079}