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 = { |
| 26 | // public API (i.e. things we declare in the pre-js file) |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 27 | Color: function() {}, |
| 28 | /** @return {CanvasKit.SkRect} */ |
| 29 | LTRBRect: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 30 | /** @return {CanvasKit.SkRect} */ |
| 31 | XYWHRect: function() {}, |
Kevin Lubick | 7d644e1 | 2019-09-11 14:22:22 -0400 | [diff] [blame] | 32 | /** @return {CanvasKit.SkRRect} */ |
| 33 | RRectXY: function() {}, |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 34 | /** @return {ImageData} */ |
| 35 | ImageData: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 36 | |
| 37 | GetWebGLContext: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 38 | MakeBlurMaskFilter: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 39 | MakeCanvas: function() {}, |
| 40 | MakeCanvasSurface: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 41 | MakeGrContext: function() {}, |
Kevin Lubick | 6b921b7 | 2019-09-18 16:18:17 -0400 | [diff] [blame] | 42 | /** @return {CanvasKit.SkAnimatedImage} */ |
| 43 | MakeAnimatedImageFromEncoded: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 44 | /** @return {CanvasKit.SkImage} */ |
| 45 | MakeImageFromEncoded: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 46 | /** @return {LinearCanvasGradient} */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 47 | MakeLinearGradientShader: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 48 | MakeOnScreenGLSurface: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 49 | MakePathFromCmds: function() {}, |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 50 | MakePathFromOp: function() {}, |
| 51 | MakePathFromSVGString: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 52 | MakeRadialGradientShader: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 53 | MakeRenderTarget: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 54 | MakeSWCanvasSurface: function() {}, |
Kevin Lubick | f5ea37f | 2019-02-28 10:06:18 -0500 | [diff] [blame] | 55 | MakeManagedAnimation: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 56 | MakeSkDashPathEffect: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 57 | MakeSkVertices: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 58 | MakeSurface: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 59 | /** @return {RadialCanvasGradient} */ |
| 60 | MakeTwoPointConicalGradientShader: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 61 | MakeWebGLCanvasSurface: function() {}, |
Kevin Lubick | e25df6c | 2019-10-22 09:04:32 -0400 | [diff] [blame] | 62 | /** @return {TypedArray} */ |
| 63 | Malloc: function() {}, |
Kevin Lubick | 50f377e | 2019-09-11 15:23:00 -0400 | [diff] [blame] | 64 | /** @return {TonalColors} */ |
| 65 | computeTonalColors: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 66 | currentContext: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 67 | getColorComponents: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 68 | getSkDataBytes: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 69 | multiplyByAlpha: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 70 | setCurrentContext: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 71 | |
| 72 | // private API (i.e. things declared in the bindings that we use |
| 73 | // in the pre-js file) |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 74 | _MakeImage: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 75 | _MakeLinearGradientShader: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 76 | _MakePathFromCmds: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 77 | _MakeRadialGradientShader: function() {}, |
Kevin Lubick | f5ea37f | 2019-02-28 10:06:18 -0500 | [diff] [blame] | 78 | _MakeManagedAnimation: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 79 | _MakeSkDashPathEffect: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 80 | _MakeSkVertices: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 81 | _MakeTwoPointConicalGradientShader: function() {}, |
Kevin Lubick | 6b921b7 | 2019-09-18 16:18:17 -0400 | [diff] [blame] | 82 | _decodeAnimatedImage: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 83 | _decodeImage: function() {}, |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 84 | _drawShapedText: function() {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 85 | _getRasterDirectSurface: function() {}, |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 86 | _getRasterN32PremulSurface: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 87 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 88 | // The testing object is meant to expose internal functions |
| 89 | // for more fine-grained testing, e.g. parseColor |
| 90 | _testing: {}, |
| 91 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 92 | // Objects and properties on CanvasKit |
| 93 | |
Kevin Lubick | cd54466 | 2019-03-22 15:41:36 -0400 | [diff] [blame] | 94 | GrContext: { |
| 95 | // public API (from C++ bindings) |
| 96 | getResourceCacheLimitBytes: function() {}, |
| 97 | getResourceCacheUsageBytes: function() {}, |
| 98 | setResourceCacheLimitBytes: function() {}, |
| 99 | }, |
| 100 | |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 101 | Paragraph: { |
| 102 | // public API (from C++ bindings) |
| 103 | getGlyphPositionAtCoordinate: function() {}, |
| 104 | layout: function() {}, |
| 105 | |
| 106 | // private API |
| 107 | /** @return {Float32Array} */ |
| 108 | _getRectsForRange: function() {}, |
| 109 | }, |
| 110 | |
| 111 | ParagraphStyle: function() {}, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 112 | RSXFormBuilder: function() {}, |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 113 | SkColorBuilder: function() {}, |
| 114 | SkRectBuilder: function() {}, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 115 | |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 116 | ShapedText: { |
| 117 | // public API (from C++ bindings) |
| 118 | getBounds: function() {}, |
| 119 | }, |
| 120 | |
Kevin Lubick | 6b921b7 | 2019-09-18 16:18:17 -0400 | [diff] [blame] | 121 | SkAnimatedImage: { |
| 122 | // public API (from C++ bindings) |
| 123 | getRepetitionCount: function() {}, |
| 124 | decodeNextFrame: function() {}, |
| 125 | }, |
| 126 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 127 | SkCanvas: { |
| 128 | // public API (from C++ bindings) |
| 129 | clear: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 130 | clipPath: function() {}, |
Kevin Lubick | 6dbc4ed | 2019-10-22 09:43:34 -0400 | [diff] [blame] | 131 | clipRRect: function() {}, |
Kevin Lubick | 5d5723c | 2018-12-07 10:09:11 -0500 | [diff] [blame] | 132 | clipRect: function() {}, |
| 133 | concat: function() {}, |
Kevin Lubick | 6dbc4ed | 2019-10-22 09:43:34 -0400 | [diff] [blame] | 134 | drawAnimatedImage: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 135 | drawArc: function() {}, |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 136 | drawCircle: function() {}, |
Kevin Lubick | 6dbc4ed | 2019-10-22 09:43:34 -0400 | [diff] [blame] | 137 | drawColor: function() {}, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 138 | drawDRRect: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 139 | drawImage: function() {}, |
| 140 | drawImageRect: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 141 | drawLine: function() {}, |
| 142 | drawOval: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 143 | drawPaint: function() {}, |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 144 | drawParagraph: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 145 | drawPath: function() {}, |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 146 | drawPicture: function() {}, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 147 | drawRRect: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 148 | drawRect: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 149 | drawRoundRect: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 150 | drawShadow: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 151 | drawText: function() {}, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 152 | drawTextBlob: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 153 | drawVertices: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 154 | flush: function() {}, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 155 | getSaveCount: function() {}, |
Kevin Lubick | 5d5723c | 2018-12-07 10:09:11 -0500 | [diff] [blame] | 156 | getTotalMatrix: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 157 | makeSurface: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 158 | restore: function() {}, |
Kevin Lubick | b3574c9 | 2019-03-06 08:25:36 -0500 | [diff] [blame] | 159 | restoreToCount: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 160 | rotate: function() {}, |
| 161 | save: function() {}, |
Kevin Lubick | b3574c9 | 2019-03-06 08:25:36 -0500 | [diff] [blame] | 162 | saveLayer: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 163 | scale: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 164 | skew: function() {}, |
| 165 | translate: function() {}, |
| 166 | |
| 167 | // private API |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 168 | _drawAtlas: function() {}, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 169 | _drawSimpleText: function() {}, |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 170 | _readPixels: function() {}, |
| 171 | _writePixels: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 172 | delete: function() {}, |
| 173 | }, |
| 174 | |
Kevin Lubick | d372934 | 2019-09-12 11:11:25 -0400 | [diff] [blame] | 175 | SkColorFilter: { |
| 176 | // public API (from C++ bindings and JS interface) |
| 177 | MakeBlend: function() {}, |
| 178 | MakeCompose: function() {}, |
| 179 | MakeLerp: function() {}, |
| 180 | MakeLinearToSRGBGamma: function() {}, |
| 181 | MakeMatrix: function() {}, |
| 182 | MakeSRGBToLinearGamma: function() {}, |
| 183 | // private API (from C++ bindings) |
| 184 | _makeMatrix: function() {}, |
| 185 | }, |
| 186 | |
| 187 | SkColorMatrix: { |
| 188 | concat: function() {}, |
| 189 | identity: function() {}, |
| 190 | postTranslate: function() {}, |
| 191 | rotated: function() {}, |
| 192 | scaled: function() {}, |
| 193 | }, |
| 194 | |
Kevin Lubick | 35ac038 | 2019-01-02 15:13:57 -0500 | [diff] [blame] | 195 | SkFont: { |
| 196 | // public API (from C++ bindings) |
| 197 | getScaleX: function() {}, |
| 198 | getSize: function() {}, |
| 199 | getSkewX: function() {}, |
| 200 | getTypeface: function() {}, |
| 201 | measureText: function() {}, |
| 202 | setScaleX: function() {}, |
| 203 | setSize: function() {}, |
| 204 | setSkewX: function() {}, |
| 205 | setTypeface: function() {}, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 206 | // private API (from C++ bindings) |
| 207 | _getWidths: function() {}, |
Kevin Lubick | 35ac038 | 2019-01-02 15:13:57 -0500 | [diff] [blame] | 208 | }, |
| 209 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 210 | SkFontMgr: { |
Kevin Lubick | 61887c7 | 2019-09-26 13:20:50 -0400 | [diff] [blame] | 211 | // public API (from C++ and JS bindings) |
| 212 | FromData: function() {}, |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 213 | RefDefault: function() {}, |
| 214 | countFamilies: function() {}, |
| 215 | |
| 216 | // private API |
| 217 | _makeTypefaceFromData: function() {}, |
Kevin Lubick | 61887c7 | 2019-09-26 13:20:50 -0400 | [diff] [blame] | 218 | _fromData: function() {}, |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 219 | }, |
| 220 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 221 | SkImage: { |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 222 | // public API (from C++ bindings) |
| 223 | height: function() {}, |
| 224 | width: function() {}, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 225 | // private API |
| 226 | _encodeToData: function() {}, |
| 227 | _encodeToDataWithFormat: function() {}, |
Kevin Lubick | a064c28 | 2019-04-04 09:28:53 -0400 | [diff] [blame] | 228 | _makeShader: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 229 | }, |
| 230 | |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 231 | SkImageFilter: { |
| 232 | MakeBlur: function() {}, |
| 233 | MakeColorFilter: function() {}, |
| 234 | MakeCompose: function() {}, |
| 235 | }, |
| 236 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 237 | SkMatrix: { |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 238 | identity: function() {}, |
Kevin Lubick | f355518 | 2019-03-14 10:55:10 -0400 | [diff] [blame] | 239 | invert: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 240 | mapPoints: function() {}, |
| 241 | multiply: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 242 | rotated: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 243 | scaled: function() {}, |
| 244 | skewed: function() {}, |
| 245 | translated: function() {}, |
| 246 | }, |
| 247 | |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 248 | SkMaskFilter: { |
| 249 | MakeBlur: function() {}, |
| 250 | }, |
| 251 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 252 | SkPaint: { |
| 253 | // public API (from C++ bindings) |
| 254 | /** @return {CanvasKit.SkPaint} */ |
| 255 | copy: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 256 | getBlendMode: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 257 | getColor: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 258 | getFilterQuality: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 259 | getStrokeCap: function() {}, |
| 260 | getStrokeJoin: function() {}, |
| 261 | getStrokeMiter: function() {}, |
| 262 | getStrokeWidth: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 263 | setAntiAlias: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 264 | setBlendMode: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 265 | setColor: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 266 | setFilterQuality: function() {}, |
Kevin Lubick | 15b4023 | 2019-10-29 09:55:39 -0400 | [diff] [blame] | 267 | setImageFilter: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 268 | setMaskFilter: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 269 | setPathEffect: function() {}, |
| 270 | setShader: function() {}, |
| 271 | setStrokeCap: function() {}, |
| 272 | setStrokeJoin: function() {}, |
| 273 | setStrokeMiter: function() {}, |
| 274 | setStrokeWidth: function() {}, |
| 275 | setStyle: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 276 | |
| 277 | //private API |
| 278 | delete: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 279 | }, |
| 280 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 281 | SkPath: { |
| 282 | // public API (from C++ bindings) |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 283 | computeTightBounds: function() {}, |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 284 | contains: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 285 | /** @return {CanvasKit.SkPath} */ |
| 286 | copy: function() {}, |
| 287 | countPoints: function() {}, |
| 288 | equals: function() {}, |
| 289 | getBounds: function() {}, |
| 290 | getFillType: function() {}, |
| 291 | getPoint: function() {}, |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 292 | isEmpty: function() {}, |
Kevin Lubick | 2b79d1c | 2018-12-14 16:10:38 -0500 | [diff] [blame] | 293 | isVolatile: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 294 | reset: function() {}, |
| 295 | rewind: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 296 | setFillType: function() {}, |
Kevin Lubick | 2b79d1c | 2018-12-14 16:10:38 -0500 | [diff] [blame] | 297 | setIsVolatile: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 298 | toSVGString: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 299 | |
| 300 | // private API |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 301 | _addArc: function() {}, |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 302 | _addOval: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 303 | _addPath: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 304 | _addRect: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 305 | _addRoundRect: function() {}, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 306 | _arc: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 307 | _arcTo: function() {}, |
| 308 | _close: function() {}, |
| 309 | _conicTo: function() {}, |
| 310 | _cubicTo: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 311 | _dash: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 312 | _lineTo: function() {}, |
| 313 | _moveTo: function() {}, |
| 314 | _op: function() {}, |
| 315 | _quadTo: function() {}, |
Kevin Lubick | 79b7134 | 2019-11-01 14:36:52 -0400 | [diff] [blame^] | 316 | _rArcTo: function() {}, |
| 317 | _rConicTo: function() {}, |
| 318 | _rCubicTo: function() {}, |
| 319 | _rLineTo: function() {}, |
| 320 | _rMoveTo: function() {}, |
| 321 | _rQuadTo: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 322 | _rect: function() {}, |
| 323 | _simplify: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 324 | _stroke: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 325 | _transform: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 326 | _trim: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 327 | delete: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 328 | dump: function() {}, |
| 329 | dumpHex: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 330 | }, |
| 331 | |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 332 | SkPathMeasure: { |
| 333 | getLength: function() {}, |
| 334 | getPosTan: function() {}, |
| 335 | isClosed: function() {}, |
| 336 | nextContour: function() {}, |
| 337 | }, |
| 338 | |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 339 | SkPicture: { |
| 340 | DEBUGONLY_serialize: function() {}, |
| 341 | }, |
| 342 | |
| 343 | SkPictureRecorder: { |
| 344 | beginRecording: function() {}, |
| 345 | finishRecordingAsPicture: function() {}, |
| 346 | }, |
| 347 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 348 | SkRect: { |
| 349 | fLeft: {}, |
| 350 | fTop: {}, |
| 351 | fRight: {}, |
| 352 | fBottom: {}, |
| 353 | }, |
| 354 | |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 355 | SkRRect: { |
| 356 | rect: {}, |
Kevin Lubick | 7d644e1 | 2019-09-11 14:22:22 -0400 | [diff] [blame] | 357 | rx1: {}, |
| 358 | ry1: {}, |
| 359 | rx2: {}, |
| 360 | ry2: {}, |
| 361 | rx3: {}, |
| 362 | ry3: {}, |
| 363 | rx4: {}, |
| 364 | ry4: {}, |
Kevin Lubick | 2e5fe35 | 2019-09-03 12:59:06 -0400 | [diff] [blame] | 365 | }, |
| 366 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 367 | SkSurface: { |
| 368 | // public API (from C++ bindings) |
| 369 | /** @return {CanvasKit.SkCanvas} */ |
| 370 | getCanvas: function() {}, |
| 371 | /** @return {CanvasKit.SkImage} */ |
| 372 | makeImageSnapshot: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 373 | makeSurface: function() {}, |
Kevin Lubick | cd54466 | 2019-03-22 15:41:36 -0400 | [diff] [blame] | 374 | grContext: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 375 | |
| 376 | // private API |
| 377 | _flush: function() {}, |
| 378 | _getRasterN32PremulSurface: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 379 | delete: function() {}, |
| 380 | }, |
| 381 | |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 382 | SkTextBlob: { |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 383 | // public API (both C++ and JS bindings) |
| 384 | MakeFromRSXform: function() {}, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 385 | MakeFromText: function() {}, |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 386 | MakeOnPath: function() {}, |
| 387 | // private API (from C++ bindings) |
| 388 | _MakeFromRSXform: function() {}, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 389 | _MakeFromText: function() {}, |
| 390 | }, |
| 391 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 392 | SkVertices: { |
| 393 | // public API (from C++ bindings) |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 394 | bounds: function() {}, |
| 395 | mode: function() {}, |
| 396 | uniqueID: function() {}, |
| 397 | vertexCount: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 398 | |
| 399 | // private API |
| 400 | /** @return {CanvasKit.SkVertices} */ |
| 401 | _applyBones: function() {}, |
| 402 | }, |
| 403 | |
Kevin Lubick | d6ba725 | 2019-06-03 14:38:05 -0400 | [diff] [blame] | 404 | _SkVerticesBuilder: { |
| 405 | // public API (from C++ bindings) |
| 406 | boneIndices: function() {}, |
| 407 | boneWeights: function() {}, |
| 408 | colors: function() {}, |
| 409 | detach: function() {}, |
| 410 | indices: function() {}, |
| 411 | positions: function() {}, |
| 412 | texCoords: function() {}, |
| 413 | }, |
| 414 | |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 415 | TextStyle: function() {}, |
| 416 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 417 | // Constants and Enums |
| 418 | gpu: {}, |
| 419 | skottie: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 420 | |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 421 | TRANSPARENT: {}, |
| 422 | RED: {}, |
| 423 | BLUE: {}, |
| 424 | YELLOW: {}, |
| 425 | CYAN: {}, |
| 426 | BLACK: {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 427 | WHITE: {}, |
| 428 | |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 429 | MOVE_VERB: {}, |
| 430 | LINE_VERB: {}, |
| 431 | QUAD_VERB: {}, |
| 432 | CONIC_VERB: {}, |
| 433 | CUBIC_VERB: {}, |
| 434 | CLOSE_VERB: {}, |
| 435 | |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 436 | NoDecoration: {}, |
| 437 | UnderlineDecoration: {}, |
| 438 | OverlineDecoration: {}, |
| 439 | LineThroughDecoration: {}, |
| 440 | |
Kevin Lubick | 77d9b5c | 2019-10-29 10:48:26 -0400 | [diff] [blame] | 441 | SaveLayerInitWithPrevious: {}, |
| 442 | SaveLayerF16ColorType: {}, |
| 443 | |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 444 | Affinity: { |
| 445 | Upstream: {}, |
| 446 | Downstream: {}, |
| 447 | }, |
| 448 | |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 449 | AlphaType: { |
| 450 | Opaque: {}, |
| 451 | Premul: {}, |
| 452 | Unpremul: {}, |
| 453 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 454 | |
| 455 | BlendMode: { |
| 456 | Clear: {}, |
| 457 | Src: {}, |
| 458 | Dst: {}, |
| 459 | SrcOver: {}, |
| 460 | DstOver: {}, |
| 461 | SrcIn: {}, |
| 462 | DstIn: {}, |
| 463 | SrcOut: {}, |
| 464 | DstOut: {}, |
| 465 | SrcATop: {}, |
| 466 | DstATop: {}, |
| 467 | Xor: {}, |
| 468 | Plus: {}, |
| 469 | Modulate: {}, |
| 470 | Screen: {}, |
| 471 | Overlay: {}, |
| 472 | Darken: {}, |
| 473 | Lighten: {}, |
| 474 | ColorDodge: {}, |
| 475 | ColorBurn: {}, |
| 476 | HardLight: {}, |
| 477 | SoftLight: {}, |
| 478 | Difference: {}, |
| 479 | Exclusion: {}, |
| 480 | Multiply: {}, |
| 481 | Hue: {}, |
| 482 | Saturation: {}, |
| 483 | Color: {}, |
| 484 | Luminosity: {}, |
| 485 | }, |
| 486 | |
| 487 | BlurStyle: { |
| 488 | Normal: {}, |
| 489 | Solid: {}, |
| 490 | Outer: {}, |
| 491 | Inner: {}, |
| 492 | }, |
| 493 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 494 | ClipOp: { |
| 495 | Difference: {}, |
| 496 | Intersect: {}, |
| 497 | }, |
| 498 | |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 499 | ColorType: { |
| 500 | Alpha_8: {}, |
| 501 | RGB_565: {}, |
| 502 | ARGB_4444: {}, |
| 503 | RGBA_8888: {}, |
| 504 | RGB_888x: {}, |
| 505 | BGRA_8888: {}, |
| 506 | RGBA_1010102: {}, |
| 507 | RGB_101010x: {}, |
| 508 | Gray_8: {}, |
| 509 | RGBA_F16: {}, |
| 510 | RGBA_F32: {}, |
| 511 | }, |
| 512 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 513 | FillType: { |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 514 | Winding: {}, |
| 515 | EvenOdd: {}, |
| 516 | InverseWinding: {}, |
| 517 | InverseEvenOdd: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 518 | }, |
| 519 | |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 520 | FilterQuality: { |
| 521 | None: {}, |
| 522 | Low: {}, |
| 523 | Medium: {}, |
| 524 | High: {}, |
| 525 | }, |
| 526 | |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 527 | FontSlant: { |
| 528 | Upright: {}, |
| 529 | Italic: {}, |
| 530 | Oblique: {}, |
| 531 | }, |
| 532 | |
| 533 | FontWeight: { |
| 534 | Invisible: {}, |
| 535 | Thin: {}, |
| 536 | ExtraLight: {}, |
| 537 | Light: {}, |
| 538 | Normal: {}, |
| 539 | Medium: {}, |
| 540 | SemiBold: {}, |
| 541 | Bold: {}, |
| 542 | ExtraBold: {}, |
| 543 | Black: {}, |
| 544 | ExtraBlack: {}, |
| 545 | }, |
| 546 | |
| 547 | FontWidth: { |
| 548 | UltraCondensed: {}, |
| 549 | ExtraCondensed: {}, |
| 550 | Condensed: {}, |
| 551 | SemiCondensed: {}, |
| 552 | Normal: {}, |
| 553 | SemiExpanded: {}, |
| 554 | Expanded: {}, |
| 555 | ExtraExpanded: {}, |
| 556 | UltraExpanded: {}, |
| 557 | }, |
| 558 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 559 | ImageFormat: { |
| 560 | PNG: {}, |
| 561 | JPEG: {}, |
| 562 | }, |
| 563 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 564 | PaintStyle: { |
| 565 | Fill: {}, |
| 566 | Stroke: {}, |
| 567 | StrokeAndFill: {}, |
| 568 | }, |
| 569 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 570 | PathOp: { |
| 571 | Difference: {}, |
| 572 | Intersect: {}, |
| 573 | Union: {}, |
| 574 | XOR: {}, |
| 575 | ReverseDifference: {}, |
| 576 | }, |
| 577 | |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 578 | RectHeightStyle: { |
| 579 | Tight: {}, |
| 580 | Max: {}, |
| 581 | }, |
| 582 | |
| 583 | RectWidthStyle: { |
| 584 | Tight: {}, |
| 585 | Max: {}, |
| 586 | }, |
| 587 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 588 | StrokeCap: { |
| 589 | Butt: {}, |
| 590 | Round: {}, |
| 591 | Square: {}, |
| 592 | }, |
| 593 | |
| 594 | StrokeJoin: { |
| 595 | Miter: {}, |
| 596 | Round: {}, |
| 597 | Bevel: {}, |
| 598 | }, |
| 599 | |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 600 | TextAlign: { |
| 601 | Left: {}, |
| 602 | Right: {}, |
| 603 | Center: {}, |
| 604 | Justify: {}, |
| 605 | Start: {}, |
| 606 | End: {}, |
| 607 | }, |
| 608 | |
Kevin Lubick | d3b1fe6 | 2019-10-21 10:50:26 -0400 | [diff] [blame] | 609 | TextDirection: { |
| 610 | LTR: {}, |
| 611 | RTL: {}, |
| 612 | }, |
| 613 | |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 614 | TextEncoding: { |
| 615 | UTF8: {}, |
| 616 | UTF16: {}, |
| 617 | UTF32: {}, |
| 618 | GlyphID: {}, |
| 619 | }, |
| 620 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 621 | TileMode: { |
| 622 | Clamp: {}, |
| 623 | Repeat: {}, |
| 624 | Mirror: {}, |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 625 | Decal: {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 626 | }, |
| 627 | |
| 628 | VertexMode: { |
| 629 | Triangles: {}, |
| 630 | TrianglesStrip: {}, |
| 631 | TriangleFan: {}, |
| 632 | }, |
| 633 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 634 | // Things Enscriptem adds for us |
| 635 | |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 636 | /** |
| 637 | * @type {Float32Array} |
| 638 | */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 639 | HEAPF32: {}, |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 640 | /** |
Kevin Lubick | fa5a138 | 2019-10-09 10:46:14 -0400 | [diff] [blame] | 641 | * @type {Float64Array} |
| 642 | */ |
| 643 | HEAPF64: {}, |
| 644 | /** |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 645 | * @type {Uint8Array} |
| 646 | */ |
| 647 | HEAPU8: {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 648 | /** |
| 649 | * @type {Uint16Array} |
| 650 | */ |
| 651 | HEAPU16: {}, |
| 652 | /** |
Kevin Lubick | f5ea37f | 2019-02-28 10:06:18 -0500 | [diff] [blame] | 653 | * @type {Uint32Array} |
| 654 | */ |
| 655 | HEAPU32: {}, |
Kevin Lubick | fa5a138 | 2019-10-09 10:46:14 -0400 | [diff] [blame] | 656 | /** |
| 657 | * @type {Int8Array} |
| 658 | */ |
| 659 | HEAP8: {}, |
| 660 | /** |
| 661 | * @type {Int16Array} |
| 662 | */ |
| 663 | HEAP16: {}, |
| 664 | /** |
| 665 | * @type {Int32Array} |
| 666 | */ |
| 667 | HEAP32: {}, |
| 668 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 669 | _malloc: function() {}, |
| 670 | _free: function() {}, |
| 671 | onRuntimeInitialized: function() {}, |
| 672 | }; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 673 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 674 | // Public API things that are newly declared in the JS should go here. |
| 675 | // It's not enough to declare them above, because closure can still erase them |
| 676 | // unless they go on the prototype. |
Kevin Lubick | 369f6a5 | 2019-10-03 11:22:08 -0400 | [diff] [blame] | 677 | CanvasKit.Paragraph.prototype.getRectsForRange = function() {}; |
| 678 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 679 | CanvasKit.SkPath.prototype.addArc = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 680 | CanvasKit.SkPath.prototype.addOval = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 681 | CanvasKit.SkPath.prototype.addPath = function() {}; |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 682 | CanvasKit.SkPath.prototype.addRect = function() {}; |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 683 | CanvasKit.SkPath.prototype.addRoundRect = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 684 | CanvasKit.SkPath.prototype.arc = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 685 | CanvasKit.SkPath.prototype.arcTo = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 686 | CanvasKit.SkPath.prototype.close = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 687 | CanvasKit.SkPath.prototype.conicTo = function() {}; |
| 688 | CanvasKit.SkPath.prototype.cubicTo = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 689 | CanvasKit.SkPath.prototype.dash = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 690 | CanvasKit.SkPath.prototype.lineTo = function() {}; |
| 691 | CanvasKit.SkPath.prototype.moveTo = function() {}; |
Kevin Lubick | e384df4 | 2019-08-26 15:48:09 -0400 | [diff] [blame] | 692 | CanvasKit.SkPath.prototype.offset = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 693 | CanvasKit.SkPath.prototype.op = function() {}; |
| 694 | CanvasKit.SkPath.prototype.quadTo = function() {}; |
Kevin Lubick | 79b7134 | 2019-11-01 14:36:52 -0400 | [diff] [blame^] | 695 | CanvasKit.SkPath.prototype.rArcTo = function() {}; |
| 696 | CanvasKit.SkPath.prototype.rConicTo = function() {}; |
| 697 | CanvasKit.SkPath.prototype.rCubicTo = function() {}; |
| 698 | CanvasKit.SkPath.prototype.rLineTo = function() {}; |
| 699 | CanvasKit.SkPath.prototype.rMoveTo = function() {}; |
| 700 | CanvasKit.SkPath.prototype.rQuadTo = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 701 | CanvasKit.SkPath.prototype.rect = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 702 | CanvasKit.SkPath.prototype.simplify = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 703 | CanvasKit.SkPath.prototype.stroke = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 704 | CanvasKit.SkPath.prototype.transform = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 705 | CanvasKit.SkPath.prototype.trim = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 706 | |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 707 | CanvasKit.SkPicture.prototype.DEBUGONLY_saveAsFile = function() {}; |
| 708 | |
Kevin Lubick | 5b90b84 | 2018-10-17 07:57:18 -0400 | [diff] [blame] | 709 | CanvasKit.SkSurface.prototype.dispose = function() {}; |
Kevin Lubick | 359a7e3 | 2019-03-19 09:34:37 -0400 | [diff] [blame] | 710 | CanvasKit.SkSurface.prototype.flush = function() {}; |
| 711 | CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {}; |
Kevin Lubick | cc13fd3 | 2019-04-05 13:00:01 -0400 | [diff] [blame] | 712 | CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {}; |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 713 | |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 714 | /** @return {CanvasKit.SkVertices} */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 715 | CanvasKit.SkVertices.prototype.applyBones = function() {}; |
| 716 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 717 | CanvasKit.SkImage.prototype.encodeToData = function() {}; |
Kevin Lubick | a064c28 | 2019-04-04 09:28:53 -0400 | [diff] [blame] | 718 | CanvasKit.SkImage.prototype.makeShader = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 719 | |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 720 | CanvasKit.SkCanvas.prototype.drawAtlas = function() {}; |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 721 | CanvasKit.SkCanvas.prototype.drawText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 722 | /** @return {Uint8Array} */ |
| 723 | CanvasKit.SkCanvas.prototype.readPixels = function() {}; |
| 724 | CanvasKit.SkCanvas.prototype.writePixels = function() {}; |
| 725 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 726 | CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {}; |
| 727 | |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 728 | CanvasKit.SkFont.prototype.getWidths = function() {}; |
| 729 | |
| 730 | CanvasKit.RSXFormBuilder.prototype.build = function() {}; |
| 731 | CanvasKit.RSXFormBuilder.prototype.delete = function() {}; |
| 732 | CanvasKit.RSXFormBuilder.prototype.push = function() {}; |
Kevin Lubick | ee91c07 | 2019-03-29 10:39:52 -0400 | [diff] [blame] | 733 | CanvasKit.RSXFormBuilder.prototype.set = function() {}; |
| 734 | |
| 735 | CanvasKit.SkColorBuilder.prototype.build = function() {}; |
| 736 | CanvasKit.SkColorBuilder.prototype.delete = function() {}; |
| 737 | CanvasKit.SkColorBuilder.prototype.push = function() {}; |
| 738 | CanvasKit.SkColorBuilder.prototype.set = function() {}; |
Kevin Lubick | d3cfbca | 2019-03-15 15:36:29 -0400 | [diff] [blame] | 739 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 740 | // Define StrokeOpts object |
| 741 | var StrokeOpts = {}; |
| 742 | StrokeOpts.prototype.width; |
| 743 | StrokeOpts.prototype.miter_limit; |
| 744 | StrokeOpts.prototype.cap; |
| 745 | StrokeOpts.prototype.join; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 746 | StrokeOpts.prototype.precision; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 747 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 748 | // Define everything created in the canvas2d spec here |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 749 | var HTMLCanvas = {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 750 | HTMLCanvas.prototype.decodeImage = function() {}; |
| 751 | HTMLCanvas.prototype.dispose = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 752 | HTMLCanvas.prototype.getContext = function() {}; |
Kevin Lubick | 8e4a331 | 2018-12-14 15:03:41 -0500 | [diff] [blame] | 753 | HTMLCanvas.prototype.loadFont = function() {}; |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 754 | HTMLCanvas.prototype.makePath2D = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 755 | HTMLCanvas.prototype.toDataURL = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 756 | |
| 757 | var CanvasRenderingContext2D = {}; |
| 758 | CanvasRenderingContext2D.prototype.addHitRegion = function() {}; |
| 759 | CanvasRenderingContext2D.prototype.arc = function() {}; |
| 760 | CanvasRenderingContext2D.prototype.arcTo = function() {}; |
| 761 | CanvasRenderingContext2D.prototype.beginPath = function() {}; |
| 762 | CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; |
| 763 | CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 764 | CanvasRenderingContext2D.prototype.clearRect = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 765 | CanvasRenderingContext2D.prototype.clip = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 766 | CanvasRenderingContext2D.prototype.closePath = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 767 | CanvasRenderingContext2D.prototype.createImageData = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 768 | CanvasRenderingContext2D.prototype.createLinearGradient = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 769 | CanvasRenderingContext2D.prototype.createPattern = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 770 | CanvasRenderingContext2D.prototype.createRadialGradient = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 771 | CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 772 | CanvasRenderingContext2D.prototype.drawImage = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 773 | CanvasRenderingContext2D.prototype.ellipse = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 774 | CanvasRenderingContext2D.prototype.fill = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 775 | CanvasRenderingContext2D.prototype.fillRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 776 | CanvasRenderingContext2D.prototype.fillText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 777 | CanvasRenderingContext2D.prototype.getImageData = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 778 | CanvasRenderingContext2D.prototype.getLineDash = function() {}; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 779 | CanvasRenderingContext2D.prototype.isPointInPath = function() {}; |
| 780 | CanvasRenderingContext2D.prototype.isPointInStroke = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 781 | CanvasRenderingContext2D.prototype.lineTo = function() {}; |
| 782 | CanvasRenderingContext2D.prototype.measureText = function() {}; |
| 783 | CanvasRenderingContext2D.prototype.moveTo = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 784 | CanvasRenderingContext2D.prototype.putImageData = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 785 | CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; |
| 786 | CanvasRenderingContext2D.prototype.rect = function() {}; |
| 787 | CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; |
| 788 | CanvasRenderingContext2D.prototype.resetTransform = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 789 | CanvasRenderingContext2D.prototype.restore = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 790 | CanvasRenderingContext2D.prototype.rotate = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 791 | CanvasRenderingContext2D.prototype.save = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 792 | CanvasRenderingContext2D.prototype.scale = function() {}; |
| 793 | CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 794 | CanvasRenderingContext2D.prototype.setLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 795 | CanvasRenderingContext2D.prototype.setTransform = function() {}; |
| 796 | CanvasRenderingContext2D.prototype.stroke = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 797 | CanvasRenderingContext2D.prototype.strokeRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 798 | CanvasRenderingContext2D.prototype.strokeText = function() {}; |
| 799 | CanvasRenderingContext2D.prototype.transform = function() {}; |
| 800 | CanvasRenderingContext2D.prototype.translate = function() {}; |
| 801 | |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 802 | var Path2D = {}; |
| 803 | Path2D.prototype.addPath = function() {}; |
| 804 | Path2D.prototype.arc = function() {}; |
| 805 | Path2D.prototype.arcTo = function() {}; |
| 806 | Path2D.prototype.bezierCurveTo = function() {}; |
| 807 | Path2D.prototype.closePath = function() {}; |
| 808 | Path2D.prototype.ellipse = function() {}; |
| 809 | Path2D.prototype.lineTo = function() {}; |
| 810 | Path2D.prototype.moveTo = function() {}; |
| 811 | Path2D.prototype.quadraticCurveTo = function() {}; |
| 812 | Path2D.prototype.rect = function() {}; |
| 813 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 814 | var LinearCanvasGradient = {}; |
| 815 | LinearCanvasGradient.prototype.addColorStop = function() {}; |
| 816 | var RadialCanvasGradient = {}; |
| 817 | RadialCanvasGradient.prototype.addColorStop = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 818 | var CanvasPattern = {}; |
| 819 | CanvasPattern.prototype.setTransform = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 820 | |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 821 | var ImageData = { |
| 822 | /** |
| 823 | * @type {Uint8ClampedArray} |
| 824 | */ |
| 825 | data: {}, |
| 826 | height: {}, |
| 827 | width: {}, |
| 828 | }; |
| 829 | |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 830 | var DOMMatrix = { |
| 831 | a: {}, |
| 832 | b: {}, |
| 833 | c: {}, |
| 834 | d: {}, |
| 835 | e: {}, |
| 836 | f: {}, |
| 837 | }; |
| 838 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 839 | // 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] | 840 | function loadWebAssemblyModule() {}; |