blob: 0f978e76d3e3201332d89953ccb1fbed41429057 [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 LTRBRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050031 XYWHRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -040032 LTRBiRect: function() {},
33 XYWHiRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050034 RRectXY: function() {},
35 /** @return {ImageData} */
36 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050037
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050038 GetWebGLContext: function() {},
39 MakeBlurMaskFilter: function() {},
40 MakeCanvas: function() {},
41 MakeCanvasSurface: function() {},
42 MakeGrContext: function() {},
43 /** @return {CanvasKit.SkAnimatedImage} */
44 MakeAnimatedImageFromEncoded: function() {},
45 /** @return {CanvasKit.SkImage} */
46 MakeImage: function() {},
47 /** @return {CanvasKit.SkImage} */
48 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060049 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeOnScreenGLSurface: function() {},
51 MakePathFromCmds: function() {},
52 MakePathFromOp: function() {},
53 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050054 MakeRenderTarget: function() {},
55 MakeSkPicture: function() {},
56 MakeSWCanvasSurface: function() {},
57 MakeManagedAnimation: function() {},
58 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 MakeSkVertices: function() {},
60 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050061 MakeWebGLCanvasSurface: function() {},
62 /** @return {TypedArray} */
63 Malloc: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040064 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050065 computeTonalColors: function() {},
66 currentContext: function() {},
67 getColorComponents: function() {},
68 getDecodeCacheLimitBytes: function() {},
69 getDecodeCacheUsageBytes: function() {},
70 getSkDataBytes: function() {},
71 multiplyByAlpha: function() {},
72 parseColorString: function() {},
73 setCurrentContext: function() {},
74 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040075
Kevin Lubicke70af512020-05-14 14:50:54 -040076 // Defined by emscripten.
77 createContext:function() {},
78
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050079 // private API (i.e. things declared in the bindings that we use
80 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040081 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050082 _MakeImage: function() {},
83 _MakeLinearGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070085 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050086 _MakeManagedAnimation: function() {},
87 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050088 _MakeSkPicture: function() {},
89 _MakeSkVertices: function() {},
90 _MakeTwoPointConicalGradientShader: function() {},
91 _decodeAnimatedImage: function() {},
92 _decodeImage: function() {},
93 _drawShapedText: function() {},
94 _getRasterDirectSurface: function() {},
95 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040096
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050097 // The testing object is meant to expose internal functions
98 // for more fine-grained testing, e.g. parseColor
99 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500100
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500101 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400102
Kevin Lubickf8823b52020-09-03 10:02:10 -0400103 Animation: {
104 prototype: {
105 render: function() {},
106 },
107 _render: function() {},
108 },
109
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500110 GrContext: {
111 // public API (from C++ bindings)
112 getResourceCacheLimitBytes: function() {},
113 getResourceCacheUsageBytes: function() {},
114 releaseResourcesAndAbandonContext: function() {},
115 setResourceCacheLimitBytes: function() {},
116 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400117
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400118 ManagedAnimation: {
119 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400120 render: function() {},
121 seek: function() {},
122 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400123 setColor: function() {},
124 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400125 _render: function() {},
126 _seek: function() {},
127 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400128 },
129
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 Paragraph: {
131 // public API (from C++ bindings)
132 didExceedMaxLines: function() {},
133 getAlphabeticBaseline: function() {},
134 getGlyphPositionAtCoordinate: function() {},
135 getHeight: function() {},
136 getIdeographicBaseline: function() {},
137 getLongestLine: function() {},
138 getMaxIntrinsicWidth: function() {},
139 getMaxWidth: function() {},
140 getMinIntrinsicWidth: function() {},
141 getWordBoundary: function() {},
142 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400143
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500144 // private API
145 /** @return {Float32Array} */
146 _getRectsForRange: function() {},
147 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400148
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400149 ParagraphBuilder: {
150 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700151 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400152 addText: function() {},
153 build: function() {},
154 pop: function() {},
155
156 prototype: {
157 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400158 pushPaintStyle: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400159 },
160
161 // private API
162 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700163 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400164 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400165 _pushPaintStyle: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400166 },
167
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500168 SkRuntimeEffect: {
169 // public API (from C++ bindings)
170 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500171
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500172 // private API
173 _makeShader: function() {},
174 _makeShaderWithChildren: function() {},
175 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500176
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500177 ParagraphStyle: function() {},
178 RSXFormBuilder: function() {},
179 SkColorBuilder: function() {},
180 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400181
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500182 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400183 prototype: {
184 getBounds: function() {},
185 },
186 // private API (from C++ bindings)
187 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500188 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500189
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500190 SkAnimatedImage: {
191 // public API (from C++ bindings)
192 decodeNextFrame: function() {},
193 getFrameCount: function() {},
194 getRepetitionCount: function() {},
195 height: function() {},
196 reset: function() {},
197 width: function() {},
198 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400199
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 SkCanvas: {
201 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500202 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawAnimatedImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400205 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500206 drawImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500207 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 drawPaint: function() {},
209 drawParagraph: function() {},
210 drawPath: function() {},
211 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400212 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 drawText: function() {},
214 drawTextBlob: function() {},
215 drawVertices: function() {},
216 flush: function() {},
217 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500218 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400219 markCTM: function() {},
220 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500221 restore: function() {},
222 restoreToCount: function() {},
223 rotate: function() {},
224 save: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500225 scale: function() {},
226 skew: function() {},
227 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400228
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400229 prototype: {
230 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000231 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400232 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000233 concat44: function() {}, // deprecated
234 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400235 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000236 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400237 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400238 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000239 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400240 drawImageNine: function() {},
241 drawImageRect: function() {},
242 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000243 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400244 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000245 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400246 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000247 drawText: function() {},
248 findMarkedCTM: function() {},
249 getLocalToDevice: function() {},
250 getTotalMatrix: function() {},
251 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400252 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000253 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400254 },
255
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500256 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400257 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000258 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400259 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400260 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400261 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500262 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400263 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000264 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400265 _drawImageNine: function() {},
266 _drawImageRect: function() {},
267 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500268 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400269 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000270 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400271 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500272 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000273 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000274 _getLocalToDevice: function() {},
275 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500276 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400277 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500278 _writePixels: function() {},
279 delete: function() {},
280 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400281
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500282 SkColorFilter: {
283 // public API (from C++ bindings and JS interface)
284 MakeBlend: function() {},
285 MakeCompose: function() {},
286 MakeLerp: function() {},
287 MakeLinearToSRGBGamma: function() {},
288 MakeMatrix: function() {},
289 MakeSRGBToLinearGamma: function() {},
290 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400291 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500292 _makeMatrix: function() {},
293 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400294
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500295 SkColorMatrix: {
296 concat: function() {},
297 identity: function() {},
298 postTranslate: function() {},
299 rotated: function() {},
300 scaled: function() {},
301 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400302
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400303 SkColorSpace: {
304 Equals: function() {},
305 SRGB: {},
306 DISPLAY_P3: {},
307 ADOBE_RGB: {},
308 // private API (from C++ bindings)
309 _MakeSRGB: function() {},
310 _MakeDisplayP3: function() {},
311 _MakeAdobeRGB: function() {},
312 },
313
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500314 SkContourMeasureIter: {
315 next: function() {},
316 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500317
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500318 SkContourMeasure: {
319 getPosTan: function() {},
320 getSegment: function() {},
321 isClosed: function() {},
322 length: function() {},
323 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500324
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500325 SkFont: {
326 // public API (from C++ bindings)
327 getScaleX: function() {},
328 getSize: function() {},
329 getSkewX: function() {},
330 getTypeface: function() {},
331 measureText: function() {},
332 setHinting: function() {},
333 setLinearMetrics: function() {},
334 setScaleX: function() {},
335 setSize: function() {},
336 setSkewX: function() {},
337 setSubpixel: function() {},
338 setTypeface: function() {},
339 // private API (from C++ bindings)
340 _getWidths: function() {},
341 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500342
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500343 SkFontMgr: {
344 // public API (from C++ and JS bindings)
345 FromData: function() {},
346 RefDefault: function() {},
347 countFamilies: function() {},
348 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500349
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 // private API
351 _makeTypefaceFromData: function() {},
352 _fromData: function() {},
353 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500354
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700355 TypefaceFontProvider: {
356 // public API (from C++ and JS bindings)
357 Make: function() {},
358 registerFont: function() {},
359
360 // private API
361 _registerFont: function() {},
362 },
363
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500364 SkImage: {
365 // public API (from C++ bindings)
366 height: function() {},
367 width: function() {},
368 // private API
369 _encodeToData: function() {},
370 _encodeToDataWithFormat: function() {},
371 _makeShader: function() {},
372 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400373
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500374 SkImageFilter: {
375 MakeBlur: function() {},
376 MakeColorFilter: function() {},
377 MakeCompose: function() {},
378 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400379
380 // private API
381 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500382 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400383
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500384 // These are defined in interface.js
385 SkM44: {
386 identity: function() {},
387 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400388 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500389 multiply: function() {},
390 rotatedUnitSinCos: function() {},
391 rotated: function() {},
392 scaled: function() {},
393 translated: function() {},
394 lookat: function() {},
395 perspective: function() {},
396 rc: function() {},
397 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400398 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500400
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500401 SkMatrix: {
402 identity: function() {},
403 invert: function() {},
404 mapPoints: function() {},
405 multiply: function() {},
406 rotated: function() {},
407 scaled: function() {},
408 skewed: function() {},
409 translated: function() {},
410 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500411
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500412 SkMaskFilter: {
413 MakeBlur: function() {},
414 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400415
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500416 SkPaint: {
417 // public API (from C++ bindings)
418 /** @return {CanvasKit.SkPaint} */
419 copy: function() {},
420 getBlendMode: function() {},
421 getColor: function() {},
422 getFilterQuality: function() {},
423 getStrokeCap: function() {},
424 getStrokeJoin: function() {},
425 getStrokeMiter: function() {},
426 getStrokeWidth: function() {},
427 setAntiAlias: function() {},
428 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400429 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500430 setFilterQuality: function() {},
431 setImageFilter: function() {},
432 setMaskFilter: function() {},
433 setPathEffect: function() {},
434 setShader: function() {},
435 setStrokeCap: function() {},
436 setStrokeJoin: function() {},
437 setStrokeMiter: function() {},
438 setStrokeWidth: function() {},
439 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500440
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400441 prototype: {
442 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400443 setColorComponents: function() {},
444 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400445 },
446
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500447 // Private API
448 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400449 _getColor: function() {},
450 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500451 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500452
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500453 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400454 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500455 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400456 MakeDiscrete: function() {},
457
458 // Private C++ API
459 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500460 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500461
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500462 SkParticleEffect: {
463 // public API (from C++ bindings)
464 draw: function() {},
465 getEffectUniform: function() {},
466 getEffectUniformCount: function() {},
467 getEffectUniformFloatCount: function() {},
468 getEffectUniformName: function() {},
469 getParticleUniformCount: function() {},
470 getParticleUniformFloatCount: function() {},
471 getParticleUniformName: function() {},
472 getParticleUniform: function() {},
473 setPosition: function() {},
474 setRate: function() {},
475 start: function() {},
476 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500477
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500478 // private API (from C++ bindings)
479 _effectUniformPtr: function() {},
480 _particleUniformPtr: function() {},
481 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500482
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500483 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400484 // public API (from C++ and JS bindings)
485 MakeFromCmds: function() {},
486 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500487 computeTightBounds: function() {},
488 contains: function() {},
489 /** @return {CanvasKit.SkPath} */
490 copy: function() {},
491 countPoints: function() {},
492 equals: function() {},
493 getBounds: function() {},
494 getFillType: function() {},
495 getPoint: function() {},
496 isEmpty: function() {},
497 isVolatile: function() {},
498 reset: function() {},
499 rewind: function() {},
500 setFillType: function() {},
501 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400502 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500503 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400504
Kevin Lubickf8823b52020-09-03 10:02:10 -0400505 prototype: {
506 addArc: function() {},
507 addOval: function() {},
508 addPath: function() {},
509 addPoly: function() {},
510 addRect: function() {},
511 addRRect: function() {},
512 addVerbsPointsWeights: function() {},
513 arc: function() {},
514 arcToOval: function() {},
515 arcToRotated: function() {},
516 arcToTangent: function() {},
517 close: function() {},
518 conicTo: function() {},
519 cubicTo: function() {},
520 dash: function() {},
521 lineTo: function() {},
522 moveTo: function() {},
523 offset: function() {},
524 op: function() {},
525 quadTo: function() {},
526 rArcTo: function() {},
527 rConicTo: function() {},
528 rCubicTo: function() {},
529 rect: function() {},
530 rLineTo: function() {},
531 rMoveTo: function() {},
532 rQuadTo: function() {},
533 simplify: function() {},
534 stroke: function() {},
535 transform: function() {},
536 trim: function() {},
537 },
538
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500539 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400540 _MakeFromCmds: function() {},
541 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500542 _addArc: function() {},
543 _addOval: function() {},
544 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000545 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400546 _addRect: function() {},
547 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400548 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400549 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000550 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400551 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500552 _close: function() {},
553 _conicTo: function() {},
554 _cubicTo: function() {},
555 _dash: function() {},
556 _lineTo: function() {},
557 _moveTo: function() {},
558 _op: function() {},
559 _quadTo: function() {},
560 _rArcTo: function() {},
561 _rConicTo: function() {},
562 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400563 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500564 _rLineTo: function() {},
565 _rMoveTo: function() {},
566 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500567 _simplify: function() {},
568 _stroke: function() {},
569 _transform: function() {},
570 _trim: function() {},
571 delete: function() {},
572 dump: function() {},
573 dumpHex: function() {},
574 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400575
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500576 SkPathMeasure: {
577 getLength: function() {},
578 getSegment: function() {},
579 getPosTan: function() {},
580 isClosed: function() {},
581 nextContour: function() {},
582 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400583
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500584 SkPicture: {
585 serialize: function() {},
586 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400587
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500588 SkPictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500589 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400590 prototype: {
591 beginRecording: function() {},
592 },
593 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500594 },
Kevin Lubick62836902019-12-09 09:04:26 -0500595
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 SkShader: {
597 Blend: function() {},
598 Color: function() {},
599 Empty: function() {},
600 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400601 MakeLinearGradient: function() {},
602 MakeRadialGradient: function() {},
603 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700604 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400605
606 // private API (from C++ bindings)
607 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400609
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500610 SkSurface: {
611 // public API (from C++ bindings)
612 /** @return {CanvasKit.SkCanvas} */
613 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400614 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400615
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500616 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600617 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400618 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500619 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400620 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400621
Kevin Lubickf8823b52020-09-03 10:02:10 -0400622 prototype: {
623 /** @return {CanvasKit.SkImage} */
624 makeImageSnapshot: function() {},
625 },
626
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500627 // private API
628 _flush: function() {},
629 _getRasterN32PremulSurface: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400630 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 delete: function() {},
632 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500633
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500634 SkTextBlob: {
635 // public API (both C++ and JS bindings)
636 MakeFromRSXform: function() {},
637 MakeFromText: function() {},
638 MakeOnPath: function() {},
639 // private API (from C++ bindings)
640 _MakeFromRSXform: function() {},
641 _MakeFromText: function() {},
642 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500643
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 // These are defined in interface.js
645 SkVector: {
646 add: function() {},
647 sub: function() {},
648 dot: function() {},
649 cross: function() {},
650 normalize: function() {},
651 mulScalar: function() {},
652 length: function() {},
653 lengthSquared: function() {},
654 dist: function() {},
655 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400656
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 SkVertices: {
658 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500659 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400660
661 prototype: {
662 bounds: function() {},
663 },
664 // private API (from C++ bindings)
665
666 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400668
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 _SkVerticesBuilder: {
670 colors: function() {},
671 detach: function() {},
672 indices: function() {},
673 positions: function() {},
674 texCoords: function() {},
675 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400676
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500677 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400678
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 // Constants and Enums
680 gpu: {},
681 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400682
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400684 BLACK: {},
685 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500686 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400687 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500688 BLUE: {},
689 YELLOW: {},
690 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400691 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500692
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 MOVE_VERB: {},
694 LINE_VERB: {},
695 QUAD_VERB: {},
696 CONIC_VERB: {},
697 CUBIC_VERB: {},
698 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 NoDecoration: {},
701 UnderlineDecoration: {},
702 OverlineDecoration: {},
703 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 SaveLayerInitWithPrevious: {},
706 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400707
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 Affinity: {
709 Upstream: {},
710 Downstream: {},
711 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 AlphaType: {
714 Opaque: {},
715 Premul: {},
716 Unpremul: {},
717 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500718
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500719 BlendMode: {
720 Clear: {},
721 Src: {},
722 Dst: {},
723 SrcOver: {},
724 DstOver: {},
725 SrcIn: {},
726 DstIn: {},
727 SrcOut: {},
728 DstOut: {},
729 SrcATop: {},
730 DstATop: {},
731 Xor: {},
732 Plus: {},
733 Modulate: {},
734 Screen: {},
735 Overlay: {},
736 Darken: {},
737 Lighten: {},
738 ColorDodge: {},
739 ColorBurn: {},
740 HardLight: {},
741 SoftLight: {},
742 Difference: {},
743 Exclusion: {},
744 Multiply: {},
745 Hue: {},
746 Saturation: {},
747 Color: {},
748 Luminosity: {},
749 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500750
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500751 BlurStyle: {
752 Normal: {},
753 Solid: {},
754 Outer: {},
755 Inner: {},
756 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500757
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500758 ClipOp: {
759 Difference: {},
760 Intersect: {},
761 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500762
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500763 ColorType: {
764 Alpha_8: {},
765 RGB_565: {},
766 ARGB_4444: {},
767 RGBA_8888: {},
768 RGB_888x: {},
769 BGRA_8888: {},
770 RGBA_1010102: {},
771 RGB_101010x: {},
772 Gray_8: {},
773 RGBA_F16: {},
774 RGBA_F32: {},
775 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500776
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500777 FillType: {
778 Winding: {},
779 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400781
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500782 FilterQuality: {
783 None: {},
784 Low: {},
785 Medium: {},
786 High: {},
787 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500788
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500789 FontSlant: {
790 Upright: {},
791 Italic: {},
792 Oblique: {},
793 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 FontHinting: {
796 None: {},
797 Slight: {},
798 Normal: {},
799 Full: {},
800 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 FontWeight: {
803 Invisible: {},
804 Thin: {},
805 ExtraLight: {},
806 Light: {},
807 Normal: {},
808 Medium: {},
809 SemiBold: {},
810 Bold: {},
811 ExtraBold: {},
812 Black: {},
813 ExtraBlack: {},
814 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 FontWidth: {
817 UltraCondensed: {},
818 ExtraCondensed: {},
819 Condensed: {},
820 SemiCondensed: {},
821 Normal: {},
822 SemiExpanded: {},
823 Expanded: {},
824 ExtraExpanded: {},
825 UltraExpanded: {},
826 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400827
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500828 ImageFormat: {
829 PNG: {},
830 JPEG: {},
831 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300832
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500833 PaintStyle: {
834 Fill: {},
835 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500836 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500837
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500838 PathOp: {
839 Difference: {},
840 Intersect: {},
841 Union: {},
842 XOR: {},
843 ReverseDifference: {},
844 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500845
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500846 PointMode: {
847 Points: {},
848 Lines: {},
849 Polygon: {},
850 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500851
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500852 RectHeightStyle: {
853 Tight: {},
854 Max: {},
855 IncludeLineSpacingMiddle: {},
856 IncludeLineSpacingTop: {},
857 IncludeLineSpacingBottom: {},
858 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400859
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500860 RectWidthStyle: {
861 Tight: {},
862 Max: {},
863 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400864
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500865 StrokeCap: {
866 Butt: {},
867 Round: {},
868 Square: {},
869 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500870
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500871 StrokeJoin: {
872 Miter: {},
873 Round: {},
874 Bevel: {},
875 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500876
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500877 TextAlign: {
878 Left: {},
879 Right: {},
880 Center: {},
881 Justify: {},
882 Start: {},
883 End: {},
884 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400885
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500886 TextDirection: {
887 LTR: {},
888 RTL: {},
889 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400890
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500891 TileMode: {
892 Clamp: {},
893 Repeat: {},
894 Mirror: {},
895 Decal: {},
896 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500897
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500898 VertexMode: {
899 Triangles: {},
900 TrianglesStrip: {},
901 TriangleFan: {},
902 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500903
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500904 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400905
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500906 /**
907 * @type {Float32Array}
908 */
909 HEAPF32: {},
910 /**
911 * @type {Float64Array}
912 */
913 HEAPF64: {},
914 /**
915 * @type {Uint8Array}
916 */
917 HEAPU8: {},
918 /**
919 * @type {Uint16Array}
920 */
921 HEAPU16: {},
922 /**
923 * @type {Uint32Array}
924 */
925 HEAPU32: {},
926 /**
927 * @type {Int8Array}
928 */
929 HEAP8: {},
930 /**
931 * @type {Int16Array}
932 */
933 HEAP16: {},
934 /**
935 * @type {Int32Array}
936 */
937 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400938
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500939 _malloc: function() {},
940 _free: function() {},
941 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400942};
Kevin Lubick217056c2018-09-20 17:39:31 -0400943
Kevin Lubick006a6f32018-10-19 14:34:34 -0400944// Public API things that are newly declared in the JS should go here.
945// It's not enough to declare them above, because closure can still erase them
946// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400947CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
948
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500949CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400950
Kevin Lubick5b90b842018-10-17 07:57:18 -0400951CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400952CanvasKit.SkSurface.prototype.flush = function() {};
953CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800954CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400955CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400956
Alexander Khovansky3e119332018-11-15 02:01:19 +0300957CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400958CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300959
Kevin Lubickddd0a332018-12-12 10:35:13 -0500960CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
961
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400962CanvasKit.SkFont.prototype.getWidths = function() {};
963
964CanvasKit.RSXFormBuilder.prototype.build = function() {};
965CanvasKit.RSXFormBuilder.prototype.delete = function() {};
966CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400967CanvasKit.RSXFormBuilder.prototype.set = function() {};
968
969CanvasKit.SkColorBuilder.prototype.build = function() {};
970CanvasKit.SkColorBuilder.prototype.delete = function() {};
971CanvasKit.SkColorBuilder.prototype.push = function() {};
972CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400973
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500974CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500975CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500976
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500977CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
978CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
979
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400980// Define StrokeOpts object
981var StrokeOpts = {};
982StrokeOpts.prototype.width;
983StrokeOpts.prototype.miter_limit;
984StrokeOpts.prototype.cap;
985StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500986StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400987
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500988// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500989var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500990HTMLCanvas.prototype.decodeImage = function() {};
991HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500992HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500993HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500994HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500995HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500996
Elliot Evans28796192020-06-15 12:53:27 -0600997var ImageBitmapRenderingContext = {};
998ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
999
Kevin Lubickb9db3902018-11-26 11:47:54 -05001000var CanvasRenderingContext2D = {};
1001CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1002CanvasRenderingContext2D.prototype.arc = function() {};
1003CanvasRenderingContext2D.prototype.arcTo = function() {};
1004CanvasRenderingContext2D.prototype.beginPath = function() {};
1005CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1006CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001007CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001008CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001009CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001010CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001011CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001012CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001013CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001014CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001015CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001016CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001017CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001018CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001019CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001020CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001021CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001022CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1023CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001024CanvasRenderingContext2D.prototype.lineTo = function() {};
1025CanvasRenderingContext2D.prototype.measureText = function() {};
1026CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001027CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001028CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1029CanvasRenderingContext2D.prototype.rect = function() {};
1030CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1031CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001032CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001033CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001034CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001035CanvasRenderingContext2D.prototype.scale = function() {};
1036CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001037CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001038CanvasRenderingContext2D.prototype.setTransform = function() {};
1039CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001040CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001041CanvasRenderingContext2D.prototype.strokeText = function() {};
1042CanvasRenderingContext2D.prototype.transform = function() {};
1043CanvasRenderingContext2D.prototype.translate = function() {};
1044
Kevin Lubicka40f8322018-12-17 16:01:36 -05001045var Path2D = {};
1046Path2D.prototype.addPath = function() {};
1047Path2D.prototype.arc = function() {};
1048Path2D.prototype.arcTo = function() {};
1049Path2D.prototype.bezierCurveTo = function() {};
1050Path2D.prototype.closePath = function() {};
1051Path2D.prototype.ellipse = function() {};
1052Path2D.prototype.lineTo = function() {};
1053Path2D.prototype.moveTo = function() {};
1054Path2D.prototype.quadraticCurveTo = function() {};
1055Path2D.prototype.rect = function() {};
1056
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001057var LinearCanvasGradient = {};
1058LinearCanvasGradient.prototype.addColorStop = function() {};
1059var RadialCanvasGradient = {};
1060RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001061var CanvasPattern = {};
1062CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001063
Kevin Lubick52b9f372018-12-04 13:57:36 -05001064var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001065 /**
1066 * @type {Uint8ClampedArray}
1067 */
1068 data: {},
1069 height: {},
1070 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001071};
1072
Kevin Lubickd29edd72018-12-07 08:29:52 -05001073var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001074 a: {},
1075 b: {},
1076 c: {},
1077 d: {},
1078 e: {},
1079 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001080};
1081
Kevin Lubick217056c2018-09-20 17:39:31 -04001082// 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 -05001083function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001084
1085// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1086// to override it in the puppeteer tests
1087var LibraryEGL = {
1088 contextAttributes: {
1089 majorVersion: {}
1090 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001091}