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 25var CanvasKit = { 26 // public API (i.e. things we declare in the pre-js file or in the cpp bindings) 27 Color: function() {}, 28 /** @return {CanvasKit.SkRect} */ 29 LTRBRect: function() {}, 30 /** @return {CanvasKit.SkRect} */ 31 XYWHRect: function() {}, 32 /** @return {CanvasKit.SkRRect} */ 33 RRectXY: function() {}, 34 /** @return {ImageData} */ 35 ImageData: function() {}, 36 37 GetWebGLContext: function() {}, 38 MakeBlurMaskFilter: function() {}, 39 MakeCanvas: function() {}, 40 MakeCanvasSurface: function() {}, 41 MakeGrContext: function() {}, 42 /** @return {CanvasKit.SkAnimatedImage} */ 43 MakeAnimatedImageFromEncoded: function() {}, 44 /** @return {CanvasKit.SkImage} */ 45 MakeImage: function() {}, 46 /** @return {CanvasKit.SkImage} */ 47 MakeImageFromEncoded: function() {}, 48 /** @return {LinearCanvasGradient} */ 49 MakeLinearGradientShader: function() {}, 50 MakeOnScreenGLSurface: function() {}, 51 MakePathFromCmds: function() {}, 52 MakePathFromOp: function() {}, 53 MakePathFromSVGString: function() {}, 54 MakeRadialGradientShader: function() {}, 55 MakeRenderTarget: function() {}, 56 MakeSkPicture: function() {}, 57 MakeSWCanvasSurface: function() {}, 58 MakeManagedAnimation: function() {}, 59 MakeParticles: function() {}, 60 MakeSkDashPathEffect: function() {}, 61 MakeSkVertices: function() {}, 62 MakeSurface: function() {}, 63 /** @return {RadialCanvasGradient} */ 64 MakeTwoPointConicalGradientShader: function() {}, 65 MakeWebGLCanvasSurface: function() {}, 66 /** @return {TypedArray} */ 67 Malloc: function() {}, 68 /** @return {TonalColors} */ 69 computeTonalColors: function() {}, 70 currentContext: function() {}, 71 getColorComponents: function() {}, 72 getDecodeCacheLimitBytes: function() {}, 73 getDecodeCacheUsageBytes: function() {}, 74 getSkDataBytes: function() {}, 75 multiplyByAlpha: function() {}, 76 parseColorString: function() {}, 77 setCurrentContext: function() {}, 78 setDecodeCacheLimitBytes: function() {}, 79 80 // private API (i.e. things declared in the bindings that we use 81 // in the pre-js file) 82 _MakeImage: function() {}, 83 _MakeLinearGradientShader: function() {}, 84 _MakePathFromCmds: function() {}, 85 _MakeRadialGradientShader: function() {}, 86 _MakeManagedAnimation: function() {}, 87 _MakeParticles: function() {}, 88 _MakeSkDashPathEffect: function() {}, 89 _MakeSkPicture: function() {}, 90 _MakeSkVertices: function() {}, 91 _MakeTwoPointConicalGradientShader: function() {}, 92 _decodeAnimatedImage: function() {}, 93 _decodeImage: function() {}, 94 _drawShapedText: function() {}, 95 _getRasterDirectSurface: function() {}, 96 _getRasterN32PremulSurface: function() {}, 97 98 // The testing object is meant to expose internal functions 99 // for more fine-grained testing, e.g. parseColor 100 _testing: {}, 101 102 // Objects and properties on CanvasKit 103 104 GrContext: { 105 // public API (from C++ bindings) 106 getResourceCacheLimitBytes: function() {}, 107 getResourceCacheUsageBytes: function() {}, 108 setResourceCacheLimitBytes: function() {}, 109 }, 110 111 Paragraph: { 112 // public API (from C++ bindings) 113 didExceedMaxLines: function() {}, 114 getAlphabeticBaseline: function() {}, 115 getGlyphPositionAtCoordinate: function() {}, 116 getHeight: function() {}, 117 getIdeographicBaseline: function() {}, 118 getLongestLine: function() {}, 119 getMaxIntrinsicWidth: function() {}, 120 getMaxWidth: function() {}, 121 getMinIntrinsicWidth: function() {}, 122 getWordBoundary: function() {}, 123 layout: function() {}, 124 125 // private API 126 /** @return {Float32Array} */ 127 _getRectsForRange: function() {}, 128 }, 129 130 SkRuntimeEffect: { 131 // public API (from C++ bindings) 132 Make: function() {}, 133 134 // private API 135 _makeShader: function() {}, 136 }, 137 138 ParagraphStyle: function() {}, 139 RSXFormBuilder: function() {}, 140 SkColorBuilder: function() {}, 141 SkRectBuilder: function() {}, 142 143 ShapedText: { 144 // public API (from C++ bindings) 145 getBounds: function() {}, 146 }, 147 148 SkAnimatedImage: { 149 // public API (from C++ bindings) 150 decodeNextFrame: function() {}, 151 getFrameCount: function() {}, 152 getRepetitionCount: function() {}, 153 height: function() {}, 154 reset: function() {}, 155 width: function() {}, 156 }, 157 158 SkCanvas: { 159 // public API (from C++ bindings) 160 clear: function() {}, 161 clipPath: function() {}, 162 clipRRect: function() {}, 163 clipRect: function() {}, 164 concat: function() {}, 165 drawAnimatedImage: function() {}, 166 drawArc: function() {}, 167 drawCircle: function() {}, 168 drawColor: function() {}, 169 drawDRRect: function() {}, 170 drawImage: function() {}, 171 drawImageNine: function() {}, 172 drawImageRect: function() {}, 173 drawLine: function() {}, 174 drawOval: function() {}, 175 drawPaint: function() {}, 176 drawParagraph: function() {}, 177 drawPath: function() {}, 178 drawPicture: function() {}, 179 drawRRect: function() {}, 180 drawRect: function() {}, 181 drawRoundRect: function() {}, 182 drawShadow: function() {}, 183 drawText: function() {}, 184 drawTextBlob: function() {}, 185 drawVertices: function() {}, 186 flush: function() {}, 187 getSaveCount: function() {}, 188 getTotalMatrix: function() {}, 189 makeSurface: function() {}, 190 restore: function() {}, 191 restoreToCount: function() {}, 192 rotate: function() {}, 193 save: function() {}, 194 saveLayer: function() {}, 195 scale: function() {}, 196 skew: function() {}, 197 translate: function() {}, 198 199 // private API 200 _drawAtlas: function() {}, 201 _drawPoints: function() {}, 202 _drawSimpleText: function() {}, 203 _readPixels: function() {}, 204 _writePixels: function() {}, 205 delete: function() {}, 206 }, 207 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 228 SkContourMeasureIter: { 229 next: function() {}, 230 }, 231 232 SkContourMeasure: { 233 getPosTan: function() {}, 234 getSegment: function() {}, 235 isClosed: function() {}, 236 length: function() {}, 237 }, 238 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() {}, 250 // private API (from C++ bindings) 251 _getWidths: function() {}, 252 }, 253 254 SkFontMgr: { 255 // public API (from C++ and JS bindings) 256 FromData: function() {}, 257 RefDefault: function() {}, 258 countFamilies: function() {}, 259 getFamilyName: function() {}, 260 261 // private API 262 _makeTypefaceFromData: function() {}, 263 _fromData: function() {}, 264 }, 265 266 SkImage: { 267 // public API (from C++ bindings) 268 height: function() {}, 269 width: function() {}, 270 // private API 271 _encodeToData: function() {}, 272 _encodeToDataWithFormat: function() {}, 273 _makeShader: function() {}, 274 }, 275 276 SkImageFilter: { 277 MakeBlur: function() {}, 278 MakeColorFilter: function() {}, 279 MakeCompose: function() {}, 280 MakeMatrixTransform: function() {}, 281 }, 282 283 SkMatrix: { 284 identity: function() {}, 285 invert: function() {}, 286 mapPoints: function() {}, 287 multiply: function() {}, 288 rotated: function() {}, 289 scaled: function() {}, 290 skewed: function() {}, 291 translated: function() {}, 292 }, 293 294 SkMaskFilter: { 295 MakeBlur: function() {}, 296 }, 297 298 SkPaint: { 299 // public API (from C++ bindings) 300 /** @return {CanvasKit.SkPaint} */ 301 copy: function() {}, 302 getBlendMode: function() {}, 303 getColor: function() {}, 304 getFilterQuality: function() {}, 305 getStrokeCap: function() {}, 306 getStrokeJoin: function() {}, 307 getStrokeMiter: function() {}, 308 getStrokeWidth: function() {}, 309 setAntiAlias: function() {}, 310 setBlendMode: function() {}, 311 setColor: function() {}, 312 setFilterQuality: function() {}, 313 setImageFilter: function() {}, 314 setMaskFilter: function() {}, 315 setPathEffect: function() {}, 316 setShader: function() {}, 317 setStrokeCap: function() {}, 318 setStrokeJoin: function() {}, 319 setStrokeMiter: function() {}, 320 setStrokeWidth: function() {}, 321 setStyle: function() {}, 322 323 // private API 324 delete: function() {}, 325 }, 326 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 348 SkPath: { 349 // public API (from C++ bindings) 350 computeTightBounds: function() {}, 351 contains: function() {}, 352 /** @return {CanvasKit.SkPath} */ 353 copy: function() {}, 354 countPoints: function() {}, 355 equals: function() {}, 356 getBounds: function() {}, 357 getFillType: function() {}, 358 getPoint: function() {}, 359 isEmpty: function() {}, 360 isVolatile: function() {}, 361 reset: function() {}, 362 rewind: function() {}, 363 setFillType: function() {}, 364 setIsVolatile: function() {}, 365 toSVGString: function() {}, 366 367 // private API 368 _addArc: function() {}, 369 _addOval: function() {}, 370 _addPath: function() {}, 371 _addRect: function() {}, 372 _addPoly: function() {}, 373 _addRoundRect: function() {}, 374 _arc: function() {}, 375 _arcTo: function() {}, 376 _close: function() {}, 377 _conicTo: function() {}, 378 _cubicTo: function() {}, 379 _dash: function() {}, 380 _lineTo: function() {}, 381 _moveTo: function() {}, 382 _op: function() {}, 383 _quadTo: function() {}, 384 _rArcTo: function() {}, 385 _rConicTo: function() {}, 386 _rCubicTo: function() {}, 387 _rLineTo: function() {}, 388 _rMoveTo: function() {}, 389 _rQuadTo: function() {}, 390 _rect: function() {}, 391 _simplify: function() {}, 392 _stroke: function() {}, 393 _transform: function() {}, 394 _trim: function() {}, 395 delete: function() {}, 396 dump: function() {}, 397 dumpHex: function() {}, 398 }, 399 400 SkPathMeasure: { 401 getLength: function() {}, 402 getSegment: function() {}, 403 getPosTan: function() {}, 404 isClosed: function() {}, 405 nextContour: function() {}, 406 }, 407 408 SkPicture: { 409 serialize: function() {}, 410 }, 411 412 SkPictureRecorder: { 413 beginRecording: function() {}, 414 finishRecordingAsPicture: function() {}, 415 }, 416 417 SkRect: { 418 fLeft: {}, 419 fTop: {}, 420 fRight: {}, 421 fBottom: {}, 422 }, 423 424 SkRRect: { 425 rect: {}, 426 rx1: {}, 427 ry1: {}, 428 rx2: {}, 429 ry2: {}, 430 rx3: {}, 431 ry3: {}, 432 rx4: {}, 433 ry4: {}, 434 }, 435 436 SkShader: { 437 Blend: function() {}, 438 Color: function() {}, 439 Empty: function() {}, 440 Lerp: function() {}, 441 442 _Blend: function() {}, 443 _Lerp: function() {}, 444 }, 445 446 SkSurface: { 447 // public API (from C++ bindings) 448 /** @return {CanvasKit.SkCanvas} */ 449 getCanvas: function() {}, 450 /** @return {CanvasKit.SkImage} */ 451 makeImageSnapshot: function() {}, 452 makeSurface: function() {}, 453 grContext: {}, 454 455 // private API 456 _flush: function() {}, 457 _getRasterN32PremulSurface: function() {}, 458 delete: function() {}, 459 }, 460 461 SkTextBlob: { 462 // public API (both C++ and JS bindings) 463 MakeFromRSXform: function() {}, 464 MakeFromText: function() {}, 465 MakeOnPath: function() {}, 466 // private API (from C++ bindings) 467 _MakeFromRSXform: function() {}, 468 _MakeFromText: function() {}, 469 }, 470 471 SkVertices: { 472 // public API (from C++ bindings) 473 bounds: function() {}, 474 mode: function() {}, 475 uniqueID: function() {}, 476 vertexCount: function() {}, 477 478 // private API 479 /** @return {CanvasKit.SkVertices} */ 480 _applyBones: function() {}, 481 }, 482 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 494 TextStyle: function() {}, 495 496 // Constants and Enums 497 gpu: {}, 498 skottie: {}, 499 500 TRANSPARENT: {}, 501 RED: {}, 502 BLUE: {}, 503 YELLOW: {}, 504 CYAN: {}, 505 BLACK: {}, 506 WHITE: {}, 507 508 MOVE_VERB: {}, 509 LINE_VERB: {}, 510 QUAD_VERB: {}, 511 CONIC_VERB: {}, 512 CUBIC_VERB: {}, 513 CLOSE_VERB: {}, 514 515 NoDecoration: {}, 516 UnderlineDecoration: {}, 517 OverlineDecoration: {}, 518 LineThroughDecoration: {}, 519 520 SaveLayerInitWithPrevious: {}, 521 SaveLayerF16ColorType: {}, 522 523 Affinity: { 524 Upstream: {}, 525 Downstream: {}, 526 }, 527 528 AlphaType: { 529 Opaque: {}, 530 Premul: {}, 531 Unpremul: {}, 532 }, 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 573 ClipOp: { 574 Difference: {}, 575 Intersect: {}, 576 }, 577 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 592 FillType: { 593 Winding: {}, 594 EvenOdd: {}, 595 InverseWinding: {}, 596 InverseEvenOdd: {}, 597 }, 598 599 FilterQuality: { 600 None: {}, 601 Low: {}, 602 Medium: {}, 603 High: {}, 604 }, 605 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 638 ImageFormat: { 639 PNG: {}, 640 JPEG: {}, 641 }, 642 643 PaintStyle: { 644 Fill: {}, 645 Stroke: {}, 646 StrokeAndFill: {}, 647 }, 648 649 PathOp: { 650 Difference: {}, 651 Intersect: {}, 652 Union: {}, 653 XOR: {}, 654 ReverseDifference: {}, 655 }, 656 657 PointMode: { 658 Points: {}, 659 Lines: {}, 660 Polygon: {}, 661 }, 662 663 RectHeightStyle: { 664 Tight: {}, 665 Max: {}, 666 IncludeLineSpacingMiddle: {}, 667 IncludeLineSpacingTop: {}, 668 IncludeLineSpacingBottom: {}, 669 }, 670 671 RectWidthStyle: { 672 Tight: {}, 673 Max: {}, 674 }, 675 676 StrokeCap: { 677 Butt: {}, 678 Round: {}, 679 Square: {}, 680 }, 681 682 StrokeJoin: { 683 Miter: {}, 684 Round: {}, 685 Bevel: {}, 686 }, 687 688 TextAlign: { 689 Left: {}, 690 Right: {}, 691 Center: {}, 692 Justify: {}, 693 Start: {}, 694 End: {}, 695 }, 696 697 TextDirection: { 698 LTR: {}, 699 RTL: {}, 700 }, 701 702 TextEncoding: { 703 UTF8: {}, 704 UTF16: {}, 705 UTF32: {}, 706 GlyphID: {}, 707 }, 708 709 TileMode: { 710 Clamp: {}, 711 Repeat: {}, 712 Mirror: {}, 713 Decal: {}, 714 }, 715 716 VertexMode: { 717 Triangles: {}, 718 TrianglesStrip: {}, 719 TriangleFan: {}, 720 }, 721 722 // Things Enscriptem adds for us 723 724 /** 725 * @type {Float32Array} 726 */ 727 HEAPF32: {}, 728 /** 729 * @type {Float64Array} 730 */ 731 HEAPF64: {}, 732 /** 733 * @type {Uint8Array} 734 */ 735 HEAPU8: {}, 736 /** 737 * @type {Uint16Array} 738 */ 739 HEAPU16: {}, 740 /** 741 * @type {Uint32Array} 742 */ 743 HEAPU32: {}, 744 /** 745 * @type {Int8Array} 746 */ 747 HEAP8: {}, 748 /** 749 * @type {Int16Array} 750 */ 751 HEAP16: {}, 752 /** 753 * @type {Int32Array} 754 */ 755 HEAP32: {}, 756 757 _malloc: function() {}, 758 _free: function() {}, 759 onRuntimeInitialized: function() {}, 760}; 761 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. 765CanvasKit.Paragraph.prototype.getRectsForRange = function() {}; 766 767CanvasKit.SkPath.prototype.addArc = function() {}; 768CanvasKit.SkPath.prototype.addOval = function() {}; 769CanvasKit.SkPath.prototype.addPath = function() {}; 770CanvasKit.SkPath.prototype.addPoly = function() {}; 771CanvasKit.SkPath.prototype.addRect = function() {}; 772CanvasKit.SkPath.prototype.addRoundRect = function() {}; 773CanvasKit.SkPath.prototype.arc = function() {}; 774CanvasKit.SkPath.prototype.arcTo = function() {}; 775CanvasKit.SkPath.prototype.close = function() {}; 776CanvasKit.SkPath.prototype.conicTo = function() {}; 777CanvasKit.SkPath.prototype.cubicTo = function() {}; 778CanvasKit.SkPath.prototype.dash = function() {}; 779CanvasKit.SkPath.prototype.lineTo = function() {}; 780CanvasKit.SkPath.prototype.moveTo = function() {}; 781CanvasKit.SkPath.prototype.offset = function() {}; 782CanvasKit.SkPath.prototype.op = function() {}; 783CanvasKit.SkPath.prototype.quadTo = function() {}; 784CanvasKit.SkPath.prototype.rArcTo = function() {}; 785CanvasKit.SkPath.prototype.rConicTo = function() {}; 786CanvasKit.SkPath.prototype.rCubicTo = function() {}; 787CanvasKit.SkPath.prototype.rLineTo = function() {}; 788CanvasKit.SkPath.prototype.rMoveTo = function() {}; 789CanvasKit.SkPath.prototype.rQuadTo = function() {}; 790CanvasKit.SkPath.prototype.rect = function() {}; 791CanvasKit.SkPath.prototype.simplify = function() {}; 792CanvasKit.SkPath.prototype.stroke = function() {}; 793CanvasKit.SkPath.prototype.transform = function() {}; 794CanvasKit.SkPath.prototype.trim = function() {}; 795 796CanvasKit.SkPicture.prototype.saveAsFile = function() {}; 797 798CanvasKit.SkSurface.prototype.dispose = function() {}; 799CanvasKit.SkSurface.prototype.flush = function() {}; 800CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {}; 801CanvasKit.SkSurface.prototype.drawOnce = function() {}; 802CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {}; 803 804/** @return {CanvasKit.SkVertices} */ 805CanvasKit.SkVertices.prototype.applyBones = function() {}; 806 807CanvasKit.SkImage.prototype.encodeToData = function() {}; 808CanvasKit.SkImage.prototype.makeShader = function() {}; 809 810CanvasKit.SkCanvas.prototype.drawAtlas = function() {}; 811CanvasKit.SkCanvas.prototype.drawPoints = function() {}; 812CanvasKit.SkCanvas.prototype.drawText = function() {}; 813/** @return {Uint8Array} */ 814CanvasKit.SkCanvas.prototype.readPixels = function() {}; 815CanvasKit.SkCanvas.prototype.writePixels = function() {}; 816 817CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {}; 818 819CanvasKit.SkFont.prototype.getWidths = function() {}; 820 821CanvasKit.RSXFormBuilder.prototype.build = function() {}; 822CanvasKit.RSXFormBuilder.prototype.delete = function() {}; 823CanvasKit.RSXFormBuilder.prototype.push = function() {}; 824CanvasKit.RSXFormBuilder.prototype.set = function() {}; 825 826CanvasKit.SkColorBuilder.prototype.build = function() {}; 827CanvasKit.SkColorBuilder.prototype.delete = function() {}; 828CanvasKit.SkColorBuilder.prototype.push = function() {}; 829CanvasKit.SkColorBuilder.prototype.set = function() {}; 830 831CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {}; 832 833CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {}; 834CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {}; 835 836// Define StrokeOpts object 837var StrokeOpts = {}; 838StrokeOpts.prototype.width; 839StrokeOpts.prototype.miter_limit; 840StrokeOpts.prototype.cap; 841StrokeOpts.prototype.join; 842StrokeOpts.prototype.precision; 843 844// Define everything created in the canvas2d spec here 845var HTMLCanvas = {}; 846HTMLCanvas.prototype.decodeImage = function() {}; 847HTMLCanvas.prototype.dispose = function() {}; 848HTMLCanvas.prototype.getContext = function() {}; 849HTMLCanvas.prototype.loadFont = function() {}; 850HTMLCanvas.prototype.makePath2D = function() {}; 851HTMLCanvas.prototype.toDataURL = function() {}; 852 853var CanvasRenderingContext2D = {}; 854CanvasRenderingContext2D.prototype.addHitRegion = function() {}; 855CanvasRenderingContext2D.prototype.arc = function() {}; 856CanvasRenderingContext2D.prototype.arcTo = function() {}; 857CanvasRenderingContext2D.prototype.beginPath = function() {}; 858CanvasRenderingContext2D.prototype.bezierCurveTo = function() {}; 859CanvasRenderingContext2D.prototype.clearHitRegions = function() {}; 860CanvasRenderingContext2D.prototype.clearRect = function() {}; 861CanvasRenderingContext2D.prototype.clip = function() {}; 862CanvasRenderingContext2D.prototype.closePath = function() {}; 863CanvasRenderingContext2D.prototype.createImageData = function() {}; 864CanvasRenderingContext2D.prototype.createLinearGradient = function() {}; 865CanvasRenderingContext2D.prototype.createPattern = function() {}; 866CanvasRenderingContext2D.prototype.createRadialGradient = function() {}; 867CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {}; 868CanvasRenderingContext2D.prototype.drawImage = function() {}; 869CanvasRenderingContext2D.prototype.ellipse = function() {}; 870CanvasRenderingContext2D.prototype.fill = function() {}; 871CanvasRenderingContext2D.prototype.fillRect = function() {}; 872CanvasRenderingContext2D.prototype.fillText = function() {}; 873CanvasRenderingContext2D.prototype.getImageData = function() {}; 874CanvasRenderingContext2D.prototype.getLineDash = function() {}; 875CanvasRenderingContext2D.prototype.isPointInPath = function() {}; 876CanvasRenderingContext2D.prototype.isPointInStroke = function() {}; 877CanvasRenderingContext2D.prototype.lineTo = function() {}; 878CanvasRenderingContext2D.prototype.measureText = function() {}; 879CanvasRenderingContext2D.prototype.moveTo = function() {}; 880CanvasRenderingContext2D.prototype.putImageData = function() {}; 881CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {}; 882CanvasRenderingContext2D.prototype.rect = function() {}; 883CanvasRenderingContext2D.prototype.removeHitRegion = function() {}; 884CanvasRenderingContext2D.prototype.resetTransform = function() {}; 885CanvasRenderingContext2D.prototype.restore = function() {}; 886CanvasRenderingContext2D.prototype.rotate = function() {}; 887CanvasRenderingContext2D.prototype.save = function() {}; 888CanvasRenderingContext2D.prototype.scale = function() {}; 889CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {}; 890CanvasRenderingContext2D.prototype.setLineDash = function() {}; 891CanvasRenderingContext2D.prototype.setTransform = function() {}; 892CanvasRenderingContext2D.prototype.stroke = function() {}; 893CanvasRenderingContext2D.prototype.strokeRect = function() {}; 894CanvasRenderingContext2D.prototype.strokeText = function() {}; 895CanvasRenderingContext2D.prototype.transform = function() {}; 896CanvasRenderingContext2D.prototype.translate = function() {}; 897 898var Path2D = {}; 899Path2D.prototype.addPath = function() {}; 900Path2D.prototype.arc = function() {}; 901Path2D.prototype.arcTo = function() {}; 902Path2D.prototype.bezierCurveTo = function() {}; 903Path2D.prototype.closePath = function() {}; 904Path2D.prototype.ellipse = function() {}; 905Path2D.prototype.lineTo = function() {}; 906Path2D.prototype.moveTo = function() {}; 907Path2D.prototype.quadraticCurveTo = function() {}; 908Path2D.prototype.rect = function() {}; 909 910var LinearCanvasGradient = {}; 911LinearCanvasGradient.prototype.addColorStop = function() {}; 912var RadialCanvasGradient = {}; 913RadialCanvasGradient.prototype.addColorStop = function() {}; 914var CanvasPattern = {}; 915CanvasPattern.prototype.setTransform = function() {}; 916 917var ImageData = { 918 /** 919 * @type {Uint8ClampedArray} 920 */ 921 data: {}, 922 height: {}, 923 width: {}, 924}; 925 926var DOMMatrix = { 927 a: {}, 928 b: {}, 929 c: {}, 930 d: {}, 931 e: {}, 932 f: {}, 933}; 934 935// Not sure why this is needed - might be a bug in emsdk that this isn't properly declared. 936function loadWebAssemblyModule() {}; 937