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