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