blob: e70d8c7224913b9765a950e77e9f3c27e5e9f2b9 [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() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +000030 /** @return {CanvasKit.SkRect} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050031 LTRBRect: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +000032 /** @return {CanvasKit.SkRect} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050033 XYWHRect: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +000034 /** @return {CanvasKit.SkRRect} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050035 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: {
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000171 // public API (from C++ bindings)
172 getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500173 },
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() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000188 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500189 drawAnimatedImage: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000190 drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500191 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400192 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500193 drawImage: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000194 drawImageNine: function() {},
195 drawImageRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 drawLine: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000197 drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 drawPaint: function() {},
199 drawParagraph: function() {},
200 drawPath: function() {},
201 drawPicture: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000202 drawRect: function() {},
203 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 drawText: function() {},
205 drawTextBlob: function() {},
206 drawVertices: function() {},
207 flush: function() {},
208 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500209 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400210 markCTM: function() {},
211 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500212 restore: function() {},
213 restoreToCount: function() {},
214 rotate: function() {},
215 save: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000216 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 scale: function() {},
218 skew: function() {},
219 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400220
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400221 prototype: {
222 clear: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400223 clipRRect: function() {},
224 concat44: function() {}, // deprecated
225 concat: function() {},
226 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400227 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400228 drawColorComponents: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400229 drawDRRect: function() {},
230 drawPoints: function() {},
231 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400232 drawShadow: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400233 drawText: function() {},
234 findMarkedCTM: function() {},
235 getLocalToDevice: function() {},
236 getTotalMatrix: function() {},
237 readPixels: function() {},
238 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400239 },
240
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500241 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400242 _clear: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400243 _clipRRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400244 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500245 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400246 _drawColor: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400247 _drawDRRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500248 _drawPoints: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400249 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400250 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500251 _drawSimpleText: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400252 _findMarkedCTM: function() {},
Kevin Lubickc9498ef2020-09-02 15:20:00 -0400253 _getLocalToDevice: function() {},
254 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500255 _readPixels: function() {},
256 _writePixels: function() {},
257 delete: function() {},
258 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400259
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500260 SkColorFilter: {
261 // public API (from C++ bindings and JS interface)
262 MakeBlend: function() {},
263 MakeCompose: function() {},
264 MakeLerp: function() {},
265 MakeLinearToSRGBGamma: function() {},
266 MakeMatrix: function() {},
267 MakeSRGBToLinearGamma: function() {},
268 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400269 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500270 _makeMatrix: function() {},
271 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400272
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500273 SkColorMatrix: {
274 concat: function() {},
275 identity: function() {},
276 postTranslate: function() {},
277 rotated: function() {},
278 scaled: function() {},
279 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400280
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400281 SkColorSpace: {
282 Equals: function() {},
283 SRGB: {},
284 DISPLAY_P3: {},
285 ADOBE_RGB: {},
286 // private API (from C++ bindings)
287 _MakeSRGB: function() {},
288 _MakeDisplayP3: function() {},
289 _MakeAdobeRGB: function() {},
290 },
291
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500292 SkContourMeasureIter: {
293 next: function() {},
294 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500295
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500296 SkContourMeasure: {
297 getPosTan: function() {},
298 getSegment: function() {},
299 isClosed: function() {},
300 length: function() {},
301 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500302
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500303 SkFont: {
304 // public API (from C++ bindings)
305 getScaleX: function() {},
306 getSize: function() {},
307 getSkewX: function() {},
308 getTypeface: function() {},
309 measureText: function() {},
310 setHinting: function() {},
311 setLinearMetrics: function() {},
312 setScaleX: function() {},
313 setSize: function() {},
314 setSkewX: function() {},
315 setSubpixel: function() {},
316 setTypeface: function() {},
317 // private API (from C++ bindings)
318 _getWidths: function() {},
319 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500320
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500321 SkFontMgr: {
322 // public API (from C++ and JS bindings)
323 FromData: function() {},
324 RefDefault: function() {},
325 countFamilies: function() {},
326 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500327
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500328 // private API
329 _makeTypefaceFromData: function() {},
330 _fromData: function() {},
331 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500332
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700333 TypefaceFontProvider: {
334 // public API (from C++ and JS bindings)
335 Make: function() {},
336 registerFont: function() {},
337
338 // private API
339 _registerFont: function() {},
340 },
341
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500342 SkImage: {
343 // public API (from C++ bindings)
344 height: function() {},
345 width: function() {},
346 // private API
347 _encodeToData: function() {},
348 _encodeToDataWithFormat: function() {},
349 _makeShader: function() {},
350 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400351
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500352 SkImageFilter: {
353 MakeBlur: function() {},
354 MakeColorFilter: function() {},
355 MakeCompose: function() {},
356 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400357
358 // private API
359 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500360 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400361
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500362 // These are defined in interface.js
363 SkM44: {
364 identity: function() {},
365 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400366 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500367 multiply: function() {},
368 rotatedUnitSinCos: function() {},
369 rotated: function() {},
370 scaled: function() {},
371 translated: function() {},
372 lookat: function() {},
373 perspective: function() {},
374 rc: function() {},
375 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400376 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500377 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500378
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500379 SkMatrix: {
380 identity: function() {},
381 invert: function() {},
382 mapPoints: function() {},
383 multiply: function() {},
384 rotated: function() {},
385 scaled: function() {},
386 skewed: function() {},
387 translated: function() {},
388 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500389
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500390 SkMaskFilter: {
391 MakeBlur: function() {},
392 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400393
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 SkPaint: {
395 // public API (from C++ bindings)
396 /** @return {CanvasKit.SkPaint} */
397 copy: function() {},
398 getBlendMode: function() {},
399 getColor: function() {},
400 getFilterQuality: function() {},
401 getStrokeCap: function() {},
402 getStrokeJoin: function() {},
403 getStrokeMiter: function() {},
404 getStrokeWidth: function() {},
405 setAntiAlias: function() {},
406 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400407 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500408 setFilterQuality: function() {},
409 setImageFilter: function() {},
410 setMaskFilter: function() {},
411 setPathEffect: function() {},
412 setShader: function() {},
413 setStrokeCap: function() {},
414 setStrokeJoin: function() {},
415 setStrokeMiter: function() {},
416 setStrokeWidth: function() {},
417 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500418
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400419 prototype: {
420 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400421 setColorComponents: function() {},
422 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400423 },
424
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500425 // Private API
426 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400427 _getColor: function() {},
428 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500429 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500430
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500431 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400432 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500433 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400434 MakeDiscrete: function() {},
435
436 // Private C++ API
437 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500438 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500439
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500440 SkParticleEffect: {
441 // public API (from C++ bindings)
442 draw: function() {},
443 getEffectUniform: function() {},
444 getEffectUniformCount: function() {},
445 getEffectUniformFloatCount: function() {},
446 getEffectUniformName: function() {},
447 getParticleUniformCount: function() {},
448 getParticleUniformFloatCount: function() {},
449 getParticleUniformName: function() {},
450 getParticleUniform: function() {},
451 setPosition: function() {},
452 setRate: function() {},
453 start: function() {},
454 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500455
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500456 // private API (from C++ bindings)
457 _effectUniformPtr: function() {},
458 _particleUniformPtr: function() {},
459 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500460
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500461 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400462 // public API (from C++ and JS bindings)
463 MakeFromCmds: function() {},
464 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500465 computeTightBounds: function() {},
466 contains: function() {},
467 /** @return {CanvasKit.SkPath} */
468 copy: function() {},
469 countPoints: function() {},
470 equals: function() {},
471 getBounds: function() {},
472 getFillType: function() {},
473 getPoint: function() {},
474 isEmpty: function() {},
475 isVolatile: function() {},
476 reset: function() {},
477 rewind: function() {},
478 setFillType: function() {},
479 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400480 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500481 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400482
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500483 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400484 _MakeFromCmds: function() {},
485 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500486 _addArc: function() {},
487 _addOval: function() {},
488 _addPath: function() {},
Kevin Lubickbdc214a2020-09-02 15:25:45 -0400489 _addRect: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000490 _addPoly: function() {},
491 _addRoundRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400492 _addVerbsPointsWeights: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000493 _arc: function() {},
494 _arcTo: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400495 _arcToOval: function() {},
Kevin Lubickbdc214a2020-09-02 15:25:45 -0400496 _arcToTangent: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000497 _arcToRotated: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500498 _close: function() {},
499 _conicTo: function() {},
500 _cubicTo: function() {},
501 _dash: function() {},
502 _lineTo: function() {},
503 _moveTo: function() {},
504 _op: function() {},
505 _quadTo: function() {},
506 _rArcTo: function() {},
507 _rConicTo: function() {},
508 _rCubicTo: function() {},
509 _rLineTo: function() {},
510 _rMoveTo: function() {},
511 _rQuadTo: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000512 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500513 _simplify: function() {},
514 _stroke: function() {},
515 _transform: function() {},
516 _trim: function() {},
517 delete: function() {},
518 dump: function() {},
519 dumpHex: function() {},
520 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400521
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500522 SkPathMeasure: {
523 getLength: function() {},
524 getSegment: function() {},
525 getPosTan: function() {},
526 isClosed: function() {},
527 nextContour: function() {},
528 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400529
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500530 SkPicture: {
531 serialize: function() {},
532 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400533
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500534 SkPictureRecorder: {
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000535 beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500536 finishRecordingAsPicture: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000537 },
538
539 SkRect: {
540 fLeft: {},
541 fTop: {},
542 fRight: {},
543 fBottom: {},
544 },
545
546 SkRRect: {
547 rect: {},
548 rx1: {},
549 ry1: {},
550 rx2: {},
551 ry2: {},
552 rx3: {},
553 ry3: {},
554 rx4: {},
555 ry4: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500556 },
Kevin Lubick62836902019-12-09 09:04:26 -0500557
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500558 SkShader: {
559 Blend: function() {},
560 Color: function() {},
561 Empty: function() {},
562 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400563 MakeLinearGradient: function() {},
564 MakeRadialGradient: function() {},
565 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700566 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400567
568 // private API (from C++ bindings)
569 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500570 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400571
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500572 SkSurface: {
573 // public API (from C++ bindings)
574 /** @return {CanvasKit.SkCanvas} */
575 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400576 imageInfo: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000577 /** @return {CanvasKit.SkImage} */
578 makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500579 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600580 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400581 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500582 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400583 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400584
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500585 // private API
586 _flush: function() {},
587 _getRasterN32PremulSurface: function() {},
588 delete: function() {},
589 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500590
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500591 SkTextBlob: {
592 // public API (both C++ and JS bindings)
593 MakeFromRSXform: function() {},
594 MakeFromText: function() {},
595 MakeOnPath: function() {},
596 // private API (from C++ bindings)
597 _MakeFromRSXform: function() {},
598 _MakeFromText: function() {},
599 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500600
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500601 // These are defined in interface.js
602 SkVector: {
603 add: function() {},
604 sub: function() {},
605 dot: function() {},
606 cross: function() {},
607 normalize: function() {},
608 mulScalar: function() {},
609 length: function() {},
610 lengthSquared: function() {},
611 dist: function() {},
612 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400613
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500614 SkVertices: {
615 // public API (from C++ bindings)
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000616 bounds: function() {},
617 mode: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 uniqueID: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000619 vertexCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500620 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400621
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500622 _SkVerticesBuilder: {
623 colors: function() {},
624 detach: function() {},
625 indices: function() {},
626 positions: function() {},
627 texCoords: function() {},
628 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400629
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400631
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500632 // Constants and Enums
633 gpu: {},
634 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400637 BLACK: {},
638 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500639 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400640 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 BLUE: {},
642 YELLOW: {},
643 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400644 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500645
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 MOVE_VERB: {},
647 LINE_VERB: {},
648 QUAD_VERB: {},
649 CONIC_VERB: {},
650 CUBIC_VERB: {},
651 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500652
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 NoDecoration: {},
654 UnderlineDecoration: {},
655 OverlineDecoration: {},
656 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400657
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 SaveLayerInitWithPrevious: {},
659 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400660
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 Affinity: {
662 Upstream: {},
663 Downstream: {},
664 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400665
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 AlphaType: {
667 Opaque: {},
668 Premul: {},
669 Unpremul: {},
670 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500671
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500672 BlendMode: {
673 Clear: {},
674 Src: {},
675 Dst: {},
676 SrcOver: {},
677 DstOver: {},
678 SrcIn: {},
679 DstIn: {},
680 SrcOut: {},
681 DstOut: {},
682 SrcATop: {},
683 DstATop: {},
684 Xor: {},
685 Plus: {},
686 Modulate: {},
687 Screen: {},
688 Overlay: {},
689 Darken: {},
690 Lighten: {},
691 ColorDodge: {},
692 ColorBurn: {},
693 HardLight: {},
694 SoftLight: {},
695 Difference: {},
696 Exclusion: {},
697 Multiply: {},
698 Hue: {},
699 Saturation: {},
700 Color: {},
701 Luminosity: {},
702 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500703
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 BlurStyle: {
705 Normal: {},
706 Solid: {},
707 Outer: {},
708 Inner: {},
709 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500710
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 ClipOp: {
712 Difference: {},
713 Intersect: {},
714 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500715
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500716 ColorType: {
717 Alpha_8: {},
718 RGB_565: {},
719 ARGB_4444: {},
720 RGBA_8888: {},
721 RGB_888x: {},
722 BGRA_8888: {},
723 RGBA_1010102: {},
724 RGB_101010x: {},
725 Gray_8: {},
726 RGBA_F16: {},
727 RGBA_F32: {},
728 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 FillType: {
731 Winding: {},
732 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400734
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500735 FilterQuality: {
736 None: {},
737 Low: {},
738 Medium: {},
739 High: {},
740 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500741
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500742 FontSlant: {
743 Upright: {},
744 Italic: {},
745 Oblique: {},
746 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400747
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500748 FontHinting: {
749 None: {},
750 Slight: {},
751 Normal: {},
752 Full: {},
753 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500754
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500755 FontWeight: {
756 Invisible: {},
757 Thin: {},
758 ExtraLight: {},
759 Light: {},
760 Normal: {},
761 Medium: {},
762 SemiBold: {},
763 Bold: {},
764 ExtraBold: {},
765 Black: {},
766 ExtraBlack: {},
767 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400768
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500769 FontWidth: {
770 UltraCondensed: {},
771 ExtraCondensed: {},
772 Condensed: {},
773 SemiCondensed: {},
774 Normal: {},
775 SemiExpanded: {},
776 Expanded: {},
777 ExtraExpanded: {},
778 UltraExpanded: {},
779 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400780
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500781 ImageFormat: {
782 PNG: {},
783 JPEG: {},
784 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300785
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500786 PaintStyle: {
787 Fill: {},
788 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500789 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500790
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500791 PathOp: {
792 Difference: {},
793 Intersect: {},
794 Union: {},
795 XOR: {},
796 ReverseDifference: {},
797 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500798
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500799 PointMode: {
800 Points: {},
801 Lines: {},
802 Polygon: {},
803 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500804
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500805 RectHeightStyle: {
806 Tight: {},
807 Max: {},
808 IncludeLineSpacingMiddle: {},
809 IncludeLineSpacingTop: {},
810 IncludeLineSpacingBottom: {},
811 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400812
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500813 RectWidthStyle: {
814 Tight: {},
815 Max: {},
816 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400817
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500818 StrokeCap: {
819 Butt: {},
820 Round: {},
821 Square: {},
822 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500823
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500824 StrokeJoin: {
825 Miter: {},
826 Round: {},
827 Bevel: {},
828 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500829
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500830 TextAlign: {
831 Left: {},
832 Right: {},
833 Center: {},
834 Justify: {},
835 Start: {},
836 End: {},
837 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400838
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500839 TextDirection: {
840 LTR: {},
841 RTL: {},
842 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400843
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500844 TileMode: {
845 Clamp: {},
846 Repeat: {},
847 Mirror: {},
848 Decal: {},
849 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500850
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500851 VertexMode: {
852 Triangles: {},
853 TrianglesStrip: {},
854 TriangleFan: {},
855 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500856
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500857 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400858
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 /**
860 * @type {Float32Array}
861 */
862 HEAPF32: {},
863 /**
864 * @type {Float64Array}
865 */
866 HEAPF64: {},
867 /**
868 * @type {Uint8Array}
869 */
870 HEAPU8: {},
871 /**
872 * @type {Uint16Array}
873 */
874 HEAPU16: {},
875 /**
876 * @type {Uint32Array}
877 */
878 HEAPU32: {},
879 /**
880 * @type {Int8Array}
881 */
882 HEAP8: {},
883 /**
884 * @type {Int16Array}
885 */
886 HEAP16: {},
887 /**
888 * @type {Int32Array}
889 */
890 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400891
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500892 _malloc: function() {},
893 _free: function() {},
894 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400895};
Kevin Lubick217056c2018-09-20 17:39:31 -0400896
Kevin Lubick006a6f32018-10-19 14:34:34 -0400897// Public API things that are newly declared in the JS should go here.
898// It's not enough to declare them above, because closure can still erase them
899// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400900CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
901
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000902CanvasKit.SkPath.prototype.addArc = function() {};
903CanvasKit.SkPath.prototype.addOval = function() {};
904CanvasKit.SkPath.prototype.addPath = function() {};
905CanvasKit.SkPath.prototype.addPoly = function() {};
906CanvasKit.SkPath.prototype.addRect = function() {};
907CanvasKit.SkPath.prototype.addRoundRect = function() {};
908CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {};
909CanvasKit.SkPath.prototype.arc = function() {};
910CanvasKit.SkPath.prototype.arcTo = function() {};
911CanvasKit.SkPath.prototype.arcToOval = function() {};
912CanvasKit.SkPath.prototype.arcToTangent = function() {};
913CanvasKit.SkPath.prototype.arcToRotated = function() {};
914CanvasKit.SkPath.prototype.close = function() {};
915CanvasKit.SkPath.prototype.conicTo = function() {};
916CanvasKit.SkPath.prototype.cubicTo = function() {};
917CanvasKit.SkPath.prototype.dash = function() {};
918CanvasKit.SkPath.prototype.lineTo = function() {};
919CanvasKit.SkPath.prototype.moveTo = function() {};
920CanvasKit.SkPath.prototype.offset = function() {};
921CanvasKit.SkPath.prototype.op = function() {};
922CanvasKit.SkPath.prototype.quadTo = function() {};
923CanvasKit.SkPath.prototype.rArcTo = function() {};
924CanvasKit.SkPath.prototype.rConicTo = function() {};
925CanvasKit.SkPath.prototype.rCubicTo = function() {};
926CanvasKit.SkPath.prototype.rLineTo = function() {};
927CanvasKit.SkPath.prototype.rMoveTo = function() {};
928CanvasKit.SkPath.prototype.rQuadTo = function() {};
929CanvasKit.SkPath.prototype.rect = function() {};
930CanvasKit.SkPath.prototype.simplify = function() {};
931CanvasKit.SkPath.prototype.stroke = function() {};
932CanvasKit.SkPath.prototype.transform = function() {};
933CanvasKit.SkPath.prototype.trim = function() {};
934
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500935CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400936
Kevin Lubick5b90b842018-10-17 07:57:18 -0400937CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400938CanvasKit.SkSurface.prototype.flush = function() {};
939CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800940CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400941CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400942
Alexander Khovansky3e119332018-11-15 02:01:19 +0300943CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400944CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300945
Kevin Lubickddd0a332018-12-12 10:35:13 -0500946CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
947
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400948CanvasKit.SkFont.prototype.getWidths = function() {};
949
950CanvasKit.RSXFormBuilder.prototype.build = function() {};
951CanvasKit.RSXFormBuilder.prototype.delete = function() {};
952CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400953CanvasKit.RSXFormBuilder.prototype.set = function() {};
954
955CanvasKit.SkColorBuilder.prototype.build = function() {};
956CanvasKit.SkColorBuilder.prototype.delete = function() {};
957CanvasKit.SkColorBuilder.prototype.push = function() {};
958CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400959
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500960CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500961CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500962
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500963CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
964CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
965
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400966// Define StrokeOpts object
967var StrokeOpts = {};
968StrokeOpts.prototype.width;
969StrokeOpts.prototype.miter_limit;
970StrokeOpts.prototype.cap;
971StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500972StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400973
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500974// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500975var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500976HTMLCanvas.prototype.decodeImage = function() {};
977HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500978HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500979HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500980HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500981HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500982
Elliot Evans28796192020-06-15 12:53:27 -0600983var ImageBitmapRenderingContext = {};
984ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
985
Kevin Lubickb9db3902018-11-26 11:47:54 -0500986var CanvasRenderingContext2D = {};
987CanvasRenderingContext2D.prototype.addHitRegion = function() {};
988CanvasRenderingContext2D.prototype.arc = function() {};
989CanvasRenderingContext2D.prototype.arcTo = function() {};
990CanvasRenderingContext2D.prototype.beginPath = function() {};
991CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
992CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500993CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500994CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500995CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500996CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500997CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500998CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500999CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001000CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001001CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001002CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001003CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001004CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001005CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001006CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001007CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001008CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1009CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001010CanvasRenderingContext2D.prototype.lineTo = function() {};
1011CanvasRenderingContext2D.prototype.measureText = function() {};
1012CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001013CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001014CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1015CanvasRenderingContext2D.prototype.rect = function() {};
1016CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1017CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001018CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001019CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001020CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001021CanvasRenderingContext2D.prototype.scale = function() {};
1022CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001023CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001024CanvasRenderingContext2D.prototype.setTransform = function() {};
1025CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001026CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001027CanvasRenderingContext2D.prototype.strokeText = function() {};
1028CanvasRenderingContext2D.prototype.transform = function() {};
1029CanvasRenderingContext2D.prototype.translate = function() {};
1030
Kevin Lubicka40f8322018-12-17 16:01:36 -05001031var Path2D = {};
1032Path2D.prototype.addPath = function() {};
1033Path2D.prototype.arc = function() {};
1034Path2D.prototype.arcTo = function() {};
1035Path2D.prototype.bezierCurveTo = function() {};
1036Path2D.prototype.closePath = function() {};
1037Path2D.prototype.ellipse = function() {};
1038Path2D.prototype.lineTo = function() {};
1039Path2D.prototype.moveTo = function() {};
1040Path2D.prototype.quadraticCurveTo = function() {};
1041Path2D.prototype.rect = function() {};
1042
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001043var LinearCanvasGradient = {};
1044LinearCanvasGradient.prototype.addColorStop = function() {};
1045var RadialCanvasGradient = {};
1046RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001047var CanvasPattern = {};
1048CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001049
Kevin Lubick52b9f372018-12-04 13:57:36 -05001050var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001051 /**
1052 * @type {Uint8ClampedArray}
1053 */
1054 data: {},
1055 height: {},
1056 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001057};
1058
Kevin Lubickd29edd72018-12-07 08:29:52 -05001059var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001060 a: {},
1061 b: {},
1062 c: {},
1063 d: {},
1064 e: {},
1065 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001066};
1067
Kevin Lubick217056c2018-09-20 17:39:31 -04001068// 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 -05001069function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001070
1071// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1072// to override it in the puppeteer tests
1073var LibraryEGL = {
1074 contextAttributes: {
1075 majorVersion: {}
1076 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001077}