blob: 98199f08ada23c8fdb2f59d08dae21f9eba7b1e5 [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040063 MallocGlyphIDs: 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 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400204 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400206 drawImageAtCurrentFrame: 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() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400339
340 prototype: {
341 getGlyphBounds: function() {},
342 getGlyphIDs: function() {},
343 getGlyphWidths: function() {},
344 getWidths: function() {},
345 },
346
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500347 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400348 _getGlyphIDs: function() {},
349 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 _getWidths: function() {},
351 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500352
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500353 SkFontMgr: {
354 // public API (from C++ and JS bindings)
355 FromData: function() {},
356 RefDefault: function() {},
357 countFamilies: function() {},
358 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500359
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500360 // private API
361 _makeTypefaceFromData: function() {},
362 _fromData: function() {},
363 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500364
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700365 TypefaceFontProvider: {
366 // public API (from C++ and JS bindings)
367 Make: function() {},
368 registerFont: function() {},
369
370 // private API
371 _registerFont: function() {},
372 },
373
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500374 SkImage: {
375 // public API (from C++ bindings)
376 height: function() {},
377 width: function() {},
378 // private API
379 _encodeToData: function() {},
380 _encodeToDataWithFormat: function() {},
381 _makeShader: function() {},
382 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400383
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500384 SkImageFilter: {
385 MakeBlur: function() {},
386 MakeColorFilter: function() {},
387 MakeCompose: function() {},
388 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400389
390 // private API
391 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400393
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 // These are defined in interface.js
395 SkM44: {
396 identity: function() {},
397 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400398 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 multiply: function() {},
400 rotatedUnitSinCos: function() {},
401 rotated: function() {},
402 scaled: function() {},
403 translated: function() {},
404 lookat: function() {},
405 perspective: function() {},
406 rc: function() {},
407 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400408 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500409 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500410
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500411 SkMatrix: {
412 identity: function() {},
413 invert: function() {},
414 mapPoints: function() {},
415 multiply: function() {},
416 rotated: function() {},
417 scaled: function() {},
418 skewed: function() {},
419 translated: function() {},
420 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500421
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500422 SkMaskFilter: {
423 MakeBlur: function() {},
424 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400425
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500426 SkPaint: {
427 // public API (from C++ bindings)
428 /** @return {CanvasKit.SkPaint} */
429 copy: function() {},
430 getBlendMode: function() {},
431 getColor: function() {},
432 getFilterQuality: function() {},
433 getStrokeCap: function() {},
434 getStrokeJoin: function() {},
435 getStrokeMiter: function() {},
436 getStrokeWidth: function() {},
437 setAntiAlias: function() {},
438 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400439 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500440 setFilterQuality: function() {},
441 setImageFilter: function() {},
442 setMaskFilter: function() {},
443 setPathEffect: function() {},
444 setShader: function() {},
445 setStrokeCap: function() {},
446 setStrokeJoin: function() {},
447 setStrokeMiter: function() {},
448 setStrokeWidth: function() {},
449 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500450
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400451 prototype: {
452 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400453 setColorComponents: function() {},
454 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400455 },
456
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500457 // Private API
458 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400459 _getColor: function() {},
460 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500461 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500462
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500463 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400464 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500465 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400466 MakeDiscrete: function() {},
467
468 // Private C++ API
469 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500470 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500471
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500472 SkParticleEffect: {
473 // public API (from C++ bindings)
474 draw: function() {},
475 getEffectUniform: function() {},
476 getEffectUniformCount: function() {},
477 getEffectUniformFloatCount: function() {},
478 getEffectUniformName: function() {},
479 getParticleUniformCount: function() {},
480 getParticleUniformFloatCount: function() {},
481 getParticleUniformName: function() {},
482 getParticleUniform: function() {},
483 setPosition: function() {},
484 setRate: function() {},
485 start: function() {},
486 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500487
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500488 // private API (from C++ bindings)
489 _effectUniformPtr: function() {},
490 _particleUniformPtr: function() {},
491 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500492
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500493 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400494 // public API (from C++ and JS bindings)
495 MakeFromCmds: function() {},
496 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500497 computeTightBounds: function() {},
498 contains: function() {},
499 /** @return {CanvasKit.SkPath} */
500 copy: function() {},
501 countPoints: function() {},
502 equals: function() {},
503 getBounds: function() {},
504 getFillType: function() {},
505 getPoint: function() {},
506 isEmpty: function() {},
507 isVolatile: function() {},
508 reset: function() {},
509 rewind: function() {},
510 setFillType: function() {},
511 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400512 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500513 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400514
Kevin Lubickf8823b52020-09-03 10:02:10 -0400515 prototype: {
516 addArc: function() {},
517 addOval: function() {},
518 addPath: function() {},
519 addPoly: function() {},
520 addRect: function() {},
521 addRRect: function() {},
522 addVerbsPointsWeights: function() {},
523 arc: function() {},
524 arcToOval: function() {},
525 arcToRotated: function() {},
526 arcToTangent: function() {},
527 close: function() {},
528 conicTo: function() {},
529 cubicTo: function() {},
530 dash: function() {},
531 lineTo: function() {},
532 moveTo: function() {},
533 offset: function() {},
534 op: function() {},
535 quadTo: function() {},
536 rArcTo: function() {},
537 rConicTo: function() {},
538 rCubicTo: function() {},
539 rect: function() {},
540 rLineTo: function() {},
541 rMoveTo: function() {},
542 rQuadTo: function() {},
543 simplify: function() {},
544 stroke: function() {},
545 transform: function() {},
546 trim: function() {},
547 },
548
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500549 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400550 _MakeFromCmds: function() {},
551 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500552 _addArc: function() {},
553 _addOval: function() {},
554 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000555 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400556 _addRect: function() {},
557 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400558 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400559 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000560 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400561 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500562 _close: function() {},
563 _conicTo: function() {},
564 _cubicTo: function() {},
565 _dash: function() {},
566 _lineTo: function() {},
567 _moveTo: function() {},
568 _op: function() {},
569 _quadTo: function() {},
570 _rArcTo: function() {},
571 _rConicTo: function() {},
572 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400573 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 _rLineTo: function() {},
575 _rMoveTo: function() {},
576 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 _simplify: function() {},
578 _stroke: function() {},
579 _transform: function() {},
580 _trim: function() {},
581 delete: function() {},
582 dump: function() {},
583 dumpHex: function() {},
584 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400585
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 SkPathMeasure: {
587 getLength: function() {},
588 getSegment: function() {},
589 getPosTan: function() {},
590 isClosed: function() {},
591 nextContour: function() {},
592 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400593
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500594 SkPicture: {
595 serialize: function() {},
596 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400597
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500598 SkPictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500599 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400600 prototype: {
601 beginRecording: function() {},
602 },
603 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 },
Kevin Lubick62836902019-12-09 09:04:26 -0500605
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500606 SkShader: {
607 Blend: function() {},
608 Color: function() {},
609 Empty: function() {},
610 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400611 MakeLinearGradient: function() {},
612 MakeRadialGradient: function() {},
613 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700614 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400615
616 // private API (from C++ bindings)
617 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400619
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500620 SkSurface: {
621 // public API (from C++ bindings)
622 /** @return {CanvasKit.SkCanvas} */
623 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400624 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400625
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500626 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600627 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400628 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500629 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400630 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400631
Kevin Lubickf8823b52020-09-03 10:02:10 -0400632 prototype: {
633 /** @return {CanvasKit.SkImage} */
634 makeImageSnapshot: function() {},
635 },
636
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500637 // private API
638 _flush: function() {},
639 _getRasterN32PremulSurface: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400640 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 delete: function() {},
642 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500643
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 SkTextBlob: {
645 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400646 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500647 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400648 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 MakeFromText: function() {},
650 MakeOnPath: function() {},
651 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400652 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400654 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500655 _MakeFromText: function() {},
656 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500657
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 // These are defined in interface.js
659 SkVector: {
660 add: function() {},
661 sub: function() {},
662 dot: function() {},
663 cross: function() {},
664 normalize: function() {},
665 mulScalar: function() {},
666 length: function() {},
667 lengthSquared: function() {},
668 dist: function() {},
669 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400670
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500671 SkVertices: {
672 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500673 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400674
675 prototype: {
676 bounds: function() {},
677 },
678 // private API (from C++ bindings)
679
680 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400682
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 _SkVerticesBuilder: {
684 colors: function() {},
685 detach: function() {},
686 indices: function() {},
687 positions: function() {},
688 texCoords: function() {},
689 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400690
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500691 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400692
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 // Constants and Enums
694 gpu: {},
695 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400696
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400698 BLACK: {},
699 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400701 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500702 BLUE: {},
703 YELLOW: {},
704 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400705 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500706
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500707 MOVE_VERB: {},
708 LINE_VERB: {},
709 QUAD_VERB: {},
710 CONIC_VERB: {},
711 CUBIC_VERB: {},
712 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500713
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500714 NoDecoration: {},
715 UnderlineDecoration: {},
716 OverlineDecoration: {},
717 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400718
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500719 SaveLayerInitWithPrevious: {},
720 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400721
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 Affinity: {
723 Upstream: {},
724 Downstream: {},
725 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400726
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500727 AlphaType: {
728 Opaque: {},
729 Premul: {},
730 Unpremul: {},
731 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500732
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 BlendMode: {
734 Clear: {},
735 Src: {},
736 Dst: {},
737 SrcOver: {},
738 DstOver: {},
739 SrcIn: {},
740 DstIn: {},
741 SrcOut: {},
742 DstOut: {},
743 SrcATop: {},
744 DstATop: {},
745 Xor: {},
746 Plus: {},
747 Modulate: {},
748 Screen: {},
749 Overlay: {},
750 Darken: {},
751 Lighten: {},
752 ColorDodge: {},
753 ColorBurn: {},
754 HardLight: {},
755 SoftLight: {},
756 Difference: {},
757 Exclusion: {},
758 Multiply: {},
759 Hue: {},
760 Saturation: {},
761 Color: {},
762 Luminosity: {},
763 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500764
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500765 BlurStyle: {
766 Normal: {},
767 Solid: {},
768 Outer: {},
769 Inner: {},
770 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500771
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500772 ClipOp: {
773 Difference: {},
774 Intersect: {},
775 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500776
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500777 ColorType: {
778 Alpha_8: {},
779 RGB_565: {},
780 ARGB_4444: {},
781 RGBA_8888: {},
782 RGB_888x: {},
783 BGRA_8888: {},
784 RGBA_1010102: {},
785 RGB_101010x: {},
786 Gray_8: {},
787 RGBA_F16: {},
788 RGBA_F32: {},
789 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500790
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500791 FillType: {
792 Winding: {},
793 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500794 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400795
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500796 FilterQuality: {
797 None: {},
798 Low: {},
799 Medium: {},
800 High: {},
801 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500802
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500803 FontSlant: {
804 Upright: {},
805 Italic: {},
806 Oblique: {},
807 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400808
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500809 FontHinting: {
810 None: {},
811 Slight: {},
812 Normal: {},
813 Full: {},
814 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 FontWeight: {
817 Invisible: {},
818 Thin: {},
819 ExtraLight: {},
820 Light: {},
821 Normal: {},
822 Medium: {},
823 SemiBold: {},
824 Bold: {},
825 ExtraBold: {},
826 Black: {},
827 ExtraBlack: {},
828 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400829
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500830 FontWidth: {
831 UltraCondensed: {},
832 ExtraCondensed: {},
833 Condensed: {},
834 SemiCondensed: {},
835 Normal: {},
836 SemiExpanded: {},
837 Expanded: {},
838 ExtraExpanded: {},
839 UltraExpanded: {},
840 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400841
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500842 ImageFormat: {
843 PNG: {},
844 JPEG: {},
845 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300846
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500847 PaintStyle: {
848 Fill: {},
849 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500850 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500851
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500852 PathOp: {
853 Difference: {},
854 Intersect: {},
855 Union: {},
856 XOR: {},
857 ReverseDifference: {},
858 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500859
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500860 PointMode: {
861 Points: {},
862 Lines: {},
863 Polygon: {},
864 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500865
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500866 RectHeightStyle: {
867 Tight: {},
868 Max: {},
869 IncludeLineSpacingMiddle: {},
870 IncludeLineSpacingTop: {},
871 IncludeLineSpacingBottom: {},
872 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400873
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500874 RectWidthStyle: {
875 Tight: {},
876 Max: {},
877 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400878
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500879 StrokeCap: {
880 Butt: {},
881 Round: {},
882 Square: {},
883 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500884
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500885 StrokeJoin: {
886 Miter: {},
887 Round: {},
888 Bevel: {},
889 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500890
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500891 TextAlign: {
892 Left: {},
893 Right: {},
894 Center: {},
895 Justify: {},
896 Start: {},
897 End: {},
898 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400899
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500900 TextDirection: {
901 LTR: {},
902 RTL: {},
903 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400904
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500905 TileMode: {
906 Clamp: {},
907 Repeat: {},
908 Mirror: {},
909 Decal: {},
910 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500911
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500912 VertexMode: {
913 Triangles: {},
914 TrianglesStrip: {},
915 TriangleFan: {},
916 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500917
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500918 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400919
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500920 /**
921 * @type {Float32Array}
922 */
923 HEAPF32: {},
924 /**
925 * @type {Float64Array}
926 */
927 HEAPF64: {},
928 /**
929 * @type {Uint8Array}
930 */
931 HEAPU8: {},
932 /**
933 * @type {Uint16Array}
934 */
935 HEAPU16: {},
936 /**
937 * @type {Uint32Array}
938 */
939 HEAPU32: {},
940 /**
941 * @type {Int8Array}
942 */
943 HEAP8: {},
944 /**
945 * @type {Int16Array}
946 */
947 HEAP16: {},
948 /**
949 * @type {Int32Array}
950 */
951 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400952
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500953 _malloc: function() {},
954 _free: function() {},
955 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400956};
Kevin Lubick217056c2018-09-20 17:39:31 -0400957
Kevin Lubick006a6f32018-10-19 14:34:34 -0400958// Public API things that are newly declared in the JS should go here.
959// It's not enough to declare them above, because closure can still erase them
960// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400961CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
962
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500963CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400964
Kevin Lubick5b90b842018-10-17 07:57:18 -0400965CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400966CanvasKit.SkSurface.prototype.flush = function() {};
967CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800968CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400969CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400970
Alexander Khovansky3e119332018-11-15 02:01:19 +0300971CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400972CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300973
Kevin Lubickddd0a332018-12-12 10:35:13 -0500974CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
975
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400976CanvasKit.RSXFormBuilder.prototype.build = function() {};
977CanvasKit.RSXFormBuilder.prototype.delete = function() {};
978CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400979CanvasKit.RSXFormBuilder.prototype.set = function() {};
980
981CanvasKit.SkColorBuilder.prototype.build = function() {};
982CanvasKit.SkColorBuilder.prototype.delete = function() {};
983CanvasKit.SkColorBuilder.prototype.push = function() {};
984CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400985
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500986CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500987CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500988
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500989CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
990CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
991
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400992// Define StrokeOpts object
993var StrokeOpts = {};
994StrokeOpts.prototype.width;
995StrokeOpts.prototype.miter_limit;
996StrokeOpts.prototype.cap;
997StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500998StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400999
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001000// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001001var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001002HTMLCanvas.prototype.decodeImage = function() {};
1003HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001004HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001005HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001006HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001007HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001008
Elliot Evans28796192020-06-15 12:53:27 -06001009var ImageBitmapRenderingContext = {};
1010ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1011
Kevin Lubickb9db3902018-11-26 11:47:54 -05001012var CanvasRenderingContext2D = {};
1013CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1014CanvasRenderingContext2D.prototype.arc = function() {};
1015CanvasRenderingContext2D.prototype.arcTo = function() {};
1016CanvasRenderingContext2D.prototype.beginPath = function() {};
1017CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1018CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001019CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001020CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001021CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001022CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001023CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001024CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001025CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001026CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001027CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001028CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001029CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001030CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001031CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001032CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001033CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001034CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1035CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001036CanvasRenderingContext2D.prototype.lineTo = function() {};
1037CanvasRenderingContext2D.prototype.measureText = function() {};
1038CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001039CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001040CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1041CanvasRenderingContext2D.prototype.rect = function() {};
1042CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1043CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001044CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001045CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001046CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001047CanvasRenderingContext2D.prototype.scale = function() {};
1048CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001049CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001050CanvasRenderingContext2D.prototype.setTransform = function() {};
1051CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001052CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001053CanvasRenderingContext2D.prototype.strokeText = function() {};
1054CanvasRenderingContext2D.prototype.transform = function() {};
1055CanvasRenderingContext2D.prototype.translate = function() {};
1056
Kevin Lubicka40f8322018-12-17 16:01:36 -05001057var Path2D = {};
1058Path2D.prototype.addPath = function() {};
1059Path2D.prototype.arc = function() {};
1060Path2D.prototype.arcTo = function() {};
1061Path2D.prototype.bezierCurveTo = function() {};
1062Path2D.prototype.closePath = function() {};
1063Path2D.prototype.ellipse = function() {};
1064Path2D.prototype.lineTo = function() {};
1065Path2D.prototype.moveTo = function() {};
1066Path2D.prototype.quadraticCurveTo = function() {};
1067Path2D.prototype.rect = function() {};
1068
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001069var LinearCanvasGradient = {};
1070LinearCanvasGradient.prototype.addColorStop = function() {};
1071var RadialCanvasGradient = {};
1072RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001073var CanvasPattern = {};
1074CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001075
Kevin Lubick52b9f372018-12-04 13:57:36 -05001076var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001077 /**
1078 * @type {Uint8ClampedArray}
1079 */
1080 data: {},
1081 height: {},
1082 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001083};
1084
Kevin Lubickd29edd72018-12-07 08:29:52 -05001085var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001086 a: {},
1087 b: {},
1088 c: {},
1089 d: {},
1090 e: {},
1091 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001092};
1093
Kevin Lubick217056c2018-09-20 17:39:31 -04001094// 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 -05001095function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001096
1097// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1098// to override it in the puppeteer tests
1099var LibraryEGL = {
1100 contextAttributes: {
1101 majorVersion: {}
1102 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001103}