Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1 | /* |
| 2 | * This externs file prevents the Closure JS compiler from minifying away |
| 3 | * names of objects created by Emscripten. |
| 4 | * Basically, by defining empty objects and functions here, Closure will |
| 5 | * know not to rename them. This is needed because of our pre-js files, |
| 6 | * that is, the JS we hand-write to bundle into the output. That JS will be |
| 7 | * hit by the closure compiler and thus needs to know about what functions |
| 8 | * have special names and should not be minified. |
| 9 | * |
| 10 | * Emscripten does not support automatically generating an externs file, so we |
| 11 | * do it by hand. The general process is to write some JS code, and then put any |
| 12 | * calls to CanvasKit or related things in here. Running ./compile.sh and then |
| 13 | * looking at the minified results or running the Release trybot should |
| 14 | * verify nothing was missed. Optionally, looking directly at the minified |
| 15 | * pathkit.js can be useful when developing locally. |
| 16 | * |
| 17 | * Docs: |
| 18 | * https://github.com/cljsjs/packages/wiki/Creating-Externs |
| 19 | * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System |
| 20 | * |
| 21 | * Example externs: |
| 22 | * https://github.com/google/closure-compiler/tree/master/externs |
| 23 | */ |
| 24 | |
| 25 | var CanvasKit = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 26 | // public API (i.e. things we declare in the pre-js file or in the cpp bindings) |
| 27 | Color: function() {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 28 | Color4f: function() {}, |
Kevin Lubick | 93f1a38 | 2020-06-02 16:15:23 -0400 | [diff] [blame] | 29 | ColorAsInt: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 30 | /** @return {CanvasKit.SkRect} */ |
| 31 | LTRBRect: function() {}, |
| 32 | /** @return {CanvasKit.SkRect} */ |
| 33 | XYWHRect: function() {}, |
| 34 | /** @return {CanvasKit.SkRRect} */ |
| 35 | RRectXY: function() {}, |
| 36 | /** @return {ImageData} */ |
| 37 | ImageData: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 38 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 39 | GetWebGLContext: function() {}, |
| 40 | MakeBlurMaskFilter: function() {}, |
| 41 | MakeCanvas: function() {}, |
| 42 | MakeCanvasSurface: function() {}, |
| 43 | MakeGrContext: function() {}, |
| 44 | /** @return {CanvasKit.SkAnimatedImage} */ |
| 45 | MakeAnimatedImageFromEncoded: function() {}, |
| 46 | /** @return {CanvasKit.SkImage} */ |
| 47 | MakeImage: function() {}, |
| 48 | /** @return {CanvasKit.SkImage} */ |
| 49 | MakeImageFromEncoded: function() {}, |
Elliot Evans | 2879619 | 2020-06-15 12:53:27 -0600 | [diff] [blame] | 50 | MakeImageFromCanvasImageSource: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 51 | MakeOnScreenGLSurface: function() {}, |
| 52 | MakePathFromCmds: function() {}, |
| 53 | MakePathFromOp: function() {}, |
| 54 | MakePathFromSVGString: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 55 | MakeRenderTarget: function() {}, |
| 56 | MakeSkPicture: function() {}, |
| 57 | MakeSWCanvasSurface: function() {}, |
| 58 | MakeManagedAnimation: function() {}, |
| 59 | MakeParticles: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 60 | MakeSkVertices: function() {}, |
| 61 | MakeSurface: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 62 | MakeWebGLCanvasSurface: function() {}, |
| 63 | /** @return {TypedArray} */ |
| 64 | Malloc: function() {}, |
Kevin Lubick | cf11892 | 2020-05-28 14:43:38 -0400 | [diff] [blame] | 65 | Free: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 66 | computeTonalColors: function() {}, |
| 67 | currentContext: function() {}, |
| 68 | getColorComponents: function() {}, |
| 69 | getDecodeCacheLimitBytes: function() {}, |
| 70 | getDecodeCacheUsageBytes: function() {}, |
| 71 | getSkDataBytes: function() {}, |
| 72 | multiplyByAlpha: function() {}, |
| 73 | parseColorString: function() {}, |
| 74 | setCurrentContext: function() {}, |
| 75 | setDecodeCacheLimitBytes: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 76 | |
Kevin Lubick | e70af51 | 2020-05-14 14:50:54 -0400 | [diff] [blame] | 77 | // Defined by emscripten. |
| 78 | createContext:function() {}, |
| 79 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 80 | // private API (i.e. things declared in the bindings that we use |
| 81 | // in the pre-js file) |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 82 | _computeTonalColors: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 83 | _MakeImage: function() {}, |
| 84 | _MakeLinearGradientShader: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 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() {}, |
Nathaniel Nifong | 6130d50 | 2020-07-06 19:50:13 -0400 | [diff] [blame] | 342 | mustInvert: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 343 | multiply: function() {}, |
| 344 | rotatedUnitSinCos: function() {}, |
| 345 | rotated: function() {}, |
| 346 | scaled: function() {}, |
| 347 | translated: function() {}, |
| 348 | lookat: function() {}, |
| 349 | perspective: function() {}, |
| 350 | rc: function() {}, |
| 351 | transpose: function() {}, |
Nathaniel Nifong | 6130d50 | 2020-07-06 19:50:13 -0400 | [diff] [blame] | 352 | setupCamera: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 353 | }, |
Nathaniel Nifong | 77798b4 | 2020-02-21 17:15:22 -0500 | [diff] [blame] | 354 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 355 | SkMatrix: { |
| 356 | identity: function() {}, |
| 357 | invert: function() {}, |
| 358 | mapPoints: function() {}, |
| 359 | multiply: function() {}, |
| 360 | rotated: function() {}, |
| 361 | scaled: function() {}, |
| 362 | skewed: function() {}, |
| 363 | translated: function() {}, |
| 364 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 365 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 366 | SkMaskFilter: { |
| 367 | MakeBlur: function() {}, |
| 368 | }, |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 369 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 370 | SkPaint: { |
| 371 | // public API (from C++ bindings) |
| 372 | /** @return {CanvasKit.SkPaint} */ |
| 373 | copy: function() {}, |
| 374 | getBlendMode: function() {}, |
| 375 | getColor: function() {}, |
| 376 | getFilterQuality: function() {}, |
| 377 | getStrokeCap: function() {}, |
| 378 | getStrokeJoin: function() {}, |
| 379 | getStrokeMiter: function() {}, |
| 380 | getStrokeWidth: function() {}, |
| 381 | setAntiAlias: function() {}, |
| 382 | setBlendMode: function() {}, |
Kevin Lubick | 93f1a38 | 2020-06-02 16:15:23 -0400 | [diff] [blame] | 383 | setColorInt: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 384 | setFilterQuality: function() {}, |
| 385 | setImageFilter: function() {}, |
| 386 | setMaskFilter: function() {}, |
| 387 | setPathEffect: function() {}, |
| 388 | setShader: function() {}, |
| 389 | setStrokeCap: function() {}, |
| 390 | setStrokeJoin: function() {}, |
| 391 | setStrokeMiter: function() {}, |
| 392 | setStrokeWidth: function() {}, |
| 393 | setStyle: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 394 | |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 395 | prototype: { |
| 396 | setColor: function() {}, |
Kevin Lubick | 93f1a38 | 2020-06-02 16:15:23 -0400 | [diff] [blame] | 397 | setColorComponents: function() {}, |
| 398 | setColorInt: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 399 | }, |
| 400 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 401 | // Private API |
| 402 | delete: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 403 | _getColor: function() {}, |
| 404 | _setColor: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 405 | }, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 406 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 407 | SkPathEffect: { |
Kevin Lubick | f279c63 | 2020-03-18 09:53:55 -0400 | [diff] [blame] | 408 | MakeCorner: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 409 | MakeDash: function() {}, |
Kevin Lubick | f279c63 | 2020-03-18 09:53:55 -0400 | [diff] [blame] | 410 | MakeDiscrete: function() {}, |
| 411 | |
| 412 | // Private C++ API |
| 413 | _MakeDash: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 414 | }, |
Nathaniel Nifong | 23b0ed9 | 2020-03-04 15:43:50 -0500 | [diff] [blame] | 415 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 416 | SkParticleEffect: { |
| 417 | // public API (from C++ bindings) |
| 418 | draw: function() {}, |
| 419 | getEffectUniform: function() {}, |
| 420 | getEffectUniformCount: function() {}, |
| 421 | getEffectUniformFloatCount: function() {}, |
| 422 | getEffectUniformName: function() {}, |
| 423 | getParticleUniformCount: function() {}, |
| 424 | getParticleUniformFloatCount: function() {}, |
| 425 | getParticleUniformName: function() {}, |
| 426 | getParticleUniform: function() {}, |
| 427 | setPosition: function() {}, |
| 428 | setRate: function() {}, |
| 429 | start: function() {}, |
| 430 | update: function() {}, |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 431 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 432 | // private API (from C++ bindings) |
| 433 | _effectUniformPtr: function() {}, |
| 434 | _particleUniformPtr: function() {}, |
| 435 | }, |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 436 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 437 | SkPath: { |
Kevin Lubick | d9b9e5e | 2020-06-23 16:58:10 -0400 | [diff] [blame] | 438 | // public API (from C++ and JS bindings) |
| 439 | MakeFromCmds: function() {}, |
| 440 | MakeFromVerbsPointsWeights: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 441 | computeTightBounds: function() {}, |
| 442 | contains: function() {}, |
| 443 | /** @return {CanvasKit.SkPath} */ |
| 444 | copy: function() {}, |
| 445 | countPoints: function() {}, |
| 446 | equals: function() {}, |
| 447 | getBounds: function() {}, |
| 448 | getFillType: function() {}, |
| 449 | getPoint: function() {}, |
| 450 | isEmpty: function() {}, |
| 451 | isVolatile: function() {}, |
| 452 | reset: function() {}, |
| 453 | rewind: function() {}, |
| 454 | setFillType: function() {}, |
| 455 | setIsVolatile: function() {}, |
Kevin Lubick | d9b9e5e | 2020-06-23 16:58:10 -0400 | [diff] [blame] | 456 | toCmds: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 457 | toSVGString: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 458 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 459 | // private API |
Kevin Lubick | d9b9e5e | 2020-06-23 16:58:10 -0400 | [diff] [blame] | 460 | _MakeFromCmds: function() {}, |
| 461 | _MakeFromVerbsPointsWeights: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 462 | _addArc: function() {}, |
| 463 | _addOval: function() {}, |
| 464 | _addPath: function() {}, |
| 465 | _addRect: function() {}, |
| 466 | _addPoly: function() {}, |
| 467 | _addRoundRect: function() {}, |
Kevin Lubick | d9b9e5e | 2020-06-23 16:58:10 -0400 | [diff] [blame] | 468 | _addVerbsPointsWeights: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 469 | _arc: function() {}, |
| 470 | _arcTo: function() {}, |
Nathaniel Nifong | d0c9d0c | 2020-07-15 16:46:17 -0400 | [diff] [blame] | 471 | _arcToOval: function() {}, |
| 472 | _arcToTangent: function() {}, |
| 473 | _arcToRotated: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 474 | _close: function() {}, |
| 475 | _conicTo: function() {}, |
| 476 | _cubicTo: function() {}, |
| 477 | _dash: function() {}, |
| 478 | _lineTo: function() {}, |
| 479 | _moveTo: function() {}, |
| 480 | _op: function() {}, |
| 481 | _quadTo: function() {}, |
| 482 | _rArcTo: function() {}, |
| 483 | _rConicTo: function() {}, |
| 484 | _rCubicTo: function() {}, |
| 485 | _rLineTo: function() {}, |
| 486 | _rMoveTo: function() {}, |
| 487 | _rQuadTo: function() {}, |
| 488 | _rect: function() {}, |
| 489 | _simplify: function() {}, |
| 490 | _stroke: function() {}, |
| 491 | _transform: function() {}, |
| 492 | _trim: function() {}, |
| 493 | delete: function() {}, |
| 494 | dump: function() {}, |
| 495 | dumpHex: function() {}, |
| 496 | }, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 497 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 498 | SkPathMeasure: { |
| 499 | getLength: function() {}, |
| 500 | getSegment: function() {}, |
| 501 | getPosTan: function() {}, |
| 502 | isClosed: function() {}, |
| 503 | nextContour: function() {}, |
| 504 | }, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 505 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 506 | SkPicture: { |
| 507 | serialize: function() {}, |
| 508 | }, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 509 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 510 | SkPictureRecorder: { |
| 511 | beginRecording: function() {}, |
| 512 | finishRecordingAsPicture: function() {}, |
| 513 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 514 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 515 | SkRect: { |
| 516 | fLeft: {}, |
| 517 | fTop: {}, |
| 518 | fRight: {}, |
| 519 | fBottom: {}, |
| 520 | }, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 521 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 522 | SkRRect: { |
| 523 | rect: {}, |
| 524 | rx1: {}, |
| 525 | ry1: {}, |
| 526 | rx2: {}, |
| 527 | ry2: {}, |
| 528 | rx3: {}, |
| 529 | ry3: {}, |
| 530 | rx4: {}, |
| 531 | ry4: {}, |
| 532 | }, |
Kevin Lubick | 6283690 | 2019-12-09 09:04:26 -0500 | [diff] [blame] | 533 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 534 | SkShader: { |
| 535 | Blend: function() {}, |
| 536 | Color: function() {}, |
| 537 | Empty: function() {}, |
| 538 | Lerp: function() {}, |
Nathaniel Nifong | d96c3c7 | 2020-03-09 10:50:43 -0400 | [diff] [blame] | 539 | MakeLinearGradient: function() {}, |
| 540 | MakeRadialGradient: function() {}, |
| 541 | MakeTwoPointConicalGradient: function() {}, |
Dan Field | 3d44f73 | 2020-03-16 09:17:30 -0700 | [diff] [blame] | 542 | MakeSweepGradient: function() {}, |
Nathaniel Nifong | 1bedbeb | 2020-05-04 16:46:17 -0400 | [diff] [blame] | 543 | |
| 544 | // private API (from C++ bindings) |
| 545 | _Color: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 546 | }, |
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 | SkSurface: { |
| 549 | // public API (from C++ bindings) |
| 550 | /** @return {CanvasKit.SkCanvas} */ |
| 551 | getCanvas: function() {}, |
Nathaniel Nifong | b1ebbb1 | 2020-05-26 13:10:20 -0400 | [diff] [blame] | 552 | imageInfo: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 553 | /** @return {CanvasKit.SkImage} */ |
| 554 | makeImageSnapshot: function() {}, |
| 555 | makeSurface: function() {}, |
Chris Dalton | 312669e | 2020-06-19 09:45:57 -0600 | [diff] [blame] | 556 | sampleCnt: function() {}, |
Nathaniel Nifong | 2d7afd4 | 2020-07-17 10:28:36 -0400 | [diff] [blame] | 557 | reportBackendTypeIsGPU: function() {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 558 | grContext: {}, |
Nathaniel Nifong | a237f9e | 2020-07-17 15:20:44 -0400 | [diff] [blame^] | 559 | openGLversion: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 560 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 561 | // private API |
| 562 | _flush: function() {}, |
| 563 | _getRasterN32PremulSurface: function() {}, |
| 564 | delete: function() {}, |
| 565 | }, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 566 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 567 | SkTextBlob: { |
| 568 | // public API (both C++ and JS bindings) |
| 569 | MakeFromRSXform: function() {}, |
| 570 | MakeFromText: function() {}, |
| 571 | MakeOnPath: function() {}, |
| 572 | // private API (from C++ bindings) |
| 573 | _MakeFromRSXform: function() {}, |
| 574 | _MakeFromText: function() {}, |
| 575 | }, |
Nathaniel Nifong | 77798b4 | 2020-02-21 17:15:22 -0500 | [diff] [blame] | 576 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 577 | // These are defined in interface.js |
| 578 | SkVector: { |
| 579 | add: function() {}, |
| 580 | sub: function() {}, |
| 581 | dot: function() {}, |
| 582 | cross: function() {}, |
| 583 | normalize: function() {}, |
| 584 | mulScalar: function() {}, |
| 585 | length: function() {}, |
| 586 | lengthSquared: function() {}, |
| 587 | dist: function() {}, |
| 588 | }, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 589 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 590 | SkVertices: { |
| 591 | // public API (from C++ bindings) |
| 592 | bounds: function() {}, |
| 593 | mode: function() {}, |
| 594 | uniqueID: function() {}, |
| 595 | vertexCount: function() {}, |
| 596 | }, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 597 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 598 | _SkVerticesBuilder: { |
| 599 | colors: function() {}, |
| 600 | detach: function() {}, |
| 601 | indices: function() {}, |
| 602 | positions: function() {}, |
| 603 | texCoords: function() {}, |
| 604 | }, |
Kevin Lubick | d6ba725 | 2019-06-03 14:38:05 -0400 | [diff] [blame] | 605 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 606 | TextStyle: function() {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 607 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 608 | // Constants and Enums |
| 609 | gpu: {}, |
| 610 | skottie: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 611 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 612 | TRANSPARENT: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 613 | BLACK: {}, |
| 614 | WHITE: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 615 | RED: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 616 | GREEN: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 617 | BLUE: {}, |
| 618 | YELLOW: {}, |
| 619 | CYAN: {}, |
Nathaniel Nifong | e5d3254 | 2020-03-26 09:27:48 -0400 | [diff] [blame] | 620 | MAGENTA: {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 621 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 622 | MOVE_VERB: {}, |
| 623 | LINE_VERB: {}, |
| 624 | QUAD_VERB: {}, |
| 625 | CONIC_VERB: {}, |
| 626 | CUBIC_VERB: {}, |
| 627 | CLOSE_VERB: {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 628 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 629 | NoDecoration: {}, |
| 630 | UnderlineDecoration: {}, |
| 631 | OverlineDecoration: {}, |
| 632 | LineThroughDecoration: {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 633 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 634 | SaveLayerInitWithPrevious: {}, |
| 635 | SaveLayerF16ColorType: {}, |
Kevin Lubick | 77d9b5c | 2019-10-29 10:48:26 -0400 | [diff] [blame] | 636 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 637 | Affinity: { |
| 638 | Upstream: {}, |
| 639 | Downstream: {}, |
| 640 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 641 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 642 | AlphaType: { |
| 643 | Opaque: {}, |
| 644 | Premul: {}, |
| 645 | Unpremul: {}, |
| 646 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 647 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 648 | BlendMode: { |
| 649 | Clear: {}, |
| 650 | Src: {}, |
| 651 | Dst: {}, |
| 652 | SrcOver: {}, |
| 653 | DstOver: {}, |
| 654 | SrcIn: {}, |
| 655 | DstIn: {}, |
| 656 | SrcOut: {}, |
| 657 | DstOut: {}, |
| 658 | SrcATop: {}, |
| 659 | DstATop: {}, |
| 660 | Xor: {}, |
| 661 | Plus: {}, |
| 662 | Modulate: {}, |
| 663 | Screen: {}, |
| 664 | Overlay: {}, |
| 665 | Darken: {}, |
| 666 | Lighten: {}, |
| 667 | ColorDodge: {}, |
| 668 | ColorBurn: {}, |
| 669 | HardLight: {}, |
| 670 | SoftLight: {}, |
| 671 | Difference: {}, |
| 672 | Exclusion: {}, |
| 673 | Multiply: {}, |
| 674 | Hue: {}, |
| 675 | Saturation: {}, |
| 676 | Color: {}, |
| 677 | Luminosity: {}, |
| 678 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 679 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 680 | BlurStyle: { |
| 681 | Normal: {}, |
| 682 | Solid: {}, |
| 683 | Outer: {}, |
| 684 | Inner: {}, |
| 685 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 686 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 687 | ClipOp: { |
| 688 | Difference: {}, |
| 689 | Intersect: {}, |
| 690 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 691 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 692 | ColorType: { |
| 693 | Alpha_8: {}, |
| 694 | RGB_565: {}, |
| 695 | ARGB_4444: {}, |
| 696 | RGBA_8888: {}, |
| 697 | RGB_888x: {}, |
| 698 | BGRA_8888: {}, |
| 699 | RGBA_1010102: {}, |
| 700 | RGB_101010x: {}, |
| 701 | Gray_8: {}, |
| 702 | RGBA_F16: {}, |
| 703 | RGBA_F32: {}, |
| 704 | }, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 705 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 706 | FillType: { |
| 707 | Winding: {}, |
| 708 | EvenOdd: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 709 | }, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 710 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 711 | FilterQuality: { |
| 712 | None: {}, |
| 713 | Low: {}, |
| 714 | Medium: {}, |
| 715 | High: {}, |
| 716 | }, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 717 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 718 | FontSlant: { |
| 719 | Upright: {}, |
| 720 | Italic: {}, |
| 721 | Oblique: {}, |
| 722 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 723 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 724 | FontHinting: { |
| 725 | None: {}, |
| 726 | Slight: {}, |
| 727 | Normal: {}, |
| 728 | Full: {}, |
| 729 | }, |
Kevin Lubick | bde9fcc | 2020-02-28 08:09:08 -0500 | [diff] [blame] | 730 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 731 | FontWeight: { |
| 732 | Invisible: {}, |
| 733 | Thin: {}, |
| 734 | ExtraLight: {}, |
| 735 | Light: {}, |
| 736 | Normal: {}, |
| 737 | Medium: {}, |
| 738 | SemiBold: {}, |
| 739 | Bold: {}, |
| 740 | ExtraBold: {}, |
| 741 | Black: {}, |
| 742 | ExtraBlack: {}, |
| 743 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 744 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 745 | FontWidth: { |
| 746 | UltraCondensed: {}, |
| 747 | ExtraCondensed: {}, |
| 748 | Condensed: {}, |
| 749 | SemiCondensed: {}, |
| 750 | Normal: {}, |
| 751 | SemiExpanded: {}, |
| 752 | Expanded: {}, |
| 753 | ExtraExpanded: {}, |
| 754 | UltraExpanded: {}, |
| 755 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 756 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 757 | ImageFormat: { |
| 758 | PNG: {}, |
| 759 | JPEG: {}, |
| 760 | }, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 761 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 762 | PaintStyle: { |
| 763 | Fill: {}, |
| 764 | Stroke: {}, |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 765 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 766 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 767 | PathOp: { |
| 768 | Difference: {}, |
| 769 | Intersect: {}, |
| 770 | Union: {}, |
| 771 | XOR: {}, |
| 772 | ReverseDifference: {}, |
| 773 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 774 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 775 | PointMode: { |
| 776 | Points: {}, |
| 777 | Lines: {}, |
| 778 | Polygon: {}, |
| 779 | }, |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 780 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 781 | RectHeightStyle: { |
| 782 | Tight: {}, |
| 783 | Max: {}, |
| 784 | IncludeLineSpacingMiddle: {}, |
| 785 | IncludeLineSpacingTop: {}, |
| 786 | IncludeLineSpacingBottom: {}, |
| 787 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 788 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 789 | RectWidthStyle: { |
| 790 | Tight: {}, |
| 791 | Max: {}, |
| 792 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 793 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 794 | StrokeCap: { |
| 795 | Butt: {}, |
| 796 | Round: {}, |
| 797 | Square: {}, |
| 798 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 799 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 800 | StrokeJoin: { |
| 801 | Miter: {}, |
| 802 | Round: {}, |
| 803 | Bevel: {}, |
| 804 | }, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 805 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 806 | TextAlign: { |
| 807 | Left: {}, |
| 808 | Right: {}, |
| 809 | Center: {}, |
| 810 | Justify: {}, |
| 811 | Start: {}, |
| 812 | End: {}, |
| 813 | }, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 814 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 815 | TextDirection: { |
| 816 | LTR: {}, |
| 817 | RTL: {}, |
| 818 | }, |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 819 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 820 | TileMode: { |
| 821 | Clamp: {}, |
| 822 | Repeat: {}, |
| 823 | Mirror: {}, |
| 824 | Decal: {}, |
| 825 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 826 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 827 | VertexMode: { |
| 828 | Triangles: {}, |
| 829 | TrianglesStrip: {}, |
| 830 | TriangleFan: {}, |
| 831 | }, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 832 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 833 | // Things Enscriptem adds for us |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 834 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 835 | /** |
| 836 | * @type {Float32Array} |
| 837 | */ |
| 838 | HEAPF32: {}, |
| 839 | /** |
| 840 | * @type {Float64Array} |
| 841 | */ |
| 842 | HEAPF64: {}, |
| 843 | /** |
| 844 | * @type {Uint8Array} |
| 845 | */ |
| 846 | HEAPU8: {}, |
| 847 | /** |
| 848 | * @type {Uint16Array} |
| 849 | */ |
| 850 | HEAPU16: {}, |
| 851 | /** |
| 852 | * @type {Uint32Array} |
| 853 | */ |
| 854 | HEAPU32: {}, |
| 855 | /** |
| 856 | * @type {Int8Array} |
| 857 | */ |
| 858 | HEAP8: {}, |
| 859 | /** |
| 860 | * @type {Int16Array} |
| 861 | */ |
| 862 | HEAP16: {}, |
| 863 | /** |
| 864 | * @type {Int32Array} |
| 865 | */ |
| 866 | HEAP32: {}, |
Kevin Lubick | fa5a138 | 2019-10-09 10:46:14 -0400 | [diff] [blame] | 867 | |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 868 | _malloc: function() {}, |
| 869 | _free: function() {}, |
| 870 | onRuntimeInitialized: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 871 | }; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 872 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 873 | // Public API things that are newly declared in the JS should go here. |
| 874 | // It's not enough to declare them above, because closure can still erase them |
| 875 | // unless they go on the prototype. |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 876 | CanvasKit.Paragraph.prototype.getRectsForRange = function() {}; |
| 877 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 878 | CanvasKit.SkPath.prototype.addArc = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 879 | CanvasKit.SkPath.prototype.addOval = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 880 | CanvasKit.SkPath.prototype.addPath = function() {}; |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 881 | CanvasKit.SkPath.prototype.addPoly = function() {}; |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 882 | CanvasKit.SkPath.prototype.addRect = function() {}; |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 883 | CanvasKit.SkPath.prototype.addRoundRect = function() {}; |
Kevin Lubick | d9b9e5e | 2020-06-23 16:58:10 -0400 | [diff] [blame] | 884 | CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 885 | CanvasKit.SkPath.prototype.arc = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 886 | CanvasKit.SkPath.prototype.arcTo = function() {}; |
Nathaniel Nifong | d0c9d0c | 2020-07-15 16:46:17 -0400 | [diff] [blame] | 887 | CanvasKit.SkPath.prototype.arcToOval = function() {}; |
| 888 | CanvasKit.SkPath.prototype.arcToTangent = function() {}; |
| 889 | CanvasKit.SkPath.prototype.arcToRotated = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 890 | CanvasKit.SkPath.prototype.close = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 891 | CanvasKit.SkPath.prototype.conicTo = function() {}; |
| 892 | CanvasKit.SkPath.prototype.cubicTo = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 893 | CanvasKit.SkPath.prototype.dash = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 894 | CanvasKit.SkPath.prototype.lineTo = function() {}; |
| 895 | CanvasKit.SkPath.prototype.moveTo = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 896 | CanvasKit.SkPath.prototype.offset = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 897 | CanvasKit.SkPath.prototype.op = function() {}; |
| 898 | CanvasKit.SkPath.prototype.quadTo = function() {}; |
Kevin Lubick | 79b7134 | 2019-11-01 14:36:52 -0400 | [diff] [blame] | 899 | CanvasKit.SkPath.prototype.rArcTo = function() {}; |
| 900 | CanvasKit.SkPath.prototype.rConicTo = function() {}; |
| 901 | CanvasKit.SkPath.prototype.rCubicTo = function() {}; |
| 902 | CanvasKit.SkPath.prototype.rLineTo = function() {}; |
| 903 | CanvasKit.SkPath.prototype.rMoveTo = function() {}; |
| 904 | CanvasKit.SkPath.prototype.rQuadTo = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 905 | CanvasKit.SkPath.prototype.rect = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 906 | CanvasKit.SkPath.prototype.simplify = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 907 | CanvasKit.SkPath.prototype.stroke = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 908 | CanvasKit.SkPath.prototype.transform = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 909 | CanvasKit.SkPath.prototype.trim = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 910 | |
Kevin Lubick | a4f218d | 2020-01-14 08:39:09 -0500 | [diff] [blame] | 911 | CanvasKit.SkPicture.prototype.saveAsFile = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 912 | |
Kevin Lubick | 5b90b84 | 2018-10-17 07:57:18 -0400 | [diff] [blame] | 913 | CanvasKit.SkSurface.prototype.dispose = function() {}; |
Kevin Lubick | 359a7e3 | 2019-03-19 09:34:37 -0400 | [diff] [blame] | 914 | CanvasKit.SkSurface.prototype.flush = function() {}; |
| 915 | CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {}; |
Bryce Thomas | 2c5b856 | 2020-01-22 13:49:41 -0800 | [diff] [blame] | 916 | CanvasKit.SkSurface.prototype.drawOnce = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 917 | CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {}; |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 918 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 919 | CanvasKit.SkImage.prototype.encodeToData = function() {}; |
Kevin Lubick | a064c28 | 2019-04-04 09:28:53 -0400 | [diff] [blame] | 920 | CanvasKit.SkImage.prototype.makeShader = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 921 | |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 922 | CanvasKit.SkCanvas.prototype.concat = function() {}; |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 923 | CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 924 | CanvasKit.SkCanvas.prototype.drawAtlas = function() {}; |
Kevin Lubick | 37ab53e | 2019-11-11 10:06:08 -0500 | [diff] [blame] | 925 | CanvasKit.SkCanvas.prototype.drawPoints = function() {}; |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 926 | CanvasKit.SkCanvas.prototype.drawText = function() {}; |
Kevin Lubick | c1d0898 | 2020-04-06 13:52:15 -0400 | [diff] [blame] | 927 | CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {}; |
| 928 | CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {}; |
| 929 | CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {}; |
Kevin Lubick | 6bffe39 | 2020-04-02 15:24:15 -0400 | [diff] [blame] | 930 | CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 931 | /** @return {Uint8Array} */ |
| 932 | CanvasKit.SkCanvas.prototype.readPixels = function() {}; |
| 933 | CanvasKit.SkCanvas.prototype.writePixels = function() {}; |
| 934 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 935 | CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {}; |
| 936 | |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 937 | CanvasKit.SkFont.prototype.getWidths = function() {}; |
| 938 | |
| 939 | CanvasKit.RSXFormBuilder.prototype.build = function() {}; |
| 940 | CanvasKit.RSXFormBuilder.prototype.delete = function() {}; |
| 941 | CanvasKit.RSXFormBuilder.prototype.push = function() {}; |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 942 | CanvasKit.RSXFormBuilder.prototype.set = function() {}; |
| 943 | |
| 944 | CanvasKit.SkColorBuilder.prototype.build = function() {}; |
| 945 | CanvasKit.SkColorBuilder.prototype.delete = function() {}; |
| 946 | CanvasKit.SkColorBuilder.prototype.push = function() {}; |
| 947 | CanvasKit.SkColorBuilder.prototype.set = function() {}; |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 948 | |
Kevin Lubick | f3d6c36 | 2020-01-06 08:11:52 -0500 | [diff] [blame] | 949 | CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {}; |
Kevin Lubick | ecd8762 | 2020-02-22 07:37:33 -0500 | [diff] [blame] | 950 | CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {}; |
Kevin Lubick | 4b5b645 | 2019-12-06 13:55:58 -0500 | [diff] [blame] | 951 | |
Kevin Lubick | f8f9cd8 | 2020-02-21 08:26:59 -0500 | [diff] [blame] | 952 | CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {}; |
| 953 | CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {}; |
| 954 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 955 | // Define StrokeOpts object |
| 956 | var StrokeOpts = {}; |
| 957 | StrokeOpts.prototype.width; |
| 958 | StrokeOpts.prototype.miter_limit; |
| 959 | StrokeOpts.prototype.cap; |
| 960 | StrokeOpts.prototype.join; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 961 | StrokeOpts.prototype.precision; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 962 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 963 | // Define everything created in the canvas2d spec here |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 964 | var HTMLCanvas = {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 965 | HTMLCanvas.prototype.decodeImage = function() {}; |
| 966 | HTMLCanvas.prototype.dispose = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 967 | HTMLCanvas.prototype.getContext = function() {}; |
Kevin Lubick | 8e4a331 | 2018-12-14 15:03:41 -0500 | [diff] [blame] | 968 | HTMLCanvas.prototype.loadFont = function() {}; |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 969 | HTMLCanvas.prototype.makePath2D = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 970 | HTMLCanvas.prototype.toDataURL = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 971 | |
Elliot Evans | 2879619 | 2020-06-15 12:53:27 -0600 | [diff] [blame] | 972 | var ImageBitmapRenderingContext = {}; |
| 973 | ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {}; |
| 974 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 975 | var CanvasRenderingContext2D = {}; |
| 976 | CanvasRenderingContext2D.prototype.addHitRegion = function() {}; |
| 977 | CanvasRenderingContext2D.prototype.arc = function() {}; |
| 978 | CanvasRenderingContext2D.prototype.arcTo = function() {}; |
| 979 | CanvasRenderingContext2D.prototype.beginPath = function() {}; |
| 980 | CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; |
| 981 | CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 982 | CanvasRenderingContext2D.prototype.clearRect = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 983 | CanvasRenderingContext2D.prototype.clip = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 984 | CanvasRenderingContext2D.prototype.closePath = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 985 | CanvasRenderingContext2D.prototype.createImageData = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 986 | CanvasRenderingContext2D.prototype.createLinearGradient = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 987 | CanvasRenderingContext2D.prototype.createPattern = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 988 | CanvasRenderingContext2D.prototype.createRadialGradient = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 989 | CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 990 | CanvasRenderingContext2D.prototype.drawImage = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 991 | CanvasRenderingContext2D.prototype.ellipse = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 992 | CanvasRenderingContext2D.prototype.fill = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 993 | CanvasRenderingContext2D.prototype.fillRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 994 | CanvasRenderingContext2D.prototype.fillText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 995 | CanvasRenderingContext2D.prototype.getImageData = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 996 | CanvasRenderingContext2D.prototype.getLineDash = function() {}; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 997 | CanvasRenderingContext2D.prototype.isPointInPath = function() {}; |
| 998 | CanvasRenderingContext2D.prototype.isPointInStroke = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 999 | CanvasRenderingContext2D.prototype.lineTo = function() {}; |
| 1000 | CanvasRenderingContext2D.prototype.measureText = function() {}; |
| 1001 | CanvasRenderingContext2D.prototype.moveTo = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1002 | CanvasRenderingContext2D.prototype.putImageData = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 1003 | CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; |
| 1004 | CanvasRenderingContext2D.prototype.rect = function() {}; |
| 1005 | CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; |
| 1006 | CanvasRenderingContext2D.prototype.resetTransform = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 1007 | CanvasRenderingContext2D.prototype.restore = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 1008 | CanvasRenderingContext2D.prototype.rotate = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 1009 | CanvasRenderingContext2D.prototype.save = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 1010 | CanvasRenderingContext2D.prototype.scale = function() {}; |
| 1011 | CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 1012 | CanvasRenderingContext2D.prototype.setLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 1013 | CanvasRenderingContext2D.prototype.setTransform = function() {}; |
| 1014 | CanvasRenderingContext2D.prototype.stroke = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 1015 | CanvasRenderingContext2D.prototype.strokeRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 1016 | CanvasRenderingContext2D.prototype.strokeText = function() {}; |
| 1017 | CanvasRenderingContext2D.prototype.transform = function() {}; |
| 1018 | CanvasRenderingContext2D.prototype.translate = function() {}; |
| 1019 | |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 1020 | var Path2D = {}; |
| 1021 | Path2D.prototype.addPath = function() {}; |
| 1022 | Path2D.prototype.arc = function() {}; |
| 1023 | Path2D.prototype.arcTo = function() {}; |
| 1024 | Path2D.prototype.bezierCurveTo = function() {}; |
| 1025 | Path2D.prototype.closePath = function() {}; |
| 1026 | Path2D.prototype.ellipse = function() {}; |
| 1027 | Path2D.prototype.lineTo = function() {}; |
| 1028 | Path2D.prototype.moveTo = function() {}; |
| 1029 | Path2D.prototype.quadraticCurveTo = function() {}; |
| 1030 | Path2D.prototype.rect = function() {}; |
| 1031 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 1032 | var LinearCanvasGradient = {}; |
| 1033 | LinearCanvasGradient.prototype.addColorStop = function() {}; |
| 1034 | var RadialCanvasGradient = {}; |
| 1035 | RadialCanvasGradient.prototype.addColorStop = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1036 | var CanvasPattern = {}; |
| 1037 | CanvasPattern.prototype.setTransform = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 1038 | |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1039 | var ImageData = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 1040 | /** |
| 1041 | * @type {Uint8ClampedArray} |
| 1042 | */ |
| 1043 | data: {}, |
| 1044 | height: {}, |
| 1045 | width: {}, |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 1046 | }; |
| 1047 | |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1048 | var DOMMatrix = { |
Nathaniel Nifong | 6066a0c | 2020-03-05 10:27:14 -0500 | [diff] [blame] | 1049 | a: {}, |
| 1050 | b: {}, |
| 1051 | c: {}, |
| 1052 | d: {}, |
| 1053 | e: {}, |
| 1054 | f: {}, |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 1055 | }; |
| 1056 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1057 | // 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] | 1058 | function loadWebAssemblyModule() {}; |
Nathaniel Nifong | a237f9e | 2020-07-17 15:20:44 -0400 | [diff] [blame^] | 1059 | |
| 1060 | // This is a part of emscripten's webgl glue code. Preserving this attribute is necessary |
| 1061 | // to override it in the puppeteer tests |
| 1062 | var LibraryEGL = { |
| 1063 | contextAttributes: { |
| 1064 | majorVersion: {} |
| 1065 | } |
| 1066 | } |