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 | b1ebbb1 | 2020-05-26 13:10:20 -0400 | [diff] [blame^] | 262 | SkColorSpace: { |
| 263 | Equals: function() {}, |
| 264 | SRGB: {}, |
| 265 | DISPLAY_P3: {}, |
| 266 | ADOBE_RGB: {}, |
| 267 | // private API (from C++ bindings) |
| 268 | _MakeSRGB: function() {}, |
| 269 | _MakeDisplayP3: function() {}, |
| 270 | _MakeAdobeRGB: function() {}, |
| 271 | }, |
| 272 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 273 | SkContourMeasureIter: { |
| 274 | next: function() {}, |
| 275 | }, |
Kevin Lubick | e59c167 | 2019-11-20 14:17:53 -0500 | [diff] [blame] | 276 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 277 | SkContourMeasure: { |
| 278 | getPosTan: function() {}, |
| 279 | getSegment: function() {}, |
| 280 | isClosed: function() {}, |
| 281 | length: function() {}, |
| 282 | }, |
Kevin Lubick | e59c167 | 2019-11-20 14:17:53 -0500 | [diff] [blame] | 283 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 284 | SkFont: { |
| 285 | // public API (from C++ bindings) |
| 286 | getScaleX: function() {}, |
| 287 | getSize: function() {}, |
| 288 | getSkewX: function() {}, |
| 289 | getTypeface: function() {}, |
| 290 | measureText: function() {}, |
| 291 | setHinting: function() {}, |
| 292 | setLinearMetrics: function() {}, |
| 293 | setScaleX: function() {}, |
| 294 | setSize: function() {}, |
| 295 | setSkewX: function() {}, |
| 296 | setSubpixel: function() {}, |
| 297 | setTypeface: function() {}, |
| 298 | // private API (from C++ bindings) |
| 299 | _getWidths: function() {}, |
| 300 | }, |
Kevin Lubick | 35ac038 | 2019-01-02 15:13:57 -0500 | [diff] [blame] | 301 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 302 | SkFontMgr: { |
| 303 | // public API (from C++ and JS bindings) |
| 304 | FromData: function() {}, |
| 305 | RefDefault: function() {}, |
| 306 | countFamilies: function() {}, |
| 307 | getFamilyName: function() {}, |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 308 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 309 | // private API |
| 310 | _makeTypefaceFromData: function() {}, |
| 311 | _fromData: function() {}, |
| 312 | }, |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 313 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 314 | SkImage: { |
| 315 | // public API (from C++ bindings) |
| 316 | height: function() {}, |
| 317 | width: function() {}, |
| 318 | // private API |
| 319 | _encodeToData: function() {}, |
| 320 | _encodeToDataWithFormat: function() {}, |
| 321 | _makeShader: function() {}, |
| 322 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 323 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 324 | SkImageFilter: { |
| 325 | MakeBlur: function() {}, |
| 326 | MakeColorFilter: function() {}, |
| 327 | MakeCompose: function() {}, |
| 328 | MakeMatrixTransform: function() {}, |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 329 | |
| 330 | // private API |
| 331 | _MakeMatrixTransform: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 332 | }, |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 333 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 334 | // These are defined in interface.js |
| 335 | SkM44: { |
| 336 | identity: function() {}, |
| 337 | invert: function() {}, |
| 338 | multiply: function() {}, |
| 339 | rotatedUnitSinCos: function() {}, |
| 340 | rotated: function() {}, |
| 341 | scaled: function() {}, |
| 342 | translated: function() {}, |
| 343 | lookat: function() {}, |
| 344 | perspective: function() {}, |
| 345 | rc: function() {}, |
| 346 | transpose: function() {}, |
| 347 | }, |
Nathaniel Nifong | 77798b4 | 2020-02-21 17:15:22 -0500 | [diff] [blame] | 348 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 349 | SkMatrix: { |
| 350 | identity: function() {}, |
| 351 | invert: function() {}, |
| 352 | mapPoints: function() {}, |
| 353 | multiply: function() {}, |
| 354 | rotated: function() {}, |
| 355 | scaled: function() {}, |
| 356 | skewed: function() {}, |
| 357 | translated: function() {}, |
| 358 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 359 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 360 | SkMaskFilter: { |
| 361 | MakeBlur: function() {}, |
| 362 | }, |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 363 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 364 | SkPaint: { |
| 365 | // public API (from C++ bindings) |
| 366 | /** @return {CanvasKit.SkPaint} */ |
| 367 | copy: function() {}, |
| 368 | getBlendMode: function() {}, |
| 369 | getColor: function() {}, |
| 370 | getFilterQuality: function() {}, |
| 371 | getStrokeCap: function() {}, |
| 372 | getStrokeJoin: function() {}, |
| 373 | getStrokeMiter: function() {}, |
| 374 | getStrokeWidth: function() {}, |
| 375 | setAntiAlias: function() {}, |
| 376 | setBlendMode: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 377 | setFilterQuality: function() {}, |
| 378 | setImageFilter: function() {}, |
| 379 | setMaskFilter: function() {}, |
| 380 | setPathEffect: function() {}, |
| 381 | setShader: function() {}, |
| 382 | setStrokeCap: function() {}, |
| 383 | setStrokeJoin: function() {}, |
| 384 | setStrokeMiter: function() {}, |
| 385 | setStrokeWidth: function() {}, |
| 386 | setStyle: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 387 | |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 388 | prototype: { |
| 389 | setColor: function() {}, |
| 390 | }, |
| 391 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 392 | // Private API |
| 393 | delete: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 394 | _getColor: function() {}, |
| 395 | _setColor: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 396 | }, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 397 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 398 | SkPathEffect: { |
Kevin Lubick | f279c63 | 2020-03-18 09:53:55 -0400 | [diff] [blame] | 399 | MakeCorner: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 400 | MakeDash: function() {}, |
Kevin Lubick | f279c63 | 2020-03-18 09:53:55 -0400 | [diff] [blame] | 401 | MakeDiscrete: function() {}, |
| 402 | |
| 403 | // Private C++ API |
| 404 | _MakeDash: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 405 | }, |
Nathaniel Nifong | 23b0ed9 | 2020-03-04 15:43:50 -0500 | [diff] [blame] | 406 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 407 | SkParticleEffect: { |
| 408 | // public API (from C++ bindings) |
| 409 | draw: function() {}, |
| 410 | getEffectUniform: function() {}, |
| 411 | getEffectUniformCount: function() {}, |
| 412 | getEffectUniformFloatCount: function() {}, |
| 413 | getEffectUniformName: function() {}, |
| 414 | getParticleUniformCount: function() {}, |
| 415 | getParticleUniformFloatCount: function() {}, |
| 416 | getParticleUniformName: function() {}, |
| 417 | getParticleUniform: function() {}, |
| 418 | setPosition: function() {}, |
| 419 | setRate: function() {}, |
| 420 | start: function() {}, |
| 421 | update: function() {}, |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 422 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 423 | // private API (from C++ bindings) |
| 424 | _effectUniformPtr: function() {}, |
| 425 | _particleUniformPtr: function() {}, |
| 426 | }, |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 427 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 428 | SkPath: { |
| 429 | // public API (from C++ bindings) |
| 430 | computeTightBounds: function() {}, |
| 431 | contains: function() {}, |
| 432 | /** @return {CanvasKit.SkPath} */ |
| 433 | copy: function() {}, |
| 434 | countPoints: function() {}, |
| 435 | equals: function() {}, |
| 436 | getBounds: function() {}, |
| 437 | getFillType: function() {}, |
| 438 | getPoint: function() {}, |
| 439 | isEmpty: function() {}, |
| 440 | isVolatile: function() {}, |
| 441 | reset: function() {}, |
| 442 | rewind: function() {}, |
| 443 | setFillType: function() {}, |
| 444 | setIsVolatile: function() {}, |
| 445 | toSVGString: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 446 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 447 | // private API |
| 448 | _addArc: function() {}, |
| 449 | _addOval: function() {}, |
| 450 | _addPath: function() {}, |
| 451 | _addRect: function() {}, |
| 452 | _addPoly: function() {}, |
| 453 | _addRoundRect: function() {}, |
| 454 | _arc: function() {}, |
| 455 | _arcTo: function() {}, |
| 456 | _close: function() {}, |
| 457 | _conicTo: function() {}, |
| 458 | _cubicTo: function() {}, |
| 459 | _dash: function() {}, |
| 460 | _lineTo: function() {}, |
| 461 | _moveTo: function() {}, |
| 462 | _op: function() {}, |
| 463 | _quadTo: function() {}, |
| 464 | _rArcTo: function() {}, |
| 465 | _rConicTo: function() {}, |
| 466 | _rCubicTo: function() {}, |
| 467 | _rLineTo: function() {}, |
| 468 | _rMoveTo: function() {}, |
| 469 | _rQuadTo: function() {}, |
| 470 | _rect: function() {}, |
| 471 | _simplify: function() {}, |
| 472 | _stroke: function() {}, |
| 473 | _transform: function() {}, |
| 474 | _trim: function() {}, |
| 475 | delete: function() {}, |
| 476 | dump: function() {}, |
| 477 | dumpHex: function() {}, |
| 478 | }, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 479 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 480 | SkPathMeasure: { |
| 481 | getLength: function() {}, |
| 482 | getSegment: function() {}, |
| 483 | getPosTan: function() {}, |
| 484 | isClosed: function() {}, |
| 485 | nextContour: function() {}, |
| 486 | }, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 487 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 488 | SkPicture: { |
| 489 | serialize: function() {}, |
| 490 | }, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 491 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 492 | SkPictureRecorder: { |
| 493 | beginRecording: function() {}, |
| 494 | finishRecordingAsPicture: function() {}, |
| 495 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 496 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 497 | SkRect: { |
| 498 | fLeft: {}, |
| 499 | fTop: {}, |
| 500 | fRight: {}, |
| 501 | fBottom: {}, |
| 502 | }, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 503 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 504 | SkRRect: { |
| 505 | rect: {}, |
| 506 | rx1: {}, |
| 507 | ry1: {}, |
| 508 | rx2: {}, |
| 509 | ry2: {}, |
| 510 | rx3: {}, |
| 511 | ry3: {}, |
| 512 | rx4: {}, |
| 513 | ry4: {}, |
| 514 | }, |
Kevin Lubick | 6283690 | 2019-12-09 09:04:26 -0500 | [diff] [blame] | 515 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 516 | SkShader: { |
| 517 | Blend: function() {}, |
| 518 | Color: function() {}, |
| 519 | Empty: function() {}, |
| 520 | Lerp: function() {}, |
Nathaniel Nifong | d96c3c7 | 2020-03-09 10:50:43 -0400 | [diff] [blame] | 521 | MakeLinearGradient: function() {}, |
| 522 | MakeRadialGradient: function() {}, |
| 523 | MakeTwoPointConicalGradient: function() {}, |
Dan Field | 3d44f73 | 2020-03-16 09:17:30 -0700 | [diff] [blame] | 524 | MakeSweepGradient: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 525 | |
| 526 | // private API (from C++ bindings) |
| 527 | _Color: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 528 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 529 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 530 | SkSurface: { |
| 531 | // public API (from C++ bindings) |
| 532 | /** @return {CanvasKit.SkCanvas} */ |
| 533 | getCanvas: function() {}, |
Nathaniel Nifong | b1ebbb1 | 2020-05-26 13:10:20 -0400 | [diff] [blame^] | 534 | imageInfo: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 535 | /** @return {CanvasKit.SkImage} */ |
| 536 | makeImageSnapshot: function() {}, |
| 537 | makeSurface: function() {}, |
Nathaniel Nifong | ce1648f | 2020-05-11 08:24:16 -0400 | [diff] [blame] | 538 | reportBackendType: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 539 | grContext: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 540 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 541 | // private API |
| 542 | _flush: function() {}, |
| 543 | _getRasterN32PremulSurface: function() {}, |
| 544 | delete: function() {}, |
| 545 | }, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 546 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 547 | SkTextBlob: { |
| 548 | // public API (both C++ and JS bindings) |
| 549 | MakeFromRSXform: function() {}, |
| 550 | MakeFromText: function() {}, |
| 551 | MakeOnPath: function() {}, |
| 552 | // private API (from C++ bindings) |
| 553 | _MakeFromRSXform: function() {}, |
| 554 | _MakeFromText: function() {}, |
| 555 | }, |
Nathaniel Nifong | 77798b4 | 2020-02-21 17:15:22 -0500 | [diff] [blame] | 556 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 557 | // These are defined in interface.js |
| 558 | SkVector: { |
| 559 | add: function() {}, |
| 560 | sub: function() {}, |
| 561 | dot: function() {}, |
| 562 | cross: function() {}, |
| 563 | normalize: function() {}, |
| 564 | mulScalar: function() {}, |
| 565 | length: function() {}, |
| 566 | lengthSquared: function() {}, |
| 567 | dist: function() {}, |
| 568 | }, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 569 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 570 | SkVertices: { |
| 571 | // public API (from C++ bindings) |
| 572 | bounds: function() {}, |
| 573 | mode: function() {}, |
| 574 | uniqueID: function() {}, |
| 575 | vertexCount: function() {}, |
| 576 | }, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 577 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 578 | _SkVerticesBuilder: { |
| 579 | colors: function() {}, |
| 580 | detach: function() {}, |
| 581 | indices: function() {}, |
| 582 | positions: function() {}, |
| 583 | texCoords: function() {}, |
| 584 | }, |
Kevin Lubick | d6ba725 | 2019-06-03 14:38:05 -0400 | [diff] [blame] | 585 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 586 | TextStyle: function() {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 587 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 588 | // Constants and Enums |
| 589 | gpu: {}, |
| 590 | skottie: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 591 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 592 | TRANSPARENT: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 593 | BLACK: {}, |
| 594 | WHITE: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 595 | RED: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 596 | GREEN: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 597 | BLUE: {}, |
| 598 | YELLOW: {}, |
| 599 | CYAN: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 600 | MAGENTA: {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 601 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 602 | MOVE_VERB: {}, |
| 603 | LINE_VERB: {}, |
| 604 | QUAD_VERB: {}, |
| 605 | CONIC_VERB: {}, |
| 606 | CUBIC_VERB: {}, |
| 607 | CLOSE_VERB: {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 608 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 609 | NoDecoration: {}, |
| 610 | UnderlineDecoration: {}, |
| 611 | OverlineDecoration: {}, |
| 612 | LineThroughDecoration: {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 613 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 614 | SaveLayerInitWithPrevious: {}, |
| 615 | SaveLayerF16ColorType: {}, |
Kevin Lubick | 77d9b5c | 2019-10-29 10:48:26 -0400 | [diff] [blame] | 616 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 617 | Affinity: { |
| 618 | Upstream: {}, |
| 619 | Downstream: {}, |
| 620 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 621 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 622 | AlphaType: { |
| 623 | Opaque: {}, |
| 624 | Premul: {}, |
| 625 | Unpremul: {}, |
| 626 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 627 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 628 | BlendMode: { |
| 629 | Clear: {}, |
| 630 | Src: {}, |
| 631 | Dst: {}, |
| 632 | SrcOver: {}, |
| 633 | DstOver: {}, |
| 634 | SrcIn: {}, |
| 635 | DstIn: {}, |
| 636 | SrcOut: {}, |
| 637 | DstOut: {}, |
| 638 | SrcATop: {}, |
| 639 | DstATop: {}, |
| 640 | Xor: {}, |
| 641 | Plus: {}, |
| 642 | Modulate: {}, |
| 643 | Screen: {}, |
| 644 | Overlay: {}, |
| 645 | Darken: {}, |
| 646 | Lighten: {}, |
| 647 | ColorDodge: {}, |
| 648 | ColorBurn: {}, |
| 649 | HardLight: {}, |
| 650 | SoftLight: {}, |
| 651 | Difference: {}, |
| 652 | Exclusion: {}, |
| 653 | Multiply: {}, |
| 654 | Hue: {}, |
| 655 | Saturation: {}, |
| 656 | Color: {}, |
| 657 | Luminosity: {}, |
| 658 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 659 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 660 | BlurStyle: { |
| 661 | Normal: {}, |
| 662 | Solid: {}, |
| 663 | Outer: {}, |
| 664 | Inner: {}, |
| 665 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 666 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 667 | ClipOp: { |
| 668 | Difference: {}, |
| 669 | Intersect: {}, |
| 670 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 671 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 672 | ColorType: { |
| 673 | Alpha_8: {}, |
| 674 | RGB_565: {}, |
| 675 | ARGB_4444: {}, |
| 676 | RGBA_8888: {}, |
| 677 | RGB_888x: {}, |
| 678 | BGRA_8888: {}, |
| 679 | RGBA_1010102: {}, |
| 680 | RGB_101010x: {}, |
| 681 | Gray_8: {}, |
| 682 | RGBA_F16: {}, |
| 683 | RGBA_F32: {}, |
| 684 | }, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 685 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 686 | FillType: { |
| 687 | Winding: {}, |
| 688 | EvenOdd: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 689 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 690 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 691 | FilterQuality: { |
| 692 | None: {}, |
| 693 | Low: {}, |
| 694 | Medium: {}, |
| 695 | High: {}, |
| 696 | }, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 697 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 698 | FontSlant: { |
| 699 | Upright: {}, |
| 700 | Italic: {}, |
| 701 | Oblique: {}, |
| 702 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 703 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 704 | FontHinting: { |
| 705 | None: {}, |
| 706 | Slight: {}, |
| 707 | Normal: {}, |
| 708 | Full: {}, |
| 709 | }, |
Kevin Lubick | bde9fcc | 2020-02-28 08:09:08 -0500 | [diff] [blame] | 710 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 711 | FontWeight: { |
| 712 | Invisible: {}, |
| 713 | Thin: {}, |
| 714 | ExtraLight: {}, |
| 715 | Light: {}, |
| 716 | Normal: {}, |
| 717 | Medium: {}, |
| 718 | SemiBold: {}, |
| 719 | Bold: {}, |
| 720 | ExtraBold: {}, |
| 721 | Black: {}, |
| 722 | ExtraBlack: {}, |
| 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 | FontWidth: { |
| 726 | UltraCondensed: {}, |
| 727 | ExtraCondensed: {}, |
| 728 | Condensed: {}, |
| 729 | SemiCondensed: {}, |
| 730 | Normal: {}, |
| 731 | SemiExpanded: {}, |
| 732 | Expanded: {}, |
| 733 | ExtraExpanded: {}, |
| 734 | UltraExpanded: {}, |
| 735 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 736 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 737 | ImageFormat: { |
| 738 | PNG: {}, |
| 739 | JPEG: {}, |
| 740 | }, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 741 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 742 | PaintStyle: { |
| 743 | Fill: {}, |
| 744 | Stroke: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 745 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 746 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 747 | PathOp: { |
| 748 | Difference: {}, |
| 749 | Intersect: {}, |
| 750 | Union: {}, |
| 751 | XOR: {}, |
| 752 | ReverseDifference: {}, |
| 753 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 754 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 755 | PointMode: { |
| 756 | Points: {}, |
| 757 | Lines: {}, |
| 758 | Polygon: {}, |
| 759 | }, |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 760 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 761 | RectHeightStyle: { |
| 762 | Tight: {}, |
| 763 | Max: {}, |
| 764 | IncludeLineSpacingMiddle: {}, |
| 765 | IncludeLineSpacingTop: {}, |
| 766 | IncludeLineSpacingBottom: {}, |
| 767 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 768 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 769 | RectWidthStyle: { |
| 770 | Tight: {}, |
| 771 | Max: {}, |
| 772 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 773 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 774 | StrokeCap: { |
| 775 | Butt: {}, |
| 776 | Round: {}, |
| 777 | Square: {}, |
| 778 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 779 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 780 | StrokeJoin: { |
| 781 | Miter: {}, |
| 782 | Round: {}, |
| 783 | Bevel: {}, |
| 784 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 785 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 786 | TextAlign: { |
| 787 | Left: {}, |
| 788 | Right: {}, |
| 789 | Center: {}, |
| 790 | Justify: {}, |
| 791 | Start: {}, |
| 792 | End: {}, |
| 793 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 794 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 795 | TextDirection: { |
| 796 | LTR: {}, |
| 797 | RTL: {}, |
| 798 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 799 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 800 | TileMode: { |
| 801 | Clamp: {}, |
| 802 | Repeat: {}, |
| 803 | Mirror: {}, |
| 804 | Decal: {}, |
| 805 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 806 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 807 | VertexMode: { |
| 808 | Triangles: {}, |
| 809 | TrianglesStrip: {}, |
| 810 | TriangleFan: {}, |
| 811 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 812 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 813 | // Things Enscriptem adds for us |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 814 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 815 | /** |
| 816 | * @type {Float32Array} |
| 817 | */ |
| 818 | HEAPF32: {}, |
| 819 | /** |
| 820 | * @type {Float64Array} |
| 821 | */ |
| 822 | HEAPF64: {}, |
| 823 | /** |
| 824 | * @type {Uint8Array} |
| 825 | */ |
| 826 | HEAPU8: {}, |
| 827 | /** |
| 828 | * @type {Uint16Array} |
| 829 | */ |
| 830 | HEAPU16: {}, |
| 831 | /** |
| 832 | * @type {Uint32Array} |
| 833 | */ |
| 834 | HEAPU32: {}, |
| 835 | /** |
| 836 | * @type {Int8Array} |
| 837 | */ |
| 838 | HEAP8: {}, |
| 839 | /** |
| 840 | * @type {Int16Array} |
| 841 | */ |
| 842 | HEAP16: {}, |
| 843 | /** |
| 844 | * @type {Int32Array} |
| 845 | */ |
| 846 | HEAP32: {}, |
Kevin Lubick | fa5a138 | 2019-10-09 10:46:14 -0400 | [diff] [blame] | 847 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 848 | _malloc: function() {}, |
| 849 | _free: function() {}, |
| 850 | onRuntimeInitialized: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 851 | }; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 852 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 853 | // Public API things that are newly declared in the JS should go here. |
| 854 | // It's not enough to declare them above, because closure can still erase them |
| 855 | // unless they go on the prototype. |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 856 | CanvasKit.Paragraph.prototype.getRectsForRange = function() {}; |
| 857 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 858 | CanvasKit.SkPath.prototype.addArc = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 859 | CanvasKit.SkPath.prototype.addOval = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 860 | CanvasKit.SkPath.prototype.addPath = function() {}; |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 861 | CanvasKit.SkPath.prototype.addPoly = function() {}; |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 862 | CanvasKit.SkPath.prototype.addRect = function() {}; |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 863 | CanvasKit.SkPath.prototype.addRoundRect = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 864 | CanvasKit.SkPath.prototype.arc = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 865 | CanvasKit.SkPath.prototype.arcTo = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 866 | CanvasKit.SkPath.prototype.close = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 867 | CanvasKit.SkPath.prototype.conicTo = function() {}; |
| 868 | CanvasKit.SkPath.prototype.cubicTo = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 869 | CanvasKit.SkPath.prototype.dash = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 870 | CanvasKit.SkPath.prototype.lineTo = function() {}; |
| 871 | CanvasKit.SkPath.prototype.moveTo = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 872 | CanvasKit.SkPath.prototype.offset = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 873 | CanvasKit.SkPath.prototype.op = function() {}; |
| 874 | CanvasKit.SkPath.prototype.quadTo = function() {}; |
Kevin Lubick | 79b7134 | 2019-11-01 14:36:52 -0400 | [diff] [blame] | 875 | CanvasKit.SkPath.prototype.rArcTo = function() {}; |
| 876 | CanvasKit.SkPath.prototype.rConicTo = function() {}; |
| 877 | CanvasKit.SkPath.prototype.rCubicTo = function() {}; |
| 878 | CanvasKit.SkPath.prototype.rLineTo = function() {}; |
| 879 | CanvasKit.SkPath.prototype.rMoveTo = function() {}; |
| 880 | CanvasKit.SkPath.prototype.rQuadTo = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 881 | CanvasKit.SkPath.prototype.rect = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 882 | CanvasKit.SkPath.prototype.simplify = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 883 | CanvasKit.SkPath.prototype.stroke = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 884 | CanvasKit.SkPath.prototype.transform = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 885 | CanvasKit.SkPath.prototype.trim = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 886 | |
Kevin Lubick | a4f218d | 2020-01-14 08:39:09 -0500 | [diff] [blame] | 887 | CanvasKit.SkPicture.prototype.saveAsFile = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 888 | |
Kevin Lubick | 5b90b84 | 2018-10-17 07:57:18 -0400 | [diff] [blame] | 889 | CanvasKit.SkSurface.prototype.dispose = function() {}; |
Kevin Lubick | 359a7e3 | 2019-03-19 09:34:37 -0400 | [diff] [blame] | 890 | CanvasKit.SkSurface.prototype.flush = function() {}; |
| 891 | CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {}; |
Bryce Thomas | 2c5b856 | 2020-01-22 13:49:41 -0800 | [diff] [blame] | 892 | CanvasKit.SkSurface.prototype.drawOnce = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 893 | CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {}; |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 894 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 895 | CanvasKit.SkImage.prototype.encodeToData = function() {}; |
Kevin Lubick | a064c28 | 2019-04-04 09:28:53 -0400 | [diff] [blame] | 896 | CanvasKit.SkImage.prototype.makeShader = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 897 | |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 898 | CanvasKit.SkCanvas.prototype.concat = function() {}; |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 899 | CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 900 | CanvasKit.SkCanvas.prototype.drawAtlas = function() {}; |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 901 | CanvasKit.SkCanvas.prototype.drawPoints = function() {}; |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 902 | CanvasKit.SkCanvas.prototype.drawText = function() {}; |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 903 | CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {}; |
| 904 | CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {}; |
| 905 | CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {}; |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 906 | CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 907 | /** @return {Uint8Array} */ |
| 908 | CanvasKit.SkCanvas.prototype.readPixels = function() {}; |
| 909 | CanvasKit.SkCanvas.prototype.writePixels = function() {}; |
| 910 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 911 | CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {}; |
| 912 | |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 913 | CanvasKit.SkFont.prototype.getWidths = function() {}; |
| 914 | |
| 915 | CanvasKit.RSXFormBuilder.prototype.build = function() {}; |
| 916 | CanvasKit.RSXFormBuilder.prototype.delete = function() {}; |
| 917 | CanvasKit.RSXFormBuilder.prototype.push = function() {}; |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 918 | CanvasKit.RSXFormBuilder.prototype.set = function() {}; |
| 919 | |
| 920 | CanvasKit.SkColorBuilder.prototype.build = function() {}; |
| 921 | CanvasKit.SkColorBuilder.prototype.delete = function() {}; |
| 922 | CanvasKit.SkColorBuilder.prototype.push = function() {}; |
| 923 | CanvasKit.SkColorBuilder.prototype.set = function() {}; |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 924 | |
Kevin Lubick | f3d6c36 | 2020-01-06 08:11:52 -0500 | [diff] [blame] | 925 | CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {}; |
Kevin Lubick | ecd8762 | 2020-02-22 07:37:33 -0500 | [diff] [blame] | 926 | CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {}; |
Kevin Lubick | 4b5b645 | 2019-12-06 13:55:58 -0500 | [diff] [blame] | 927 | |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 928 | CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {}; |
| 929 | CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {}; |
| 930 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 931 | // Define StrokeOpts object |
| 932 | var StrokeOpts = {}; |
| 933 | StrokeOpts.prototype.width; |
| 934 | StrokeOpts.prototype.miter_limit; |
| 935 | StrokeOpts.prototype.cap; |
| 936 | StrokeOpts.prototype.join; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 937 | StrokeOpts.prototype.precision; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 938 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 939 | // Define everything created in the canvas2d spec here |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 940 | var HTMLCanvas = {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 941 | HTMLCanvas.prototype.decodeImage = function() {}; |
| 942 | HTMLCanvas.prototype.dispose = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 943 | HTMLCanvas.prototype.getContext = function() {}; |
Kevin Lubick | 8e4a331 | 2018-12-14 15:03:41 -0500 | [diff] [blame] | 944 | HTMLCanvas.prototype.loadFont = function() {}; |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 945 | HTMLCanvas.prototype.makePath2D = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 946 | HTMLCanvas.prototype.toDataURL = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 947 | |
| 948 | var CanvasRenderingContext2D = {}; |
| 949 | CanvasRenderingContext2D.prototype.addHitRegion = function() {}; |
| 950 | CanvasRenderingContext2D.prototype.arc = function() {}; |
| 951 | CanvasRenderingContext2D.prototype.arcTo = function() {}; |
| 952 | CanvasRenderingContext2D.prototype.beginPath = function() {}; |
| 953 | CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; |
| 954 | CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 955 | CanvasRenderingContext2D.prototype.clearRect = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 956 | CanvasRenderingContext2D.prototype.clip = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 957 | CanvasRenderingContext2D.prototype.closePath = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 958 | CanvasRenderingContext2D.prototype.createImageData = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 959 | CanvasRenderingContext2D.prototype.createLinearGradient = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 960 | CanvasRenderingContext2D.prototype.createPattern = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 961 | CanvasRenderingContext2D.prototype.createRadialGradient = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 962 | CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 963 | CanvasRenderingContext2D.prototype.drawImage = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 964 | CanvasRenderingContext2D.prototype.ellipse = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 965 | CanvasRenderingContext2D.prototype.fill = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 966 | CanvasRenderingContext2D.prototype.fillRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 967 | CanvasRenderingContext2D.prototype.fillText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 968 | CanvasRenderingContext2D.prototype.getImageData = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 969 | CanvasRenderingContext2D.prototype.getLineDash = function() {}; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 970 | CanvasRenderingContext2D.prototype.isPointInPath = function() {}; |
| 971 | CanvasRenderingContext2D.prototype.isPointInStroke = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 972 | CanvasRenderingContext2D.prototype.lineTo = function() {}; |
| 973 | CanvasRenderingContext2D.prototype.measureText = function() {}; |
| 974 | CanvasRenderingContext2D.prototype.moveTo = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 975 | CanvasRenderingContext2D.prototype.putImageData = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 976 | CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; |
| 977 | CanvasRenderingContext2D.prototype.rect = function() {}; |
| 978 | CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; |
| 979 | CanvasRenderingContext2D.prototype.resetTransform = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 980 | CanvasRenderingContext2D.prototype.restore = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 981 | CanvasRenderingContext2D.prototype.rotate = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 982 | CanvasRenderingContext2D.prototype.save = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 983 | CanvasRenderingContext2D.prototype.scale = function() {}; |
| 984 | CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 985 | CanvasRenderingContext2D.prototype.setLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 986 | CanvasRenderingContext2D.prototype.setTransform = function() {}; |
| 987 | CanvasRenderingContext2D.prototype.stroke = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 988 | CanvasRenderingContext2D.prototype.strokeRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 989 | CanvasRenderingContext2D.prototype.strokeText = function() {}; |
| 990 | CanvasRenderingContext2D.prototype.transform = function() {}; |
| 991 | CanvasRenderingContext2D.prototype.translate = function() {}; |
| 992 | |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 993 | var Path2D = {}; |
| 994 | Path2D.prototype.addPath = function() {}; |
| 995 | Path2D.prototype.arc = function() {}; |
| 996 | Path2D.prototype.arcTo = function() {}; |
| 997 | Path2D.prototype.bezierCurveTo = function() {}; |
| 998 | Path2D.prototype.closePath = function() {}; |
| 999 | Path2D.prototype.ellipse = function() {}; |
| 1000 | Path2D.prototype.lineTo = function() {}; |
| 1001 | Path2D.prototype.moveTo = function() {}; |
| 1002 | Path2D.prototype.quadraticCurveTo = function() {}; |
| 1003 | Path2D.prototype.rect = function() {}; |
| 1004 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 1005 | var LinearCanvasGradient = {}; |
| 1006 | LinearCanvasGradient.prototype.addColorStop = function() {}; |
| 1007 | var RadialCanvasGradient = {}; |
| 1008 | RadialCanvasGradient.prototype.addColorStop = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1009 | var CanvasPattern = {}; |
| 1010 | CanvasPattern.prototype.setTransform = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 1011 | |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1012 | var ImageData = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 1013 | /** |
| 1014 | * @type {Uint8ClampedArray} |
| 1015 | */ |
| 1016 | data: {}, |
| 1017 | height: {}, |
| 1018 | width: {}, |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1019 | }; |
| 1020 | |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1021 | var DOMMatrix = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 1022 | a: {}, |
| 1023 | b: {}, |
| 1024 | c: {}, |
| 1025 | d: {}, |
| 1026 | e: {}, |
| 1027 | f: {}, |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1028 | }; |
| 1029 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1030 | // 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] | 1031 | function loadWebAssemblyModule() {}; |