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