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