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 | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 32 | /** @return {ImageData} */ |
| 33 | ImageData: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 34 | |
| 35 | GetWebGLContext: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 36 | MakeBlurMaskFilter: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 37 | MakeCanvas: function() {}, |
| 38 | MakeCanvasSurface: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 39 | MakeGrContext: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 40 | MakeImageShader: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 41 | /** @return {CanvasKit.SkImage} */ |
| 42 | MakeImageFromEncoded: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 43 | /** @return {LinearCanvasGradient} */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 44 | MakeLinearGradientShader: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 45 | MakeOnScreenGLSurface: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 46 | MakePathFromCmds: function() {}, |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 47 | MakePathFromOp: function() {}, |
| 48 | MakePathFromSVGString: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 49 | MakeRadialGradientShader: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 50 | MakeRenderTarget: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 51 | MakeSWCanvasSurface: function() {}, |
Kevin Lubick | f5ea37f | 2019-02-28 10:06:18 -0500 | [diff] [blame] | 52 | MakeManagedAnimation: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 53 | MakeSkDashPathEffect: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 54 | MakeSkVertices: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 55 | MakeSurface: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 56 | /** @return {RadialCanvasGradient} */ |
| 57 | MakeTwoPointConicalGradientShader: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 58 | MakeWebGLCanvasSurface: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 59 | currentContext: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 60 | getColorComponents: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 61 | getSkDataBytes: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 62 | multiplyByAlpha: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 63 | setCurrentContext: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 64 | |
| 65 | // private API (i.e. things declared in the bindings that we use |
| 66 | // in the pre-js file) |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 67 | _MakeImage: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 68 | _MakeImageShader: function() {}, |
| 69 | _MakeLinearGradientShader: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 70 | _MakePathFromCmds: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 71 | _MakeRadialGradientShader: function() {}, |
Kevin Lubick | f5ea37f | 2019-02-28 10:06:18 -0500 | [diff] [blame] | 72 | _MakeManagedAnimation: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 73 | _MakeSkDashPathEffect: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 74 | _MakeSkVertices: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 75 | _MakeTwoPointConicalGradientShader: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 76 | _decodeImage: function() {}, |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 77 | _drawShapedText: function() {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 78 | _getRasterDirectSurface: function() {}, |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 79 | _getRasterN32PremulSurface: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 80 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 81 | // The testing object is meant to expose internal functions |
| 82 | // for more fine-grained testing, e.g. parseColor |
| 83 | _testing: {}, |
| 84 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 85 | // Objects and properties on CanvasKit |
| 86 | |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 87 | ShapedText: { |
| 88 | // public API (from C++ bindings) |
| 89 | getBounds: function() {}, |
| 90 | }, |
| 91 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 92 | SkCanvas: { |
| 93 | // public API (from C++ bindings) |
| 94 | clear: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 95 | clipPath: function() {}, |
Kevin Lubick | 5d5723c | 2018-12-07 10:09:11 -0500 | [diff] [blame] | 96 | clipRect: function() {}, |
| 97 | concat: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 98 | drawArc: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 99 | drawImage: function() {}, |
| 100 | drawImageRect: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 101 | drawLine: function() {}, |
| 102 | drawOval: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 103 | drawPaint: function() {}, |
| 104 | drawPath: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 105 | drawRect: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 106 | drawRoundRect: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 107 | drawShadow: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 108 | drawText: function() {}, |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 109 | drawTextBlob: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 110 | drawVertices: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 111 | flush: function() {}, |
Kevin Lubick | 5d5723c | 2018-12-07 10:09:11 -0500 | [diff] [blame] | 112 | getTotalMatrix: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 113 | makeSurface: function() {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 114 | restore: function() {}, |
Kevin Lubick | b3574c9 | 2019-03-06 08:25:36 -0500 | [diff] [blame] | 115 | restoreToCount: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 116 | rotate: function() {}, |
| 117 | save: function() {}, |
Kevin Lubick | b3574c9 | 2019-03-06 08:25:36 -0500 | [diff] [blame] | 118 | saveLayer: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 119 | scale: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 120 | skew: function() {}, |
| 121 | translate: function() {}, |
| 122 | |
| 123 | // private API |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 124 | _drawSimpleText: function() {}, |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 125 | _readPixels: function() {}, |
| 126 | _writePixels: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 127 | delete: function() {}, |
| 128 | }, |
| 129 | |
Kevin Lubick | 35ac038 | 2019-01-02 15:13:57 -0500 | [diff] [blame] | 130 | SkFont: { |
| 131 | // public API (from C++ bindings) |
| 132 | getScaleX: function() {}, |
| 133 | getSize: function() {}, |
| 134 | getSkewX: function() {}, |
| 135 | getTypeface: function() {}, |
| 136 | measureText: function() {}, |
| 137 | setScaleX: function() {}, |
| 138 | setSize: function() {}, |
| 139 | setSkewX: function() {}, |
| 140 | setTypeface: function() {}, |
| 141 | }, |
| 142 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 143 | SkFontMgr: { |
| 144 | // public API (from C++ bindings) |
| 145 | RefDefault: function() {}, |
| 146 | countFamilies: function() {}, |
| 147 | |
| 148 | // private API |
| 149 | _makeTypefaceFromData: function() {}, |
| 150 | }, |
| 151 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 152 | SkImage: { |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 153 | // public API (from C++ bindings) |
| 154 | height: function() {}, |
| 155 | width: function() {}, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 156 | // private API |
| 157 | _encodeToData: function() {}, |
| 158 | _encodeToDataWithFormat: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 159 | }, |
| 160 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 161 | SkMatrix: { |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 162 | identity: function() {}, |
Kevin Lubick | f355518 | 2019-03-14 10:55:10 -0400 | [diff] [blame^] | 163 | invert: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 164 | mapPoints: function() {}, |
| 165 | multiply: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 166 | rotated: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 167 | scaled: function() {}, |
| 168 | skewed: function() {}, |
| 169 | translated: function() {}, |
| 170 | }, |
| 171 | |
| 172 | SkPaint: { |
| 173 | // public API (from C++ bindings) |
| 174 | /** @return {CanvasKit.SkPaint} */ |
| 175 | copy: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 176 | getBlendMode: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 177 | getColor: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 178 | getFilterQuality: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 179 | getStrokeCap: function() {}, |
| 180 | getStrokeJoin: function() {}, |
| 181 | getStrokeMiter: function() {}, |
| 182 | getStrokeWidth: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 183 | setAntiAlias: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 184 | setBlendMode: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 185 | setColor: function() {}, |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 186 | setFilterQuality: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 187 | setMaskFilter: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 188 | setPathEffect: function() {}, |
| 189 | setShader: function() {}, |
| 190 | setStrokeCap: function() {}, |
| 191 | setStrokeJoin: function() {}, |
| 192 | setStrokeMiter: function() {}, |
| 193 | setStrokeWidth: function() {}, |
| 194 | setStyle: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 195 | |
| 196 | //private API |
| 197 | delete: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 198 | }, |
| 199 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 200 | SkPath: { |
| 201 | // public API (from C++ bindings) |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 202 | computeTightBounds: function() {}, |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 203 | contains: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 204 | /** @return {CanvasKit.SkPath} */ |
| 205 | copy: function() {}, |
| 206 | countPoints: function() {}, |
| 207 | equals: function() {}, |
| 208 | getBounds: function() {}, |
| 209 | getFillType: function() {}, |
| 210 | getPoint: function() {}, |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 211 | isEmpty: function() {}, |
Kevin Lubick | 2b79d1c | 2018-12-14 16:10:38 -0500 | [diff] [blame] | 212 | isVolatile: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 213 | reset: function() {}, |
| 214 | rewind: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 215 | setFillType: function() {}, |
Kevin Lubick | 2b79d1c | 2018-12-14 16:10:38 -0500 | [diff] [blame] | 216 | setIsVolatile: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 217 | toSVGString: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 218 | |
| 219 | // private API |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 220 | _addArc: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 221 | _addPath: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 222 | _addRect: function() {}, |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 223 | _addRoundRect: function() {}, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 224 | _arc: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 225 | _arcTo: function() {}, |
| 226 | _close: function() {}, |
| 227 | _conicTo: function() {}, |
| 228 | _cubicTo: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 229 | _dash: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 230 | _lineTo: function() {}, |
| 231 | _moveTo: function() {}, |
| 232 | _op: function() {}, |
| 233 | _quadTo: function() {}, |
| 234 | _rect: function() {}, |
| 235 | _simplify: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 236 | _stroke: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 237 | _transform: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 238 | _trim: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 239 | delete: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 240 | dump: function() {}, |
| 241 | dumpHex: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 242 | }, |
| 243 | |
| 244 | SkRect: { |
| 245 | fLeft: {}, |
| 246 | fTop: {}, |
| 247 | fRight: {}, |
| 248 | fBottom: {}, |
| 249 | }, |
| 250 | |
| 251 | SkSurface: { |
| 252 | // public API (from C++ bindings) |
| 253 | /** @return {CanvasKit.SkCanvas} */ |
| 254 | getCanvas: function() {}, |
| 255 | /** @return {CanvasKit.SkImage} */ |
| 256 | makeImageSnapshot: function() {}, |
Kevin Lubick | 543f352 | 2019-03-08 10:04:28 -0500 | [diff] [blame] | 257 | makeSurface: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 258 | |
| 259 | // private API |
| 260 | _flush: function() {}, |
| 261 | _getRasterN32PremulSurface: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 262 | delete: function() {}, |
| 263 | }, |
| 264 | |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 265 | SkTextBlob: { |
| 266 | MakeFromText: function() {}, |
| 267 | _MakeFromText: function() {}, |
| 268 | }, |
| 269 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 270 | SkVertices: { |
| 271 | // public API (from C++ bindings) |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 272 | bounds: function() {}, |
| 273 | mode: function() {}, |
| 274 | uniqueID: function() {}, |
| 275 | vertexCount: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 276 | |
| 277 | // private API |
| 278 | /** @return {CanvasKit.SkVertices} */ |
| 279 | _applyBones: function() {}, |
| 280 | }, |
| 281 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 282 | // Constants and Enums |
| 283 | gpu: {}, |
| 284 | skottie: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 285 | |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 286 | TRANSPARENT: {}, |
| 287 | RED: {}, |
| 288 | BLUE: {}, |
| 289 | YELLOW: {}, |
| 290 | CYAN: {}, |
| 291 | BLACK: {}, |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 292 | WHITE: {}, |
| 293 | |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 294 | MOVE_VERB: {}, |
| 295 | LINE_VERB: {}, |
| 296 | QUAD_VERB: {}, |
| 297 | CONIC_VERB: {}, |
| 298 | CUBIC_VERB: {}, |
| 299 | CLOSE_VERB: {}, |
| 300 | |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 301 | AlphaType: { |
| 302 | Opaque: {}, |
| 303 | Premul: {}, |
| 304 | Unpremul: {}, |
| 305 | }, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 306 | |
| 307 | BlendMode: { |
| 308 | Clear: {}, |
| 309 | Src: {}, |
| 310 | Dst: {}, |
| 311 | SrcOver: {}, |
| 312 | DstOver: {}, |
| 313 | SrcIn: {}, |
| 314 | DstIn: {}, |
| 315 | SrcOut: {}, |
| 316 | DstOut: {}, |
| 317 | SrcATop: {}, |
| 318 | DstATop: {}, |
| 319 | Xor: {}, |
| 320 | Plus: {}, |
| 321 | Modulate: {}, |
| 322 | Screen: {}, |
| 323 | Overlay: {}, |
| 324 | Darken: {}, |
| 325 | Lighten: {}, |
| 326 | ColorDodge: {}, |
| 327 | ColorBurn: {}, |
| 328 | HardLight: {}, |
| 329 | SoftLight: {}, |
| 330 | Difference: {}, |
| 331 | Exclusion: {}, |
| 332 | Multiply: {}, |
| 333 | Hue: {}, |
| 334 | Saturation: {}, |
| 335 | Color: {}, |
| 336 | Luminosity: {}, |
| 337 | }, |
| 338 | |
| 339 | BlurStyle: { |
| 340 | Normal: {}, |
| 341 | Solid: {}, |
| 342 | Outer: {}, |
| 343 | Inner: {}, |
| 344 | }, |
| 345 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 346 | ClipOp: { |
| 347 | Difference: {}, |
| 348 | Intersect: {}, |
| 349 | }, |
| 350 | |
Kevin Lubick | ea905ec | 2018-11-30 14:05:58 -0500 | [diff] [blame] | 351 | ColorType: { |
| 352 | Alpha_8: {}, |
| 353 | RGB_565: {}, |
| 354 | ARGB_4444: {}, |
| 355 | RGBA_8888: {}, |
| 356 | RGB_888x: {}, |
| 357 | BGRA_8888: {}, |
| 358 | RGBA_1010102: {}, |
| 359 | RGB_101010x: {}, |
| 360 | Gray_8: {}, |
| 361 | RGBA_F16: {}, |
| 362 | RGBA_F32: {}, |
| 363 | }, |
| 364 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 365 | FillType: { |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 366 | Winding: {}, |
| 367 | EvenOdd: {}, |
| 368 | InverseWinding: {}, |
| 369 | InverseEvenOdd: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 370 | }, |
| 371 | |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 372 | FilterQuality: { |
| 373 | None: {}, |
| 374 | Low: {}, |
| 375 | Medium: {}, |
| 376 | High: {}, |
| 377 | }, |
| 378 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 379 | ImageFormat: { |
| 380 | PNG: {}, |
| 381 | JPEG: {}, |
| 382 | }, |
| 383 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 384 | PaintStyle: { |
| 385 | Fill: {}, |
| 386 | Stroke: {}, |
| 387 | StrokeAndFill: {}, |
| 388 | }, |
| 389 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 390 | PathOp: { |
| 391 | Difference: {}, |
| 392 | Intersect: {}, |
| 393 | Union: {}, |
| 394 | XOR: {}, |
| 395 | ReverseDifference: {}, |
| 396 | }, |
| 397 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 398 | StrokeCap: { |
| 399 | Butt: {}, |
| 400 | Round: {}, |
| 401 | Square: {}, |
| 402 | }, |
| 403 | |
| 404 | StrokeJoin: { |
| 405 | Miter: {}, |
| 406 | Round: {}, |
| 407 | Bevel: {}, |
| 408 | }, |
| 409 | |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 410 | TextEncoding: { |
| 411 | UTF8: {}, |
| 412 | UTF16: {}, |
| 413 | UTF32: {}, |
| 414 | GlyphID: {}, |
| 415 | }, |
| 416 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 417 | TileMode: { |
| 418 | Clamp: {}, |
| 419 | Repeat: {}, |
| 420 | Mirror: {}, |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 421 | Decal: {}, |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 422 | }, |
| 423 | |
| 424 | VertexMode: { |
| 425 | Triangles: {}, |
| 426 | TrianglesStrip: {}, |
| 427 | TriangleFan: {}, |
| 428 | }, |
| 429 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 430 | // Things Enscriptem adds for us |
| 431 | |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 432 | /** Represents the heap of the WASM code |
| 433 | * @type {ArrayBuffer} |
| 434 | */ |
| 435 | buffer: {}, |
| 436 | /** |
| 437 | * @type {Float32Array} |
| 438 | */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 439 | HEAPF32: {}, |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 440 | /** |
| 441 | * @type {Uint8Array} |
| 442 | */ |
| 443 | HEAPU8: {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 444 | /** |
| 445 | * @type {Uint16Array} |
| 446 | */ |
| 447 | HEAPU16: {}, |
| 448 | /** |
| 449 | * @type {Int32Array} |
| 450 | */ |
| 451 | HEAP32: {}, |
Kevin Lubick | f5ea37f | 2019-02-28 10:06:18 -0500 | [diff] [blame] | 452 | /** |
| 453 | * @type {Uint32Array} |
| 454 | */ |
| 455 | HEAPU32: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 456 | _malloc: function() {}, |
| 457 | _free: function() {}, |
| 458 | onRuntimeInitialized: function() {}, |
| 459 | }; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 460 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 461 | // Public API things that are newly declared in the JS should go here. |
| 462 | // It's not enough to declare them above, because closure can still erase them |
| 463 | // unless they go on the prototype. |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 464 | CanvasKit.SkPath.prototype.addArc = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 465 | CanvasKit.SkPath.prototype.addPath = function() {}; |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 466 | CanvasKit.SkPath.prototype.addRect = function() {}; |
Kevin Lubick | da3d8ac | 2019-01-07 11:08:55 -0500 | [diff] [blame] | 467 | CanvasKit.SkPath.prototype.addRoundRect = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 468 | CanvasKit.SkPath.prototype.arc = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 469 | CanvasKit.SkPath.prototype.arcTo = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 470 | CanvasKit.SkPath.prototype.close = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 471 | CanvasKit.SkPath.prototype.conicTo = function() {}; |
| 472 | CanvasKit.SkPath.prototype.cubicTo = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 473 | CanvasKit.SkPath.prototype.dash = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 474 | CanvasKit.SkPath.prototype.lineTo = function() {}; |
| 475 | CanvasKit.SkPath.prototype.moveTo = function() {}; |
| 476 | CanvasKit.SkPath.prototype.op = function() {}; |
| 477 | CanvasKit.SkPath.prototype.quadTo = function() {}; |
| 478 | CanvasKit.SkPath.prototype.rect = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 479 | CanvasKit.SkPath.prototype.simplify = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 480 | CanvasKit.SkPath.prototype.stroke = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 481 | CanvasKit.SkPath.prototype.transform = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 482 | CanvasKit.SkPath.prototype.trim = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 483 | |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 484 | CanvasKit.SkSurface.prototype.flush = function() {}; |
Kevin Lubick | 5b90b84 | 2018-10-17 07:57:18 -0400 | [diff] [blame] | 485 | CanvasKit.SkSurface.prototype.dispose = function() {}; |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 486 | |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 487 | /** @return {CanvasKit.SkVertices} */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 488 | CanvasKit.SkVertices.prototype.applyBones = function() {}; |
| 489 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 490 | CanvasKit.SkImage.prototype.encodeToData = function() {}; |
| 491 | |
Kevin Lubick | ec4903d | 2019-01-14 08:36:08 -0500 | [diff] [blame] | 492 | CanvasKit.SkCanvas.prototype.drawText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 493 | /** @return {Uint8Array} */ |
| 494 | CanvasKit.SkCanvas.prototype.readPixels = function() {}; |
| 495 | CanvasKit.SkCanvas.prototype.writePixels = function() {}; |
| 496 | |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 497 | CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {}; |
| 498 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 499 | // Define StrokeOpts object |
| 500 | var StrokeOpts = {}; |
| 501 | StrokeOpts.prototype.width; |
| 502 | StrokeOpts.prototype.miter_limit; |
| 503 | StrokeOpts.prototype.cap; |
| 504 | StrokeOpts.prototype.join; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 505 | StrokeOpts.prototype.precision; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 506 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 507 | // Define everything created in the canvas2d spec here |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 508 | var HTMLCanvas = {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 509 | HTMLCanvas.prototype.decodeImage = function() {}; |
| 510 | HTMLCanvas.prototype.dispose = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 511 | HTMLCanvas.prototype.getContext = function() {}; |
Kevin Lubick | 8e4a331 | 2018-12-14 15:03:41 -0500 | [diff] [blame] | 512 | HTMLCanvas.prototype.loadFont = function() {}; |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 513 | HTMLCanvas.prototype.makePath2D = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 514 | HTMLCanvas.prototype.toDataURL = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 515 | |
| 516 | var CanvasRenderingContext2D = {}; |
| 517 | CanvasRenderingContext2D.prototype.addHitRegion = function() {}; |
| 518 | CanvasRenderingContext2D.prototype.arc = function() {}; |
| 519 | CanvasRenderingContext2D.prototype.arcTo = function() {}; |
| 520 | CanvasRenderingContext2D.prototype.beginPath = function() {}; |
| 521 | CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; |
| 522 | CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 523 | CanvasRenderingContext2D.prototype.clearRect = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 524 | CanvasRenderingContext2D.prototype.clip = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 525 | CanvasRenderingContext2D.prototype.closePath = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 526 | CanvasRenderingContext2D.prototype.createImageData = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 527 | CanvasRenderingContext2D.prototype.createLinearGradient = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 528 | CanvasRenderingContext2D.prototype.createPattern = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 529 | CanvasRenderingContext2D.prototype.createRadialGradient = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 530 | CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; |
Kevin Lubick | 0a1293c | 2018-12-03 12:31:04 -0500 | [diff] [blame] | 531 | CanvasRenderingContext2D.prototype.drawImage = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 532 | CanvasRenderingContext2D.prototype.ellipse = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 533 | CanvasRenderingContext2D.prototype.fill = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 534 | CanvasRenderingContext2D.prototype.fillRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 535 | CanvasRenderingContext2D.prototype.fillText = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 536 | CanvasRenderingContext2D.prototype.getImageData = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 537 | CanvasRenderingContext2D.prototype.getLineDash = function() {}; |
Kevin Lubick | 1646e7d | 2018-12-07 13:03:08 -0500 | [diff] [blame] | 538 | CanvasRenderingContext2D.prototype.isPointInPath = function() {}; |
| 539 | CanvasRenderingContext2D.prototype.isPointInStroke = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 540 | CanvasRenderingContext2D.prototype.lineTo = function() {}; |
| 541 | CanvasRenderingContext2D.prototype.measureText = function() {}; |
| 542 | CanvasRenderingContext2D.prototype.moveTo = function() {}; |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 543 | CanvasRenderingContext2D.prototype.putImageData = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 544 | CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; |
| 545 | CanvasRenderingContext2D.prototype.rect = function() {}; |
| 546 | CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; |
| 547 | CanvasRenderingContext2D.prototype.resetTransform = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 548 | CanvasRenderingContext2D.prototype.restore = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 549 | CanvasRenderingContext2D.prototype.rotate = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 550 | CanvasRenderingContext2D.prototype.save = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 551 | CanvasRenderingContext2D.prototype.scale = function() {}; |
| 552 | CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 553 | CanvasRenderingContext2D.prototype.setLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 554 | CanvasRenderingContext2D.prototype.setTransform = function() {}; |
| 555 | CanvasRenderingContext2D.prototype.stroke = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 556 | CanvasRenderingContext2D.prototype.strokeRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 557 | CanvasRenderingContext2D.prototype.strokeText = function() {}; |
| 558 | CanvasRenderingContext2D.prototype.transform = function() {}; |
| 559 | CanvasRenderingContext2D.prototype.translate = function() {}; |
| 560 | |
Kevin Lubick | a40f832 | 2018-12-17 16:01:36 -0500 | [diff] [blame] | 561 | var Path2D = {}; |
| 562 | Path2D.prototype.addPath = function() {}; |
| 563 | Path2D.prototype.arc = function() {}; |
| 564 | Path2D.prototype.arcTo = function() {}; |
| 565 | Path2D.prototype.bezierCurveTo = function() {}; |
| 566 | Path2D.prototype.closePath = function() {}; |
| 567 | Path2D.prototype.ellipse = function() {}; |
| 568 | Path2D.prototype.lineTo = function() {}; |
| 569 | Path2D.prototype.moveTo = function() {}; |
| 570 | Path2D.prototype.quadraticCurveTo = function() {}; |
| 571 | Path2D.prototype.rect = function() {}; |
| 572 | |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 573 | var LinearCanvasGradient = {}; |
| 574 | LinearCanvasGradient.prototype.addColorStop = function() {}; |
| 575 | var RadialCanvasGradient = {}; |
| 576 | RadialCanvasGradient.prototype.addColorStop = function() {}; |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 577 | var CanvasPattern = {}; |
| 578 | CanvasPattern.prototype.setTransform = function() {}; |
Kevin Lubick | eb2f6b0 | 2018-11-29 15:07:02 -0500 | [diff] [blame] | 579 | |
Kevin Lubick | 52b9f37 | 2018-12-04 13:57:36 -0500 | [diff] [blame] | 580 | var ImageData = { |
| 581 | /** |
| 582 | * @type {Uint8ClampedArray} |
| 583 | */ |
| 584 | data: {}, |
| 585 | height: {}, |
| 586 | width: {}, |
| 587 | }; |
| 588 | |
Kevin Lubick | d29edd7 | 2018-12-07 08:29:52 -0500 | [diff] [blame] | 589 | var DOMMatrix = { |
| 590 | a: {}, |
| 591 | b: {}, |
| 592 | c: {}, |
| 593 | d: {}, |
| 594 | e: {}, |
| 595 | f: {}, |
| 596 | }; |
| 597 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 598 | // 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] | 599 | function loadWebAssemblyModule() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame] | 600 | |
| 601 | var DOMMatrix = {}; |