Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 25 | var CanvasKit = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 26 | // public API (i.e. things we declare in the pre-js file or in the cpp bindings) |
| 27 | Color: function() {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 28 | Color4f: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 29 | /** @return {CanvasKit.SkRect} */ |
| 30 | LTRBRect: function() {}, |
| 31 | /** @return {CanvasKit.SkRect} */ |
| 32 | XYWHRect: function() {}, |
| 33 | /** @return {CanvasKit.SkRRect} */ |
| 34 | RRectXY: function() {}, |
| 35 | /** @return {ImageData} */ |
| 36 | ImageData: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 37 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 38 | 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() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 49 | MakeOnScreenGLSurface: function() {}, |
| 50 | MakePathFromCmds: function() {}, |
| 51 | MakePathFromOp: function() {}, |
| 52 | MakePathFromSVGString: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 53 | MakeRenderTarget: function() {}, |
| 54 | MakeSkPicture: function() {}, |
| 55 | MakeSWCanvasSurface: function() {}, |
| 56 | MakeManagedAnimation: function() {}, |
| 57 | MakeParticles: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 58 | MakeSkVertices: function() {}, |
| 59 | MakeSurface: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 60 | MakeWebGLCanvasSurface: function() {}, |
| 61 | /** @return {TypedArray} */ |
| 62 | Malloc: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 63 | computeTonalColors: function() {}, |
| 64 | currentContext: function() {}, |
| 65 | getColorComponents: function() {}, |
| 66 | getDecodeCacheLimitBytes: function() {}, |
| 67 | getDecodeCacheUsageBytes: function() {}, |
| 68 | getSkDataBytes: function() {}, |
| 69 | multiplyByAlpha: function() {}, |
| 70 | parseColorString: function() {}, |
| 71 | setCurrentContext: function() {}, |
| 72 | setDecodeCacheLimitBytes: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 73 | |
Kevin Lubick | e70af51 | 2020-05-14 14:50:54 -0400 | [diff] [blame] | 74 | // Defined by emscripten. |
| 75 | createContext:function() {}, |
| 76 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 77 | // private API (i.e. things declared in the bindings that we use |
| 78 | // in the pre-js file) |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 79 | _computeTonalColors: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 80 | _MakeImage: function() {}, |
| 81 | _MakeLinearGradientShader: function() {}, |
| 82 | _MakePathFromCmds: function() {}, |
| 83 | _MakeRadialGradientShader: function() {}, |
Dan Field | 3d44f73 | 2020-03-16 09:17:30 -0700 | [diff] [blame] | 84 | _MakeSweepGradientShader: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 85 | _MakeManagedAnimation: function() {}, |
| 86 | _MakeParticles: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 87 | _MakeSkPicture: function() {}, |
| 88 | _MakeSkVertices: function() {}, |
| 89 | _MakeTwoPointConicalGradientShader: function() {}, |
| 90 | _decodeAnimatedImage: function() {}, |
| 91 | _decodeImage: function() {}, |
| 92 | _drawShapedText: function() {}, |
| 93 | _getRasterDirectSurface: function() {}, |
| 94 | _getRasterN32PremulSurface: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 95 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 96 | // The testing object is meant to expose internal functions |
| 97 | // for more fine-grained testing, e.g. parseColor |
| 98 | _testing: {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 99 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 100 | // Objects and properties on CanvasKit |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 101 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 102 | GrContext: { |
| 103 | // public API (from C++ bindings) |
| 104 | getResourceCacheLimitBytes: function() {}, |
| 105 | getResourceCacheUsageBytes: function() {}, |
| 106 | releaseResourcesAndAbandonContext: function() {}, |
| 107 | setResourceCacheLimitBytes: function() {}, |
| 108 | }, |
Kevin Lubick | cd54466 | 2019-03-22 15:41:36 -0400 | [diff] [blame] | 109 | |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 110 | ManagedAnimation: { |
| 111 | prototype: { |
| 112 | setColor: function() {}, |
| 113 | }, |
| 114 | }, |
| 115 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 116 | Paragraph: { |
| 117 | // public API (from C++ bindings) |
| 118 | didExceedMaxLines: function() {}, |
| 119 | getAlphabeticBaseline: function() {}, |
| 120 | getGlyphPositionAtCoordinate: function() {}, |
| 121 | getHeight: function() {}, |
| 122 | getIdeographicBaseline: function() {}, |
| 123 | getLongestLine: function() {}, |
| 124 | getMaxIntrinsicWidth: function() {}, |
| 125 | getMaxWidth: function() {}, |
| 126 | getMinIntrinsicWidth: function() {}, |
| 127 | getWordBoundary: function() {}, |
| 128 | layout: function() {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 129 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 130 | // private API |
| 131 | /** @return {Float32Array} */ |
| 132 | _getRectsForRange: function() {}, |
| 133 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 134 | |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 135 | ParagraphBuilder: { |
| 136 | Make: function() {}, |
| 137 | addText: function() {}, |
| 138 | build: function() {}, |
| 139 | pop: function() {}, |
| 140 | |
| 141 | prototype: { |
| 142 | pushStyle: function() {}, |
| 143 | }, |
| 144 | |
| 145 | // private API |
| 146 | _Make: function() {}, |
| 147 | _pushStyle: function() {}, |
| 148 | }, |
| 149 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 150 | SkRuntimeEffect: { |
| 151 | // public API (from C++ bindings) |
| 152 | Make: function() {}, |
Kevin Lubick | 4b5b645 | 2019-12-06 13:55:58 -0500 | [diff] [blame] | 153 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 154 | // private API |
| 155 | _makeShader: function() {}, |
| 156 | _makeShaderWithChildren: function() {}, |
| 157 | }, |
Kevin Lubick | 4b5b645 | 2019-12-06 13:55:58 -0500 | [diff] [blame] | 158 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 159 | ParagraphStyle: function() {}, |
| 160 | RSXFormBuilder: function() {}, |
| 161 | SkColorBuilder: function() {}, |
| 162 | SkRectBuilder: function() {}, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 163 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 164 | ShapedText: { |
| 165 | // public API (from C++ bindings) |
| 166 | getBounds: function() {}, |
| 167 | }, |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 168 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 169 | SkAnimatedImage: { |
| 170 | // public API (from C++ bindings) |
| 171 | decodeNextFrame: function() {}, |
| 172 | getFrameCount: function() {}, |
| 173 | getRepetitionCount: function() {}, |
| 174 | height: function() {}, |
| 175 | reset: function() {}, |
| 176 | width: function() {}, |
| 177 | }, |
Kevin Lubick | 6b921b7 | 2019-09-18 16:18:17 -0400 | [diff] [blame] | 178 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 179 | SkCanvas: { |
| 180 | // public API (from C++ bindings) |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 181 | clipPath: function() {}, |
| 182 | clipRRect: function() {}, |
| 183 | clipRect: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 184 | drawAnimatedImage: function() {}, |
| 185 | drawArc: function() {}, |
| 186 | drawCircle: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 187 | drawDRRect: function() {}, |
| 188 | drawImage: function() {}, |
| 189 | drawImageNine: function() {}, |
| 190 | drawImageRect: function() {}, |
| 191 | drawLine: function() {}, |
| 192 | drawOval: function() {}, |
| 193 | drawPaint: function() {}, |
| 194 | drawParagraph: function() {}, |
| 195 | drawPath: function() {}, |
| 196 | drawPicture: function() {}, |
| 197 | drawRRect: function() {}, |
| 198 | drawRect: function() {}, |
| 199 | drawRoundRect: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 200 | drawText: function() {}, |
| 201 | drawTextBlob: function() {}, |
| 202 | drawVertices: function() {}, |
| 203 | flush: function() {}, |
| 204 | getSaveCount: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 205 | makeSurface: function() {}, |
Nathaniel Nifong | 00de91c | 2020-05-06 16:22:33 -0400 | [diff] [blame] | 206 | markCTM: function() {}, |
| 207 | findMarkedCTM: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 208 | restore: function() {}, |
| 209 | restoreToCount: function() {}, |
| 210 | rotate: function() {}, |
| 211 | save: function() {}, |
Kevin Lubick | 7957d53 | 2020-03-16 18:08:32 +0000 | [diff] [blame] | 212 | saveLayer: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 213 | scale: function() {}, |
| 214 | skew: function() {}, |
| 215 | translate: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 216 | |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 217 | prototype: { |
| 218 | clear: function() {}, |
| 219 | drawColor: function() {}, |
| 220 | drawShadow: function() {}, |
| 221 | }, |
| 222 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 223 | // private API |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 224 | _clear: function() {}, |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 225 | _concat: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 226 | _drawAtlas: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 227 | _drawColor: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 228 | _drawPoints: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 229 | _drawShadow: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 230 | _drawSimpleText: function() {}, |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 231 | _getLocalToCamera: function() {}, |
| 232 | _getLocalToDevice: function() {}, |
| 233 | _getLocalToWorld: function() {}, |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 234 | _getTotalMatrix: function() {}, |
Nathaniel Nifong | 00de91c | 2020-05-06 16:22:33 -0400 | [diff] [blame] | 235 | _findMarkedCTM: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 236 | _readPixels: function() {}, |
| 237 | _writePixels: function() {}, |
| 238 | delete: function() {}, |
| 239 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 240 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 241 | SkColorFilter: { |
| 242 | // public API (from C++ bindings and JS interface) |
| 243 | MakeBlend: function() {}, |
| 244 | MakeCompose: function() {}, |
| 245 | MakeLerp: function() {}, |
| 246 | MakeLinearToSRGBGamma: function() {}, |
| 247 | MakeMatrix: function() {}, |
| 248 | MakeSRGBToLinearGamma: function() {}, |
| 249 | // private API (from C++ bindings) |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 250 | _MakeBlend: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 251 | _makeMatrix: function() {}, |
| 252 | }, |
Kevin Lubick | d372934 | 2019-09-12 11:11:25 -0400 | [diff] [blame] | 253 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 254 | SkColorMatrix: { |
| 255 | concat: function() {}, |
| 256 | identity: function() {}, |
| 257 | postTranslate: function() {}, |
| 258 | rotated: function() {}, |
| 259 | scaled: function() {}, |
| 260 | }, |
Kevin Lubick | d372934 | 2019-09-12 11:11:25 -0400 | [diff] [blame] | 261 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 262 | SkContourMeasureIter: { |
| 263 | next: function() {}, |
| 264 | }, |
Kevin Lubick | e59c167 | 2019-11-20 14:17:53 -0500 | [diff] [blame] | 265 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 266 | SkContourMeasure: { |
| 267 | getPosTan: function() {}, |
| 268 | getSegment: function() {}, |
| 269 | isClosed: function() {}, |
| 270 | length: function() {}, |
| 271 | }, |
Kevin Lubick | e59c167 | 2019-11-20 14:17:53 -0500 | [diff] [blame] | 272 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 273 | SkFont: { |
| 274 | // public API (from C++ bindings) |
| 275 | getScaleX: function() {}, |
| 276 | getSize: function() {}, |
| 277 | getSkewX: function() {}, |
| 278 | getTypeface: function() {}, |
| 279 | measureText: function() {}, |
| 280 | setHinting: function() {}, |
| 281 | setLinearMetrics: function() {}, |
| 282 | setScaleX: function() {}, |
| 283 | setSize: function() {}, |
| 284 | setSkewX: function() {}, |
| 285 | setSubpixel: function() {}, |
| 286 | setTypeface: function() {}, |
| 287 | // private API (from C++ bindings) |
| 288 | _getWidths: function() {}, |
| 289 | }, |
Kevin Lubick | 35ac038 | 2019-01-02 15:13:57 -0500 | [diff] [blame] | 290 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 291 | SkFontMgr: { |
| 292 | // public API (from C++ and JS bindings) |
| 293 | FromData: function() {}, |
| 294 | RefDefault: function() {}, |
| 295 | countFamilies: function() {}, |
| 296 | getFamilyName: function() {}, |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 297 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 298 | // private API |
| 299 | _makeTypefaceFromData: function() {}, |
| 300 | _fromData: function() {}, |
| 301 | }, |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 302 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 303 | SkImage: { |
| 304 | // public API (from C++ bindings) |
| 305 | height: function() {}, |
| 306 | width: function() {}, |
| 307 | // private API |
| 308 | _encodeToData: function() {}, |
| 309 | _encodeToDataWithFormat: function() {}, |
| 310 | _makeShader: function() {}, |
| 311 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 312 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 313 | SkImageFilter: { |
| 314 | MakeBlur: function() {}, |
| 315 | MakeColorFilter: function() {}, |
| 316 | MakeCompose: function() {}, |
| 317 | MakeMatrixTransform: function() {}, |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 318 | |
| 319 | // private API |
| 320 | _MakeMatrixTransform: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 321 | }, |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 322 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 323 | // These are defined in interface.js |
| 324 | SkM44: { |
| 325 | identity: function() {}, |
| 326 | invert: function() {}, |
| 327 | multiply: function() {}, |
| 328 | rotatedUnitSinCos: function() {}, |
| 329 | rotated: function() {}, |
| 330 | scaled: function() {}, |
| 331 | translated: function() {}, |
| 332 | lookat: function() {}, |
| 333 | perspective: function() {}, |
| 334 | rc: function() {}, |
| 335 | transpose: function() {}, |
| 336 | }, |
Nathaniel Nifong | 77798b4 | 2020-02-21 17:15:22 -0500 | [diff] [blame] | 337 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 338 | SkMatrix: { |
| 339 | identity: function() {}, |
| 340 | invert: function() {}, |
| 341 | mapPoints: function() {}, |
| 342 | multiply: function() {}, |
| 343 | rotated: function() {}, |
| 344 | scaled: function() {}, |
| 345 | skewed: function() {}, |
| 346 | translated: function() {}, |
| 347 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 348 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 349 | SkMaskFilter: { |
| 350 | MakeBlur: function() {}, |
| 351 | }, |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 352 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 353 | SkPaint: { |
| 354 | // public API (from C++ bindings) |
| 355 | /** @return {CanvasKit.SkPaint} */ |
| 356 | copy: function() {}, |
| 357 | getBlendMode: function() {}, |
| 358 | getColor: function() {}, |
| 359 | getFilterQuality: function() {}, |
| 360 | getStrokeCap: function() {}, |
| 361 | getStrokeJoin: function() {}, |
| 362 | getStrokeMiter: function() {}, |
| 363 | getStrokeWidth: function() {}, |
| 364 | setAntiAlias: function() {}, |
| 365 | setBlendMode: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 366 | setFilterQuality: function() {}, |
| 367 | setImageFilter: function() {}, |
| 368 | setMaskFilter: function() {}, |
| 369 | setPathEffect: function() {}, |
| 370 | setShader: function() {}, |
| 371 | setStrokeCap: function() {}, |
| 372 | setStrokeJoin: function() {}, |
| 373 | setStrokeMiter: function() {}, |
| 374 | setStrokeWidth: function() {}, |
| 375 | setStyle: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 376 | |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 377 | prototype: { |
| 378 | setColor: function() {}, |
| 379 | }, |
| 380 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 381 | // Private API |
| 382 | delete: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 383 | _getColor: function() {}, |
| 384 | _setColor: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 385 | }, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 386 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 387 | SkPathEffect: { |
Kevin Lubick | f279c63 | 2020-03-18 09:53:55 -0400 | [diff] [blame] | 388 | MakeCorner: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 389 | MakeDash: function() {}, |
Kevin Lubick | f279c63 | 2020-03-18 09:53:55 -0400 | [diff] [blame] | 390 | MakeDiscrete: function() {}, |
| 391 | |
| 392 | // Private C++ API |
| 393 | _MakeDash: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 394 | }, |
Nathaniel Nifong | 23b0ed9 | 2020-03-04 15:43:50 -0500 | [diff] [blame] | 395 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 396 | SkParticleEffect: { |
| 397 | // public API (from C++ bindings) |
| 398 | draw: function() {}, |
| 399 | getEffectUniform: function() {}, |
| 400 | getEffectUniformCount: function() {}, |
| 401 | getEffectUniformFloatCount: function() {}, |
| 402 | getEffectUniformName: function() {}, |
| 403 | getParticleUniformCount: function() {}, |
| 404 | getParticleUniformFloatCount: function() {}, |
| 405 | getParticleUniformName: function() {}, |
| 406 | getParticleUniform: function() {}, |
| 407 | setPosition: function() {}, |
| 408 | setRate: function() {}, |
| 409 | start: function() {}, |
| 410 | update: function() {}, |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 411 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 412 | // private API (from C++ bindings) |
| 413 | _effectUniformPtr: function() {}, |
| 414 | _particleUniformPtr: function() {}, |
| 415 | }, |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 416 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 417 | SkPath: { |
| 418 | // public API (from C++ bindings) |
| 419 | computeTightBounds: function() {}, |
| 420 | contains: function() {}, |
| 421 | /** @return {CanvasKit.SkPath} */ |
| 422 | copy: function() {}, |
| 423 | countPoints: function() {}, |
| 424 | equals: function() {}, |
| 425 | getBounds: function() {}, |
| 426 | getFillType: function() {}, |
| 427 | getPoint: function() {}, |
| 428 | isEmpty: function() {}, |
| 429 | isVolatile: function() {}, |
| 430 | reset: function() {}, |
| 431 | rewind: function() {}, |
| 432 | setFillType: function() {}, |
| 433 | setIsVolatile: function() {}, |
| 434 | toSVGString: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 435 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 436 | // private API |
| 437 | _addArc: function() {}, |
| 438 | _addOval: function() {}, |
| 439 | _addPath: function() {}, |
| 440 | _addRect: function() {}, |
| 441 | _addPoly: function() {}, |
| 442 | _addRoundRect: function() {}, |
| 443 | _arc: function() {}, |
| 444 | _arcTo: function() {}, |
| 445 | _close: function() {}, |
| 446 | _conicTo: function() {}, |
| 447 | _cubicTo: function() {}, |
| 448 | _dash: function() {}, |
| 449 | _lineTo: function() {}, |
| 450 | _moveTo: function() {}, |
| 451 | _op: function() {}, |
| 452 | _quadTo: function() {}, |
| 453 | _rArcTo: function() {}, |
| 454 | _rConicTo: function() {}, |
| 455 | _rCubicTo: function() {}, |
| 456 | _rLineTo: function() {}, |
| 457 | _rMoveTo: function() {}, |
| 458 | _rQuadTo: function() {}, |
| 459 | _rect: function() {}, |
| 460 | _simplify: function() {}, |
| 461 | _stroke: function() {}, |
| 462 | _transform: function() {}, |
| 463 | _trim: function() {}, |
| 464 | delete: function() {}, |
| 465 | dump: function() {}, |
| 466 | dumpHex: function() {}, |
| 467 | }, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 468 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 469 | SkPathMeasure: { |
| 470 | getLength: function() {}, |
| 471 | getSegment: function() {}, |
| 472 | getPosTan: function() {}, |
| 473 | isClosed: function() {}, |
| 474 | nextContour: function() {}, |
| 475 | }, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 476 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 477 | SkPicture: { |
| 478 | serialize: function() {}, |
| 479 | }, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 480 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 481 | SkPictureRecorder: { |
| 482 | beginRecording: function() {}, |
| 483 | finishRecordingAsPicture: function() {}, |
| 484 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 485 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 486 | SkRect: { |
| 487 | fLeft: {}, |
| 488 | fTop: {}, |
| 489 | fRight: {}, |
| 490 | fBottom: {}, |
| 491 | }, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 492 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 493 | SkRRect: { |
| 494 | rect: {}, |
| 495 | rx1: {}, |
| 496 | ry1: {}, |
| 497 | rx2: {}, |
| 498 | ry2: {}, |
| 499 | rx3: {}, |
| 500 | ry3: {}, |
| 501 | rx4: {}, |
| 502 | ry4: {}, |
| 503 | }, |
Kevin Lubick | 6283690 | 2019-12-09 09:04:26 -0500 | [diff] [blame] | 504 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 505 | SkShader: { |
| 506 | Blend: function() {}, |
| 507 | Color: function() {}, |
| 508 | Empty: function() {}, |
| 509 | Lerp: function() {}, |
Nathaniel Nifong | d96c3c7 | 2020-03-09 10:50:43 -0400 | [diff] [blame] | 510 | MakeLinearGradient: function() {}, |
| 511 | MakeRadialGradient: function() {}, |
| 512 | MakeTwoPointConicalGradient: function() {}, |
Dan Field | 3d44f73 | 2020-03-16 09:17:30 -0700 | [diff] [blame] | 513 | MakeSweepGradient: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 514 | |
| 515 | // private API (from C++ bindings) |
| 516 | _Color: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 517 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 518 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 519 | SkSurface: { |
| 520 | // public API (from C++ bindings) |
| 521 | /** @return {CanvasKit.SkCanvas} */ |
| 522 | getCanvas: function() {}, |
| 523 | /** @return {CanvasKit.SkImage} */ |
| 524 | makeImageSnapshot: function() {}, |
| 525 | makeSurface: function() {}, |
Nathaniel Nifong | ce1648f | 2020-05-11 08:24:16 -0400 | [diff] [blame] | 526 | reportBackendType: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 527 | grContext: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 528 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 529 | // private API |
| 530 | _flush: function() {}, |
| 531 | _getRasterN32PremulSurface: function() {}, |
| 532 | delete: function() {}, |
| 533 | }, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 534 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 535 | SkTextBlob: { |
| 536 | // public API (both C++ and JS bindings) |
| 537 | MakeFromRSXform: function() {}, |
| 538 | MakeFromText: function() {}, |
| 539 | MakeOnPath: function() {}, |
| 540 | // private API (from C++ bindings) |
| 541 | _MakeFromRSXform: function() {}, |
| 542 | _MakeFromText: function() {}, |
| 543 | }, |
Nathaniel Nifong | 77798b4 | 2020-02-21 17:15:22 -0500 | [diff] [blame] | 544 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 545 | // These are defined in interface.js |
| 546 | SkVector: { |
| 547 | add: function() {}, |
| 548 | sub: function() {}, |
| 549 | dot: function() {}, |
| 550 | cross: function() {}, |
| 551 | normalize: function() {}, |
| 552 | mulScalar: function() {}, |
| 553 | length: function() {}, |
| 554 | lengthSquared: function() {}, |
| 555 | dist: function() {}, |
| 556 | }, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 557 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 558 | SkVertices: { |
| 559 | // public API (from C++ bindings) |
| 560 | bounds: function() {}, |
| 561 | mode: function() {}, |
| 562 | uniqueID: function() {}, |
| 563 | vertexCount: function() {}, |
| 564 | }, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 565 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 566 | _SkVerticesBuilder: { |
| 567 | colors: function() {}, |
| 568 | detach: function() {}, |
| 569 | indices: function() {}, |
| 570 | positions: function() {}, |
| 571 | texCoords: function() {}, |
| 572 | }, |
Kevin Lubick | d6ba725 | 2019-06-03 14:38:05 -0400 | [diff] [blame] | 573 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 574 | TextStyle: function() {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 575 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 576 | // Constants and Enums |
| 577 | gpu: {}, |
| 578 | skottie: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 579 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 580 | TRANSPARENT: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 581 | BLACK: {}, |
| 582 | WHITE: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 583 | RED: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 584 | GREEN: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 585 | BLUE: {}, |
| 586 | YELLOW: {}, |
| 587 | CYAN: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 588 | MAGENTA: {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 589 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 590 | MOVE_VERB: {}, |
| 591 | LINE_VERB: {}, |
| 592 | QUAD_VERB: {}, |
| 593 | CONIC_VERB: {}, |
| 594 | CUBIC_VERB: {}, |
| 595 | CLOSE_VERB: {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 596 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 597 | NoDecoration: {}, |
| 598 | UnderlineDecoration: {}, |
| 599 | OverlineDecoration: {}, |
| 600 | LineThroughDecoration: {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 601 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 602 | SaveLayerInitWithPrevious: {}, |
| 603 | SaveLayerF16ColorType: {}, |
Kevin Lubick | 77d9b5c | 2019-10-29 10:48:26 -0400 | [diff] [blame] | 604 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 605 | Affinity: { |
| 606 | Upstream: {}, |
| 607 | Downstream: {}, |
| 608 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 609 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 610 | AlphaType: { |
| 611 | Opaque: {}, |
| 612 | Premul: {}, |
| 613 | Unpremul: {}, |
| 614 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 615 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 616 | BlendMode: { |
| 617 | Clear: {}, |
| 618 | Src: {}, |
| 619 | Dst: {}, |
| 620 | SrcOver: {}, |
| 621 | DstOver: {}, |
| 622 | SrcIn: {}, |
| 623 | DstIn: {}, |
| 624 | SrcOut: {}, |
| 625 | DstOut: {}, |
| 626 | SrcATop: {}, |
| 627 | DstATop: {}, |
| 628 | Xor: {}, |
| 629 | Plus: {}, |
| 630 | Modulate: {}, |
| 631 | Screen: {}, |
| 632 | Overlay: {}, |
| 633 | Darken: {}, |
| 634 | Lighten: {}, |
| 635 | ColorDodge: {}, |
| 636 | ColorBurn: {}, |
| 637 | HardLight: {}, |
| 638 | SoftLight: {}, |
| 639 | Difference: {}, |
| 640 | Exclusion: {}, |
| 641 | Multiply: {}, |
| 642 | Hue: {}, |
| 643 | Saturation: {}, |
| 644 | Color: {}, |
| 645 | Luminosity: {}, |
| 646 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 647 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 648 | BlurStyle: { |
| 649 | Normal: {}, |
| 650 | Solid: {}, |
| 651 | Outer: {}, |
| 652 | Inner: {}, |
| 653 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 654 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 655 | ClipOp: { |
| 656 | Difference: {}, |
| 657 | Intersect: {}, |
| 658 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 659 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 660 | ColorType: { |
| 661 | Alpha_8: {}, |
| 662 | RGB_565: {}, |
| 663 | ARGB_4444: {}, |
| 664 | RGBA_8888: {}, |
| 665 | RGB_888x: {}, |
| 666 | BGRA_8888: {}, |
| 667 | RGBA_1010102: {}, |
| 668 | RGB_101010x: {}, |
| 669 | Gray_8: {}, |
| 670 | RGBA_F16: {}, |
| 671 | RGBA_F32: {}, |
| 672 | }, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 673 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 674 | FillType: { |
| 675 | Winding: {}, |
| 676 | EvenOdd: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 677 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 678 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 679 | FilterQuality: { |
| 680 | None: {}, |
| 681 | Low: {}, |
| 682 | Medium: {}, |
| 683 | High: {}, |
| 684 | }, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 685 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 686 | FontSlant: { |
| 687 | Upright: {}, |
| 688 | Italic: {}, |
| 689 | Oblique: {}, |
| 690 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 691 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 692 | FontHinting: { |
| 693 | None: {}, |
| 694 | Slight: {}, |
| 695 | Normal: {}, |
| 696 | Full: {}, |
| 697 | }, |
Kevin Lubick | bde9fcc | 2020-02-28 08:09:08 -0500 | [diff] [blame] | 698 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 699 | FontWeight: { |
| 700 | Invisible: {}, |
| 701 | Thin: {}, |
| 702 | ExtraLight: {}, |
| 703 | Light: {}, |
| 704 | Normal: {}, |
| 705 | Medium: {}, |
| 706 | SemiBold: {}, |
| 707 | Bold: {}, |
| 708 | ExtraBold: {}, |
| 709 | Black: {}, |
| 710 | ExtraBlack: {}, |
| 711 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 712 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 713 | FontWidth: { |
| 714 | UltraCondensed: {}, |
| 715 | ExtraCondensed: {}, |
| 716 | Condensed: {}, |
| 717 | SemiCondensed: {}, |
| 718 | Normal: {}, |
| 719 | SemiExpanded: {}, |
| 720 | Expanded: {}, |
| 721 | ExtraExpanded: {}, |
| 722 | UltraExpanded: {}, |
| 723 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 724 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 725 | ImageFormat: { |
| 726 | PNG: {}, |
| 727 | JPEG: {}, |
| 728 | }, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 729 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 730 | PaintStyle: { |
| 731 | Fill: {}, |
| 732 | Stroke: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 733 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 734 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 735 | PathOp: { |
| 736 | Difference: {}, |
| 737 | Intersect: {}, |
| 738 | Union: {}, |
| 739 | XOR: {}, |
| 740 | ReverseDifference: {}, |
| 741 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 742 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 743 | PointMode: { |
| 744 | Points: {}, |
| 745 | Lines: {}, |
| 746 | Polygon: {}, |
| 747 | }, |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 748 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 749 | RectHeightStyle: { |
| 750 | Tight: {}, |
| 751 | Max: {}, |
| 752 | IncludeLineSpacingMiddle: {}, |
| 753 | IncludeLineSpacingTop: {}, |
| 754 | IncludeLineSpacingBottom: {}, |
| 755 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 756 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 757 | RectWidthStyle: { |
| 758 | Tight: {}, |
| 759 | Max: {}, |
| 760 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 761 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 762 | StrokeCap: { |
| 763 | Butt: {}, |
| 764 | Round: {}, |
| 765 | Square: {}, |
| 766 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 767 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 768 | StrokeJoin: { |
| 769 | Miter: {}, |
| 770 | Round: {}, |
| 771 | Bevel: {}, |
| 772 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 773 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 774 | TextAlign: { |
| 775 | Left: {}, |
| 776 | Right: {}, |
| 777 | Center: {}, |
| 778 | Justify: {}, |
| 779 | Start: {}, |
| 780 | End: {}, |
| 781 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 782 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 783 | TextDirection: { |
| 784 | LTR: {}, |
| 785 | RTL: {}, |
| 786 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 787 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 788 | TileMode: { |
| 789 | Clamp: {}, |
| 790 | Repeat: {}, |
| 791 | Mirror: {}, |
| 792 | Decal: {}, |
| 793 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 794 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 795 | VertexMode: { |
| 796 | Triangles: {}, |
| 797 | TrianglesStrip: {}, |
| 798 | TriangleFan: {}, |
| 799 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 800 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 801 | // Things Enscriptem adds for us |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 802 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 803 | /** |
| 804 | * @type {Float32Array} |
| 805 | */ |
| 806 | HEAPF32: {}, |
| 807 | /** |
| 808 | * @type {Float64Array} |
| 809 | */ |
| 810 | HEAPF64: {}, |
| 811 | /** |
| 812 | * @type {Uint8Array} |
| 813 | */ |
| 814 | HEAPU8: {}, |
| 815 | /** |
| 816 | * @type {Uint16Array} |
| 817 | */ |
| 818 | HEAPU16: {}, |
| 819 | /** |
| 820 | * @type {Uint32Array} |
| 821 | */ |
| 822 | HEAPU32: {}, |
| 823 | /** |
| 824 | * @type {Int8Array} |
| 825 | */ |
| 826 | HEAP8: {}, |
| 827 | /** |
| 828 | * @type {Int16Array} |
| 829 | */ |
| 830 | HEAP16: {}, |
| 831 | /** |
| 832 | * @type {Int32Array} |
| 833 | */ |
| 834 | HEAP32: {}, |
Kevin Lubick | fa5a138 | 2019-10-09 10:46:14 -0400 | [diff] [blame] | 835 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 836 | _malloc: function() {}, |
| 837 | _free: function() {}, |
| 838 | onRuntimeInitialized: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 839 | }; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 840 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 841 | // Public API things that are newly declared in the JS should go here. |
| 842 | // It's not enough to declare them above, because closure can still erase them |
| 843 | // unless they go on the prototype. |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 844 | CanvasKit.Paragraph.prototype.getRectsForRange = function() {}; |
| 845 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 846 | CanvasKit.SkPath.prototype.addArc = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 847 | CanvasKit.SkPath.prototype.addOval = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 848 | CanvasKit.SkPath.prototype.addPath = function() {}; |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 849 | CanvasKit.SkPath.prototype.addPoly = function() {}; |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 850 | CanvasKit.SkPath.prototype.addRect = function() {}; |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 851 | CanvasKit.SkPath.prototype.addRoundRect = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 852 | CanvasKit.SkPath.prototype.arc = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 853 | CanvasKit.SkPath.prototype.arcTo = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 854 | CanvasKit.SkPath.prototype.close = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 855 | CanvasKit.SkPath.prototype.conicTo = function() {}; |
| 856 | CanvasKit.SkPath.prototype.cubicTo = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 857 | CanvasKit.SkPath.prototype.dash = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 858 | CanvasKit.SkPath.prototype.lineTo = function() {}; |
| 859 | CanvasKit.SkPath.prototype.moveTo = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 860 | CanvasKit.SkPath.prototype.offset = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 861 | CanvasKit.SkPath.prototype.op = function() {}; |
| 862 | CanvasKit.SkPath.prototype.quadTo = function() {}; |
Kevin Lubick | 79b7134 | 2019-11-01 14:36:52 -0400 | [diff] [blame] | 863 | CanvasKit.SkPath.prototype.rArcTo = function() {}; |
| 864 | CanvasKit.SkPath.prototype.rConicTo = function() {}; |
| 865 | CanvasKit.SkPath.prototype.rCubicTo = function() {}; |
| 866 | CanvasKit.SkPath.prototype.rLineTo = function() {}; |
| 867 | CanvasKit.SkPath.prototype.rMoveTo = function() {}; |
| 868 | CanvasKit.SkPath.prototype.rQuadTo = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 869 | CanvasKit.SkPath.prototype.rect = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 870 | CanvasKit.SkPath.prototype.simplify = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 871 | CanvasKit.SkPath.prototype.stroke = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 872 | CanvasKit.SkPath.prototype.transform = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 873 | CanvasKit.SkPath.prototype.trim = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 874 | |
Kevin Lubick | a4f218d | 2020-01-14 08:39:09 -0500 | [diff] [blame] | 875 | CanvasKit.SkPicture.prototype.saveAsFile = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 876 | |
Kevin Lubick | 5b90b84 | 2018-10-17 07:57:18 -0400 | [diff] [blame] | 877 | CanvasKit.SkSurface.prototype.dispose = function() {}; |
Kevin Lubick | 359a7e3 | 2019-03-19 09:34:37 -0400 | [diff] [blame] | 878 | CanvasKit.SkSurface.prototype.flush = function() {}; |
| 879 | CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {}; |
Bryce Thomas | 2c5b856 | 2020-01-22 13:49:41 -0800 | [diff] [blame] | 880 | CanvasKit.SkSurface.prototype.drawOnce = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 881 | CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {}; |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 882 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 883 | CanvasKit.SkImage.prototype.encodeToData = function() {}; |
Kevin Lubick | a064c28 | 2019-04-04 09:28:53 -0400 | [diff] [blame] | 884 | CanvasKit.SkImage.prototype.makeShader = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 885 | |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 886 | CanvasKit.SkCanvas.prototype.concat = function() {}; |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 887 | CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 888 | CanvasKit.SkCanvas.prototype.drawAtlas = function() {}; |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 889 | CanvasKit.SkCanvas.prototype.drawPoints = function() {}; |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 890 | CanvasKit.SkCanvas.prototype.drawText = function() {}; |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 891 | CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {}; |
| 892 | CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {}; |
| 893 | CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {}; |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 894 | CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 895 | /** @return {Uint8Array} */ |
| 896 | CanvasKit.SkCanvas.prototype.readPixels = function() {}; |
| 897 | CanvasKit.SkCanvas.prototype.writePixels = function() {}; |
| 898 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 899 | CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {}; |
| 900 | |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 901 | CanvasKit.SkFont.prototype.getWidths = function() {}; |
| 902 | |
| 903 | CanvasKit.RSXFormBuilder.prototype.build = function() {}; |
| 904 | CanvasKit.RSXFormBuilder.prototype.delete = function() {}; |
| 905 | CanvasKit.RSXFormBuilder.prototype.push = function() {}; |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 906 | CanvasKit.RSXFormBuilder.prototype.set = function() {}; |
| 907 | |
| 908 | CanvasKit.SkColorBuilder.prototype.build = function() {}; |
| 909 | CanvasKit.SkColorBuilder.prototype.delete = function() {}; |
| 910 | CanvasKit.SkColorBuilder.prototype.push = function() {}; |
| 911 | CanvasKit.SkColorBuilder.prototype.set = function() {}; |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 912 | |
Kevin Lubick | f3d6c36 | 2020-01-06 08:11:52 -0500 | [diff] [blame] | 913 | CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {}; |
Kevin Lubick | ecd8762 | 2020-02-22 07:37:33 -0500 | [diff] [blame] | 914 | CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {}; |
Kevin Lubick | 4b5b645 | 2019-12-06 13:55:58 -0500 | [diff] [blame] | 915 | |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 916 | CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {}; |
| 917 | CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {}; |
| 918 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 919 | // Define StrokeOpts object |
| 920 | var StrokeOpts = {}; |
| 921 | StrokeOpts.prototype.width; |
| 922 | StrokeOpts.prototype.miter_limit; |
| 923 | StrokeOpts.prototype.cap; |
| 924 | StrokeOpts.prototype.join; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 925 | StrokeOpts.prototype.precision; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 926 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 927 | // Define everything created in the canvas2d spec here |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 928 | var HTMLCanvas = {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 929 | HTMLCanvas.prototype.decodeImage = function() {}; |
| 930 | HTMLCanvas.prototype.dispose = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 931 | HTMLCanvas.prototype.getContext = function() {}; |
Kevin Lubick | 8e4a331 | 2018-12-14 15:03:41 -0500 | [diff] [blame] | 932 | HTMLCanvas.prototype.loadFont = function() {}; |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 933 | HTMLCanvas.prototype.makePath2D = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 934 | HTMLCanvas.prototype.toDataURL = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 935 | |
| 936 | var CanvasRenderingContext2D = {}; |
| 937 | CanvasRenderingContext2D.prototype.addHitRegion = function() {}; |
| 938 | CanvasRenderingContext2D.prototype.arc = function() {}; |
| 939 | CanvasRenderingContext2D.prototype.arcTo = function() {}; |
| 940 | CanvasRenderingContext2D.prototype.beginPath = function() {}; |
| 941 | CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; |
| 942 | CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 943 | CanvasRenderingContext2D.prototype.clearRect = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 944 | CanvasRenderingContext2D.prototype.clip = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 945 | CanvasRenderingContext2D.prototype.closePath = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 946 | CanvasRenderingContext2D.prototype.createImageData = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 947 | CanvasRenderingContext2D.prototype.createLinearGradient = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 948 | CanvasRenderingContext2D.prototype.createPattern = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 949 | CanvasRenderingContext2D.prototype.createRadialGradient = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 950 | CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 951 | CanvasRenderingContext2D.prototype.drawImage = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 952 | CanvasRenderingContext2D.prototype.ellipse = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 953 | CanvasRenderingContext2D.prototype.fill = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 954 | CanvasRenderingContext2D.prototype.fillRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 955 | CanvasRenderingContext2D.prototype.fillText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 956 | CanvasRenderingContext2D.prototype.getImageData = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 957 | CanvasRenderingContext2D.prototype.getLineDash = function() {}; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 958 | CanvasRenderingContext2D.prototype.isPointInPath = function() {}; |
| 959 | CanvasRenderingContext2D.prototype.isPointInStroke = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 960 | CanvasRenderingContext2D.prototype.lineTo = function() {}; |
| 961 | CanvasRenderingContext2D.prototype.measureText = function() {}; |
| 962 | CanvasRenderingContext2D.prototype.moveTo = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 963 | CanvasRenderingContext2D.prototype.putImageData = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 964 | CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; |
| 965 | CanvasRenderingContext2D.prototype.rect = function() {}; |
| 966 | CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; |
| 967 | CanvasRenderingContext2D.prototype.resetTransform = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 968 | CanvasRenderingContext2D.prototype.restore = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 969 | CanvasRenderingContext2D.prototype.rotate = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 970 | CanvasRenderingContext2D.prototype.save = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 971 | CanvasRenderingContext2D.prototype.scale = function() {}; |
| 972 | CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 973 | CanvasRenderingContext2D.prototype.setLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 974 | CanvasRenderingContext2D.prototype.setTransform = function() {}; |
| 975 | CanvasRenderingContext2D.prototype.stroke = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 976 | CanvasRenderingContext2D.prototype.strokeRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 977 | CanvasRenderingContext2D.prototype.strokeText = function() {}; |
| 978 | CanvasRenderingContext2D.prototype.transform = function() {}; |
| 979 | CanvasRenderingContext2D.prototype.translate = function() {}; |
| 980 | |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 981 | var Path2D = {}; |
| 982 | Path2D.prototype.addPath = function() {}; |
| 983 | Path2D.prototype.arc = function() {}; |
| 984 | Path2D.prototype.arcTo = function() {}; |
| 985 | Path2D.prototype.bezierCurveTo = function() {}; |
| 986 | Path2D.prototype.closePath = function() {}; |
| 987 | Path2D.prototype.ellipse = function() {}; |
| 988 | Path2D.prototype.lineTo = function() {}; |
| 989 | Path2D.prototype.moveTo = function() {}; |
| 990 | Path2D.prototype.quadraticCurveTo = function() {}; |
| 991 | Path2D.prototype.rect = function() {}; |
| 992 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 993 | var LinearCanvasGradient = {}; |
| 994 | LinearCanvasGradient.prototype.addColorStop = function() {}; |
| 995 | var RadialCanvasGradient = {}; |
| 996 | RadialCanvasGradient.prototype.addColorStop = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 997 | var CanvasPattern = {}; |
| 998 | CanvasPattern.prototype.setTransform = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 999 | |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1000 | var ImageData = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 1001 | /** |
| 1002 | * @type {Uint8ClampedArray} |
| 1003 | */ |
| 1004 | data: {}, |
| 1005 | height: {}, |
| 1006 | width: {}, |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1007 | }; |
| 1008 | |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1009 | var DOMMatrix = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 1010 | a: {}, |
| 1011 | b: {}, |
| 1012 | c: {}, |
| 1013 | d: {}, |
| 1014 | e: {}, |
| 1015 | f: {}, |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1016 | }; |
| 1017 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1018 | // Not sure why this is needed - might be a bug in emsdk that this isn't properly declared. |
Kevin Lubick | 6fccc9d | 2018-11-20 15:55:10 -0500 | [diff] [blame] | 1019 | function loadWebAssemblyModule() {}; |