blob: 9cd13bba8c4a2b632d4d42c5fa2d1a324a03e838 [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500212 drawText: function() {},
213 drawTextBlob: function() {},
214 drawVertices: function() {},
215 flush: function() {},
216 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400218 markCTM: function() {},
219 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500220 restore: function() {},
221 restoreToCount: function() {},
222 rotate: function() {},
223 save: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500224 scale: function() {},
225 skew: function() {},
226 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400227
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400228 prototype: {
229 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000230 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400231 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000232 concat44: function() {}, // deprecated
233 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400234 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000235 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400236 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400237 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000238 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400239 drawImageNine: function() {},
240 drawImageRect: function() {},
241 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000242 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400243 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000244 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400245 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000246 drawText: function() {},
247 findMarkedCTM: function() {},
248 getLocalToDevice: function() {},
249 getTotalMatrix: function() {},
250 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400251 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000252 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400253 },
254
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500255 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400256 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000257 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400258 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400259 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400260 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500261 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400262 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000263 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400264 _drawImageNine: function() {},
265 _drawImageRect: function() {},
266 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500267 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400268 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000269 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400270 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500271 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000272 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000273 _getLocalToDevice: function() {},
274 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500275 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400276 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500277 _writePixels: function() {},
278 delete: function() {},
279 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400280
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500281 SkColorFilter: {
282 // public API (from C++ bindings and JS interface)
283 MakeBlend: function() {},
284 MakeCompose: function() {},
285 MakeLerp: function() {},
286 MakeLinearToSRGBGamma: function() {},
287 MakeMatrix: function() {},
288 MakeSRGBToLinearGamma: function() {},
289 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400290 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500291 _makeMatrix: function() {},
292 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400293
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500294 SkColorMatrix: {
295 concat: function() {},
296 identity: function() {},
297 postTranslate: function() {},
298 rotated: function() {},
299 scaled: function() {},
300 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400301
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400302 SkColorSpace: {
303 Equals: function() {},
304 SRGB: {},
305 DISPLAY_P3: {},
306 ADOBE_RGB: {},
307 // private API (from C++ bindings)
308 _MakeSRGB: function() {},
309 _MakeDisplayP3: function() {},
310 _MakeAdobeRGB: function() {},
311 },
312
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500313 SkContourMeasureIter: {
314 next: function() {},
315 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500316
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500317 SkContourMeasure: {
318 getPosTan: function() {},
319 getSegment: function() {},
320 isClosed: function() {},
321 length: function() {},
322 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500323
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500324 SkFont: {
325 // public API (from C++ bindings)
326 getScaleX: function() {},
327 getSize: function() {},
328 getSkewX: function() {},
329 getTypeface: function() {},
330 measureText: function() {},
331 setHinting: function() {},
332 setLinearMetrics: function() {},
333 setScaleX: function() {},
334 setSize: function() {},
335 setSkewX: function() {},
336 setSubpixel: function() {},
337 setTypeface: function() {},
338 // private API (from C++ bindings)
339 _getWidths: function() {},
340 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500341
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500342 SkFontMgr: {
343 // public API (from C++ and JS bindings)
344 FromData: function() {},
345 RefDefault: function() {},
346 countFamilies: function() {},
347 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500348
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500349 // private API
350 _makeTypefaceFromData: function() {},
351 _fromData: function() {},
352 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500353
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700354 TypefaceFontProvider: {
355 // public API (from C++ and JS bindings)
356 Make: function() {},
357 registerFont: function() {},
358
359 // private API
360 _registerFont: function() {},
361 },
362
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500363 SkImage: {
364 // public API (from C++ bindings)
365 height: function() {},
366 width: function() {},
367 // private API
368 _encodeToData: function() {},
369 _encodeToDataWithFormat: function() {},
370 _makeShader: function() {},
371 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400372
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500373 SkImageFilter: {
374 MakeBlur: function() {},
375 MakeColorFilter: function() {},
376 MakeCompose: function() {},
377 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400378
379 // private API
380 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500381 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400382
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500383 // These are defined in interface.js
384 SkM44: {
385 identity: function() {},
386 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400387 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500388 multiply: function() {},
389 rotatedUnitSinCos: function() {},
390 rotated: function() {},
391 scaled: function() {},
392 translated: function() {},
393 lookat: function() {},
394 perspective: function() {},
395 rc: function() {},
396 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400397 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500398 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500399
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500400 SkMatrix: {
401 identity: function() {},
402 invert: function() {},
403 mapPoints: function() {},
404 multiply: function() {},
405 rotated: function() {},
406 scaled: function() {},
407 skewed: function() {},
408 translated: function() {},
409 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500410
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500411 SkMaskFilter: {
412 MakeBlur: function() {},
413 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400414
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500415 SkPaint: {
416 // public API (from C++ bindings)
417 /** @return {CanvasKit.SkPaint} */
418 copy: function() {},
419 getBlendMode: function() {},
420 getColor: function() {},
421 getFilterQuality: function() {},
422 getStrokeCap: function() {},
423 getStrokeJoin: function() {},
424 getStrokeMiter: function() {},
425 getStrokeWidth: function() {},
426 setAntiAlias: function() {},
427 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400428 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500429 setFilterQuality: function() {},
430 setImageFilter: function() {},
431 setMaskFilter: function() {},
432 setPathEffect: function() {},
433 setShader: function() {},
434 setStrokeCap: function() {},
435 setStrokeJoin: function() {},
436 setStrokeMiter: function() {},
437 setStrokeWidth: function() {},
438 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500439
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400440 prototype: {
441 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400442 setColorComponents: function() {},
443 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400444 },
445
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500446 // Private API
447 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400448 _getColor: function() {},
449 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500450 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500451
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500452 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400453 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500454 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400455 MakeDiscrete: function() {},
456
457 // Private C++ API
458 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500459 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500460
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500461 SkParticleEffect: {
462 // public API (from C++ bindings)
463 draw: function() {},
464 getEffectUniform: function() {},
465 getEffectUniformCount: function() {},
466 getEffectUniformFloatCount: function() {},
467 getEffectUniformName: function() {},
468 getParticleUniformCount: function() {},
469 getParticleUniformFloatCount: function() {},
470 getParticleUniformName: function() {},
471 getParticleUniform: function() {},
472 setPosition: function() {},
473 setRate: function() {},
474 start: function() {},
475 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500476
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500477 // private API (from C++ bindings)
478 _effectUniformPtr: function() {},
479 _particleUniformPtr: function() {},
480 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500481
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500482 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400483 // public API (from C++ and JS bindings)
484 MakeFromCmds: function() {},
485 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500486 computeTightBounds: function() {},
487 contains: function() {},
488 /** @return {CanvasKit.SkPath} */
489 copy: function() {},
490 countPoints: function() {},
491 equals: function() {},
492 getBounds: function() {},
493 getFillType: function() {},
494 getPoint: function() {},
495 isEmpty: function() {},
496 isVolatile: function() {},
497 reset: function() {},
498 rewind: function() {},
499 setFillType: function() {},
500 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400501 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500502 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400503
Kevin Lubickf8823b52020-09-03 10:02:10 -0400504 prototype: {
505 addArc: function() {},
506 addOval: function() {},
507 addPath: function() {},
508 addPoly: function() {},
509 addRect: function() {},
510 addRRect: function() {},
511 addVerbsPointsWeights: function() {},
512 arc: function() {},
513 arcToOval: function() {},
514 arcToRotated: function() {},
515 arcToTangent: function() {},
516 close: function() {},
517 conicTo: function() {},
518 cubicTo: function() {},
519 dash: function() {},
520 lineTo: function() {},
521 moveTo: function() {},
522 offset: function() {},
523 op: function() {},
524 quadTo: function() {},
525 rArcTo: function() {},
526 rConicTo: function() {},
527 rCubicTo: function() {},
528 rect: function() {},
529 rLineTo: function() {},
530 rMoveTo: function() {},
531 rQuadTo: function() {},
532 simplify: function() {},
533 stroke: function() {},
534 transform: function() {},
535 trim: function() {},
536 },
537
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500538 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400539 _MakeFromCmds: function() {},
540 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500541 _addArc: function() {},
542 _addOval: function() {},
543 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000544 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400545 _addRect: function() {},
546 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400547 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400548 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000549 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400550 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500551 _close: function() {},
552 _conicTo: function() {},
553 _cubicTo: function() {},
554 _dash: function() {},
555 _lineTo: function() {},
556 _moveTo: function() {},
557 _op: function() {},
558 _quadTo: function() {},
559 _rArcTo: function() {},
560 _rConicTo: function() {},
561 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400562 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500563 _rLineTo: function() {},
564 _rMoveTo: function() {},
565 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500566 _simplify: function() {},
567 _stroke: function() {},
568 _transform: function() {},
569 _trim: function() {},
570 delete: function() {},
571 dump: function() {},
572 dumpHex: function() {},
573 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400574
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500575 SkPathMeasure: {
576 getLength: function() {},
577 getSegment: function() {},
578 getPosTan: function() {},
579 isClosed: function() {},
580 nextContour: function() {},
581 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400582
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500583 SkPicture: {
584 serialize: function() {},
585 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400586
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 SkPictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500588 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400589 prototype: {
590 beginRecording: function() {},
591 },
592 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500593 },
Kevin Lubick62836902019-12-09 09:04:26 -0500594
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 SkShader: {
596 Blend: function() {},
597 Color: function() {},
598 Empty: function() {},
599 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400600 MakeLinearGradient: function() {},
601 MakeRadialGradient: function() {},
602 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700603 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400604
605 // private API (from C++ bindings)
606 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400608
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 SkSurface: {
610 // public API (from C++ bindings)
611 /** @return {CanvasKit.SkCanvas} */
612 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400613 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400614
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500615 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600616 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400617 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400619 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400620
Kevin Lubickf8823b52020-09-03 10:02:10 -0400621 prototype: {
622 /** @return {CanvasKit.SkImage} */
623 makeImageSnapshot: function() {},
624 },
625
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500626 // private API
627 _flush: function() {},
628 _getRasterN32PremulSurface: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400629 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 delete: function() {},
631 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500632
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 SkTextBlob: {
634 // public API (both C++ and JS bindings)
635 MakeFromRSXform: function() {},
636 MakeFromText: function() {},
637 MakeOnPath: function() {},
638 // private API (from C++ bindings)
639 _MakeFromRSXform: function() {},
640 _MakeFromText: function() {},
641 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500642
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500643 // These are defined in interface.js
644 SkVector: {
645 add: function() {},
646 sub: function() {},
647 dot: function() {},
648 cross: function() {},
649 normalize: function() {},
650 mulScalar: function() {},
651 length: function() {},
652 lengthSquared: function() {},
653 dist: function() {},
654 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400655
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 SkVertices: {
657 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400659
660 prototype: {
661 bounds: function() {},
662 },
663 // private API (from C++ bindings)
664
665 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400667
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500668 _SkVerticesBuilder: {
669 colors: function() {},
670 detach: function() {},
671 indices: function() {},
672 positions: function() {},
673 texCoords: function() {},
674 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400675
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400677
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500678 // Constants and Enums
679 gpu: {},
680 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400681
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500682 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400683 BLACK: {},
684 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500685 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400686 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 BLUE: {},
688 YELLOW: {},
689 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400690 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500691
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 MOVE_VERB: {},
693 LINE_VERB: {},
694 QUAD_VERB: {},
695 CONIC_VERB: {},
696 CUBIC_VERB: {},
697 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500698
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 NoDecoration: {},
700 UnderlineDecoration: {},
701 OverlineDecoration: {},
702 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400703
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 SaveLayerInitWithPrevious: {},
705 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400706
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500707 Affinity: {
708 Upstream: {},
709 Downstream: {},
710 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400711
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500712 AlphaType: {
713 Opaque: {},
714 Premul: {},
715 Unpremul: {},
716 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 BlendMode: {
719 Clear: {},
720 Src: {},
721 Dst: {},
722 SrcOver: {},
723 DstOver: {},
724 SrcIn: {},
725 DstIn: {},
726 SrcOut: {},
727 DstOut: {},
728 SrcATop: {},
729 DstATop: {},
730 Xor: {},
731 Plus: {},
732 Modulate: {},
733 Screen: {},
734 Overlay: {},
735 Darken: {},
736 Lighten: {},
737 ColorDodge: {},
738 ColorBurn: {},
739 HardLight: {},
740 SoftLight: {},
741 Difference: {},
742 Exclusion: {},
743 Multiply: {},
744 Hue: {},
745 Saturation: {},
746 Color: {},
747 Luminosity: {},
748 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500749
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500750 BlurStyle: {
751 Normal: {},
752 Solid: {},
753 Outer: {},
754 Inner: {},
755 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500756
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500757 ClipOp: {
758 Difference: {},
759 Intersect: {},
760 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500761
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500762 ColorType: {
763 Alpha_8: {},
764 RGB_565: {},
765 ARGB_4444: {},
766 RGBA_8888: {},
767 RGB_888x: {},
768 BGRA_8888: {},
769 RGBA_1010102: {},
770 RGB_101010x: {},
771 Gray_8: {},
772 RGBA_F16: {},
773 RGBA_F32: {},
774 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500775
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500776 FillType: {
777 Winding: {},
778 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500779 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400780
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500781 FilterQuality: {
782 None: {},
783 Low: {},
784 Medium: {},
785 High: {},
786 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 FontSlant: {
789 Upright: {},
790 Italic: {},
791 Oblique: {},
792 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400793
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500794 FontHinting: {
795 None: {},
796 Slight: {},
797 Normal: {},
798 Full: {},
799 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500800
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500801 FontWeight: {
802 Invisible: {},
803 Thin: {},
804 ExtraLight: {},
805 Light: {},
806 Normal: {},
807 Medium: {},
808 SemiBold: {},
809 Bold: {},
810 ExtraBold: {},
811 Black: {},
812 ExtraBlack: {},
813 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 FontWidth: {
816 UltraCondensed: {},
817 ExtraCondensed: {},
818 Condensed: {},
819 SemiCondensed: {},
820 Normal: {},
821 SemiExpanded: {},
822 Expanded: {},
823 ExtraExpanded: {},
824 UltraExpanded: {},
825 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400826
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500827 ImageFormat: {
828 PNG: {},
829 JPEG: {},
830 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300831
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500832 PaintStyle: {
833 Fill: {},
834 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500835 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500836
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500837 PathOp: {
838 Difference: {},
839 Intersect: {},
840 Union: {},
841 XOR: {},
842 ReverseDifference: {},
843 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500844
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500845 PointMode: {
846 Points: {},
847 Lines: {},
848 Polygon: {},
849 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500850
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500851 RectHeightStyle: {
852 Tight: {},
853 Max: {},
854 IncludeLineSpacingMiddle: {},
855 IncludeLineSpacingTop: {},
856 IncludeLineSpacingBottom: {},
857 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400858
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 RectWidthStyle: {
860 Tight: {},
861 Max: {},
862 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400863
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500864 StrokeCap: {
865 Butt: {},
866 Round: {},
867 Square: {},
868 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500869
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500870 StrokeJoin: {
871 Miter: {},
872 Round: {},
873 Bevel: {},
874 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500875
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500876 TextAlign: {
877 Left: {},
878 Right: {},
879 Center: {},
880 Justify: {},
881 Start: {},
882 End: {},
883 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400884
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500885 TextDirection: {
886 LTR: {},
887 RTL: {},
888 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400889
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500890 TileMode: {
891 Clamp: {},
892 Repeat: {},
893 Mirror: {},
894 Decal: {},
895 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500896
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500897 VertexMode: {
898 Triangles: {},
899 TrianglesStrip: {},
900 TriangleFan: {},
901 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500902
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500903 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400904
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500905 /**
906 * @type {Float32Array}
907 */
908 HEAPF32: {},
909 /**
910 * @type {Float64Array}
911 */
912 HEAPF64: {},
913 /**
914 * @type {Uint8Array}
915 */
916 HEAPU8: {},
917 /**
918 * @type {Uint16Array}
919 */
920 HEAPU16: {},
921 /**
922 * @type {Uint32Array}
923 */
924 HEAPU32: {},
925 /**
926 * @type {Int8Array}
927 */
928 HEAP8: {},
929 /**
930 * @type {Int16Array}
931 */
932 HEAP16: {},
933 /**
934 * @type {Int32Array}
935 */
936 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400937
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500938 _malloc: function() {},
939 _free: function() {},
940 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400941};
Kevin Lubick217056c2018-09-20 17:39:31 -0400942
Kevin Lubick006a6f32018-10-19 14:34:34 -0400943// Public API things that are newly declared in the JS should go here.
944// It's not enough to declare them above, because closure can still erase them
945// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400946CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
947
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500948CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400949
Kevin Lubick5b90b842018-10-17 07:57:18 -0400950CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400951CanvasKit.SkSurface.prototype.flush = function() {};
952CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800953CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400954CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400955
Alexander Khovansky3e119332018-11-15 02:01:19 +0300956CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400957CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300958
Kevin Lubickddd0a332018-12-12 10:35:13 -0500959CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
960
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400961CanvasKit.SkFont.prototype.getWidths = function() {};
962
963CanvasKit.RSXFormBuilder.prototype.build = function() {};
964CanvasKit.RSXFormBuilder.prototype.delete = function() {};
965CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400966CanvasKit.RSXFormBuilder.prototype.set = function() {};
967
968CanvasKit.SkColorBuilder.prototype.build = function() {};
969CanvasKit.SkColorBuilder.prototype.delete = function() {};
970CanvasKit.SkColorBuilder.prototype.push = function() {};
971CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400972
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500973CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500974CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500975
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500976CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
977CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
978
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400979// Define StrokeOpts object
980var StrokeOpts = {};
981StrokeOpts.prototype.width;
982StrokeOpts.prototype.miter_limit;
983StrokeOpts.prototype.cap;
984StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500985StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400986
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500987// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500988var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500989HTMLCanvas.prototype.decodeImage = function() {};
990HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500991HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500992HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500993HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500994HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500995
Elliot Evans28796192020-06-15 12:53:27 -0600996var ImageBitmapRenderingContext = {};
997ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
998
Kevin Lubickb9db3902018-11-26 11:47:54 -0500999var CanvasRenderingContext2D = {};
1000CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1001CanvasRenderingContext2D.prototype.arc = function() {};
1002CanvasRenderingContext2D.prototype.arcTo = function() {};
1003CanvasRenderingContext2D.prototype.beginPath = function() {};
1004CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1005CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001006CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001007CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001008CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001009CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001010CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001011CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001012CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001013CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001014CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001015CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001016CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001017CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001018CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001019CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001020CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001021CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1022CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001023CanvasRenderingContext2D.prototype.lineTo = function() {};
1024CanvasRenderingContext2D.prototype.measureText = function() {};
1025CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001026CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001027CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1028CanvasRenderingContext2D.prototype.rect = function() {};
1029CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1030CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001031CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001032CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001033CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001034CanvasRenderingContext2D.prototype.scale = function() {};
1035CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001036CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001037CanvasRenderingContext2D.prototype.setTransform = function() {};
1038CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001039CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001040CanvasRenderingContext2D.prototype.strokeText = function() {};
1041CanvasRenderingContext2D.prototype.transform = function() {};
1042CanvasRenderingContext2D.prototype.translate = function() {};
1043
Kevin Lubicka40f8322018-12-17 16:01:36 -05001044var Path2D = {};
1045Path2D.prototype.addPath = function() {};
1046Path2D.prototype.arc = function() {};
1047Path2D.prototype.arcTo = function() {};
1048Path2D.prototype.bezierCurveTo = function() {};
1049Path2D.prototype.closePath = function() {};
1050Path2D.prototype.ellipse = function() {};
1051Path2D.prototype.lineTo = function() {};
1052Path2D.prototype.moveTo = function() {};
1053Path2D.prototype.quadraticCurveTo = function() {};
1054Path2D.prototype.rect = function() {};
1055
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001056var LinearCanvasGradient = {};
1057LinearCanvasGradient.prototype.addColorStop = function() {};
1058var RadialCanvasGradient = {};
1059RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001060var CanvasPattern = {};
1061CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001062
Kevin Lubick52b9f372018-12-04 13:57:36 -05001063var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001064 /**
1065 * @type {Uint8ClampedArray}
1066 */
1067 data: {},
1068 height: {},
1069 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001070};
1071
Kevin Lubickd29edd72018-12-07 08:29:52 -05001072var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001073 a: {},
1074 b: {},
1075 c: {},
1076 d: {},
1077 e: {},
1078 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001079};
1080
Kevin Lubick217056c2018-09-20 17:39:31 -04001081// 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 -05001082function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001083
1084// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1085// to override it in the puppeteer tests
1086var LibraryEGL = {
1087 contextAttributes: {
1088 majorVersion: {}
1089 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001090}