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