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