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