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