Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1 | /* |
| 2 | * This externs file prevents the Closure JS compiler from minifying away |
| 3 | * names of objects created by Emscripten. |
| 4 | * Basically, by defining empty objects and functions here, Closure will |
| 5 | * know not to rename them. This is needed because of our pre-js files, |
| 6 | * that is, the JS we hand-write to bundle into the output. That JS will be |
| 7 | * hit by the closure compiler and thus needs to know about what functions |
| 8 | * have special names and should not be minified. |
| 9 | * |
| 10 | * Emscripten does not support automatically generating an externs file, so we |
| 11 | * do it by hand. The general process is to write some JS code, and then put any |
| 12 | * calls to CanvasKit or related things in here. Running ./compile.sh and then |
| 13 | * looking at the minified results or running the Release trybot should |
| 14 | * verify nothing was missed. Optionally, looking directly at the minified |
| 15 | * pathkit.js can be useful when developing locally. |
| 16 | * |
| 17 | * Docs: |
| 18 | * https://github.com/cljsjs/packages/wiki/Creating-Externs |
| 19 | * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System |
| 20 | * |
| 21 | * Example externs: |
| 22 | * https://github.com/google/closure-compiler/tree/master/externs |
| 23 | */ |
| 24 | |
| 25 | var CanvasKit = { |
| 26 | // public API (i.e. things we declare in the pre-js file) |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 27 | Color: function() {}, |
| 28 | /** @return {CanvasKit.SkRect} */ |
| 29 | LTRBRect: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 30 | MakeBlurMaskFilter: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 31 | MakeCanvas: function() {}, |
| 32 | MakeCanvasSurface: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 33 | MakeImageShader: function() {}, |
| 34 | MakeLinearGradientShader: function() {}, |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 35 | MakeNimaActor: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 36 | MakeRadialGradientShader: function() {}, |
| 37 | MakeSWCanvasSurface: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 38 | MakeSkDashPathEffect: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 39 | MakeSkVertices: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 40 | MakeSurface: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 41 | MakeWebGLCanvasSurface: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 42 | currentContext: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 43 | getColorComponents: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 44 | getSkDataBytes: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 45 | initFonts: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 46 | multiplyByAlpha: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 47 | setCurrentContext: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 48 | |
| 49 | // private API (i.e. things declared in the bindings that we use |
| 50 | // in the pre-js file) |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 51 | _MakeImageShader: function() {}, |
| 52 | _MakeLinearGradientShader: function() {}, |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 53 | _MakeNimaActor: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 54 | _MakeRadialGradientShader: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 55 | _MakeSkDashPathEffect: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 56 | _MakeSkVertices: function() {}, |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 57 | _getRasterN32PremulSurface: function() {}, |
| 58 | _getWebGLSurface: function() {}, |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 59 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 60 | // The testing object is meant to expose internal functions |
| 61 | // for more fine-grained testing, e.g. parseColor |
| 62 | _testing: {}, |
| 63 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 64 | // Objects and properties on CanvasKit |
| 65 | |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 66 | NimaActor: { |
| 67 | // public API (from C++ bindings) |
| 68 | duration: function() {}, |
| 69 | getAnimationNames: function() {}, |
| 70 | render: function() {}, |
| 71 | seek: function() {}, |
| 72 | setAnimationByIndex: function() {}, |
| 73 | setAnimationByName: function() {}, |
| 74 | |
| 75 | // private API |
| 76 | }, |
| 77 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 78 | SkCanvas: { |
| 79 | // public API (from C++ bindings) |
| 80 | clear: function() {}, |
| 81 | drawPaint: function() {}, |
| 82 | drawPath: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 83 | drawRect: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 84 | drawShadow: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 85 | drawText: function() {}, |
| 86 | drawVertices: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 87 | flush: function() {}, |
| 88 | rotate: function() {}, |
| 89 | save: function() {}, |
| 90 | scale: function() {}, |
| 91 | setMatrix: function() {}, |
| 92 | skew: function() {}, |
| 93 | translate: function() {}, |
| 94 | |
| 95 | // private API |
| 96 | delete: function() {}, |
| 97 | }, |
| 98 | |
| 99 | SkImage: { |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 100 | // private API |
| 101 | _encodeToData: function() {}, |
| 102 | _encodeToDataWithFormat: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 103 | }, |
| 104 | |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 105 | SkMatrix: { |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 106 | identity: function() {}, |
| 107 | mapPoints: function() {}, |
| 108 | multiply: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 109 | rotated: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 110 | scaled: function() {}, |
| 111 | skewed: function() {}, |
| 112 | translated: function() {}, |
| 113 | }, |
| 114 | |
| 115 | SkPaint: { |
| 116 | // public API (from C++ bindings) |
| 117 | /** @return {CanvasKit.SkPaint} */ |
| 118 | copy: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 119 | getBlendMode: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 120 | getColor: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 121 | getStrokeCap: function() {}, |
| 122 | getStrokeJoin: function() {}, |
| 123 | getStrokeMiter: function() {}, |
| 124 | getStrokeWidth: function() {}, |
| 125 | getTextSize: function() {}, |
| 126 | measureText: function() {}, |
| 127 | setAntiAlias: function() {}, |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 128 | setBlendMode: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 129 | setColor: function() {}, |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 130 | setMaskFilter: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 131 | setPathEffect: function() {}, |
| 132 | setShader: function() {}, |
| 133 | setStrokeCap: function() {}, |
| 134 | setStrokeJoin: function() {}, |
| 135 | setStrokeMiter: function() {}, |
| 136 | setStrokeWidth: function() {}, |
| 137 | setStyle: function() {}, |
| 138 | setTextSize: function() {}, |
| 139 | |
| 140 | //private API |
| 141 | delete: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 142 | }, |
| 143 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 144 | SkPath: { |
| 145 | // public API (from C++ bindings) |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 146 | computeTightBounds: function() {}, |
| 147 | /** @return {CanvasKit.SkPath} */ |
| 148 | copy: function() {}, |
| 149 | countPoints: function() {}, |
| 150 | equals: function() {}, |
| 151 | getBounds: function() {}, |
| 152 | getFillType: function() {}, |
| 153 | getPoint: function() {}, |
| 154 | setFillType: function() {}, |
| 155 | toSVGString: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 156 | |
| 157 | // private API |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 158 | _addArc: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 159 | _addPath: function() {}, |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 160 | _addRect: function() {}, |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 161 | _arc: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 162 | _arcTo: function() {}, |
| 163 | _close: function() {}, |
| 164 | _conicTo: function() {}, |
| 165 | _cubicTo: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 166 | _dash: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 167 | _lineTo: function() {}, |
| 168 | _moveTo: function() {}, |
| 169 | _op: function() {}, |
| 170 | _quadTo: function() {}, |
| 171 | _rect: function() {}, |
| 172 | _simplify: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 173 | _stroke: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 174 | _transform: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 175 | _trim: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 176 | delete: function() {}, |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 177 | dump: function() {}, |
| 178 | dumpHex: function() {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 179 | }, |
| 180 | |
| 181 | SkRect: { |
| 182 | fLeft: {}, |
| 183 | fTop: {}, |
| 184 | fRight: {}, |
| 185 | fBottom: {}, |
| 186 | }, |
| 187 | |
| 188 | SkSurface: { |
| 189 | // public API (from C++ bindings) |
| 190 | /** @return {CanvasKit.SkCanvas} */ |
| 191 | getCanvas: function() {}, |
| 192 | /** @return {CanvasKit.SkImage} */ |
| 193 | makeImageSnapshot: function() {}, |
| 194 | |
| 195 | // private API |
| 196 | _flush: function() {}, |
| 197 | _getRasterN32PremulSurface: function() {}, |
| 198 | _readPixels: function() {}, |
| 199 | delete: function() {}, |
| 200 | }, |
| 201 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 202 | SkVertices: { |
| 203 | // public API (from C++ bindings) |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 204 | bounds: function() {}, |
| 205 | mode: function() {}, |
| 206 | uniqueID: function() {}, |
| 207 | vertexCount: function() {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 208 | |
| 209 | // private API |
| 210 | /** @return {CanvasKit.SkVertices} */ |
| 211 | _applyBones: function() {}, |
| 212 | }, |
| 213 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 214 | // Constants and Enums |
| 215 | gpu: {}, |
| 216 | skottie: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 217 | |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 218 | TRANSPARENT: {}, |
| 219 | RED: {}, |
| 220 | BLUE: {}, |
| 221 | YELLOW: {}, |
| 222 | CYAN: {}, |
| 223 | BLACK: {}, |
| 224 | |
| 225 | BlendMode: { |
| 226 | Clear: {}, |
| 227 | Src: {}, |
| 228 | Dst: {}, |
| 229 | SrcOver: {}, |
| 230 | DstOver: {}, |
| 231 | SrcIn: {}, |
| 232 | DstIn: {}, |
| 233 | SrcOut: {}, |
| 234 | DstOut: {}, |
| 235 | SrcATop: {}, |
| 236 | DstATop: {}, |
| 237 | Xor: {}, |
| 238 | Plus: {}, |
| 239 | Modulate: {}, |
| 240 | Screen: {}, |
| 241 | Overlay: {}, |
| 242 | Darken: {}, |
| 243 | Lighten: {}, |
| 244 | ColorDodge: {}, |
| 245 | ColorBurn: {}, |
| 246 | HardLight: {}, |
| 247 | SoftLight: {}, |
| 248 | Difference: {}, |
| 249 | Exclusion: {}, |
| 250 | Multiply: {}, |
| 251 | Hue: {}, |
| 252 | Saturation: {}, |
| 253 | Color: {}, |
| 254 | Luminosity: {}, |
| 255 | }, |
| 256 | |
| 257 | BlurStyle: { |
| 258 | Normal: {}, |
| 259 | Solid: {}, |
| 260 | Outer: {}, |
| 261 | Inner: {}, |
| 262 | }, |
| 263 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 264 | FillType: { |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 265 | Winding: {}, |
| 266 | EvenOdd: {}, |
| 267 | InverseWinding: {}, |
| 268 | InverseEvenOdd: {}, |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 269 | }, |
| 270 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 271 | ImageFormat: { |
| 272 | PNG: {}, |
| 273 | JPEG: {}, |
| 274 | }, |
| 275 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 276 | PaintStyle: { |
| 277 | Fill: {}, |
| 278 | Stroke: {}, |
| 279 | StrokeAndFill: {}, |
| 280 | }, |
| 281 | |
| 282 | StrokeCap: { |
| 283 | Butt: {}, |
| 284 | Round: {}, |
| 285 | Square: {}, |
| 286 | }, |
| 287 | |
| 288 | StrokeJoin: { |
| 289 | Miter: {}, |
| 290 | Round: {}, |
| 291 | Bevel: {}, |
| 292 | }, |
| 293 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 294 | // Things Enscriptem adds for us |
| 295 | |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 296 | /** Represents the heap of the WASM code |
| 297 | * @type {ArrayBuffer} |
| 298 | */ |
| 299 | buffer: {}, |
| 300 | /** |
| 301 | * @type {Float32Array} |
| 302 | */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 303 | HEAPF32: {}, |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 304 | /** |
| 305 | * @type {Uint8Array} |
| 306 | */ |
| 307 | HEAPU8: {}, |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 308 | /** |
| 309 | * @type {Uint16Array} |
| 310 | */ |
| 311 | HEAPU16: {}, |
| 312 | /** |
| 313 | * @type {Int32Array} |
| 314 | */ |
| 315 | HEAP32: {}, |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 316 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 317 | _malloc: function() {}, |
| 318 | _free: function() {}, |
| 319 | onRuntimeInitialized: function() {}, |
| 320 | }; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 321 | |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 322 | // Public API things that are newly declared in the JS should go here. |
| 323 | // It's not enough to declare them above, because closure can still erase them |
| 324 | // unless they go on the prototype. |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 325 | CanvasKit.SkPath.prototype.addArc = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 326 | CanvasKit.SkPath.prototype.addPath = function() {}; |
Kevin Lubick | 1a05fce | 2018-11-20 12:51:16 -0500 | [diff] [blame] | 327 | CanvasKit.SkPath.prototype.addRect = function() {}; |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 328 | CanvasKit.SkPath.prototype.arc = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 329 | CanvasKit.SkPath.prototype.arcTo = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 330 | CanvasKit.SkPath.prototype.close = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 331 | CanvasKit.SkPath.prototype.conicTo = function() {}; |
| 332 | CanvasKit.SkPath.prototype.cubicTo = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 333 | CanvasKit.SkPath.prototype.dash = function() {}; |
Kevin Lubick | 006a6f3 | 2018-10-19 14:34:34 -0400 | [diff] [blame] | 334 | CanvasKit.SkPath.prototype.lineTo = function() {}; |
| 335 | CanvasKit.SkPath.prototype.moveTo = function() {}; |
| 336 | CanvasKit.SkPath.prototype.op = function() {}; |
| 337 | CanvasKit.SkPath.prototype.quadTo = function() {}; |
| 338 | CanvasKit.SkPath.prototype.rect = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 339 | CanvasKit.SkPath.prototype.simplify = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 340 | CanvasKit.SkPath.prototype.stroke = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 341 | CanvasKit.SkPath.prototype.transform = function() {}; |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 342 | CanvasKit.SkPath.prototype.trim = function() {}; |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 343 | |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 344 | CanvasKit.SkSurface.prototype.flush = function() {}; |
Kevin Lubick | 5b90b84 | 2018-10-17 07:57:18 -0400 | [diff] [blame] | 345 | CanvasKit.SkSurface.prototype.dispose = function() {}; |
Kevin Lubick | 53965c9 | 2018-10-11 08:51:55 -0400 | [diff] [blame] | 346 | |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 347 | /** @return {CanvasKit.SkVertices} */ |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 348 | CanvasKit.SkVertices.prototype.applyBones = function() {}; |
| 349 | |
Alexander Khovansky | 3e11933 | 2018-11-15 02:01:19 +0300 | [diff] [blame] | 350 | CanvasKit.SkImage.prototype.encodeToData = function() {}; |
| 351 | |
Kevin Lubick | b5ae3b5 | 2018-11-03 07:51:19 -0400 | [diff] [blame] | 352 | // Define StrokeOpts object |
| 353 | var StrokeOpts = {}; |
| 354 | StrokeOpts.prototype.width; |
| 355 | StrokeOpts.prototype.miter_limit; |
| 356 | StrokeOpts.prototype.cap; |
| 357 | StrokeOpts.prototype.join; |
| 358 | |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 359 | var HTMLCanvas = {}; |
| 360 | HTMLCanvas.prototype.getContext = function() {}; |
| 361 | HTMLCanvas.prototype.toDataURL = function() {}; |
| 362 | HTMLCanvas.prototype.dispose = function() {}; |
| 363 | |
| 364 | var CanvasRenderingContext2D = {}; |
| 365 | CanvasRenderingContext2D.prototype.addHitRegion = function() {}; |
| 366 | CanvasRenderingContext2D.prototype.arc = function() {}; |
| 367 | CanvasRenderingContext2D.prototype.arcTo = function() {}; |
| 368 | CanvasRenderingContext2D.prototype.beginPath = function() {}; |
| 369 | CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; |
| 370 | CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 371 | CanvasRenderingContext2D.prototype.clearRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 372 | CanvasRenderingContext2D.prototype.closePath = function() {}; |
| 373 | CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; |
| 374 | CanvasRenderingContext2D.prototype.ellipse = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 375 | CanvasRenderingContext2D.prototype.fill = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 376 | CanvasRenderingContext2D.prototype.fillRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 377 | CanvasRenderingContext2D.prototype.fillText = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 378 | CanvasRenderingContext2D.prototype.getLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 379 | CanvasRenderingContext2D.prototype.lineTo = function() {}; |
| 380 | CanvasRenderingContext2D.prototype.measureText = function() {}; |
| 381 | CanvasRenderingContext2D.prototype.moveTo = function() {}; |
| 382 | CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; |
| 383 | CanvasRenderingContext2D.prototype.rect = function() {}; |
| 384 | CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; |
| 385 | CanvasRenderingContext2D.prototype.resetTransform = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 386 | CanvasRenderingContext2D.prototype.restore = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 387 | CanvasRenderingContext2D.prototype.rotate = function() {}; |
Kevin Lubick | 61ef7b2 | 2018-11-27 13:26:59 -0500 | [diff] [blame] | 388 | CanvasRenderingContext2D.prototype.save = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 389 | CanvasRenderingContext2D.prototype.scale = function() {}; |
| 390 | CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 391 | CanvasRenderingContext2D.prototype.setLineDash = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 392 | CanvasRenderingContext2D.prototype.setTransform = function() {}; |
| 393 | CanvasRenderingContext2D.prototype.stroke = function() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 394 | CanvasRenderingContext2D.prototype.strokeRect = function() {}; |
Kevin Lubick | b9db390 | 2018-11-26 11:47:54 -0500 | [diff] [blame] | 395 | CanvasRenderingContext2D.prototype.strokeText = function() {}; |
| 396 | CanvasRenderingContext2D.prototype.transform = function() {}; |
| 397 | CanvasRenderingContext2D.prototype.translate = function() {}; |
| 398 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 399 | // 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] | 400 | function loadWebAssemblyModule() {}; |
Kevin Lubick | 12c0e50 | 2018-11-28 12:51:56 -0500 | [diff] [blame^] | 401 | |
| 402 | var DOMMatrix = {}; |