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