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