2018-09-20 21:39:31 +00:00
|
|
|
/*
|
|
|
|
* This externs file prevents the Closure JS compiler from minifying away
|
|
|
|
* names of objects created by Emscripten.
|
|
|
|
* Basically, by defining empty objects and functions here, Closure will
|
|
|
|
* know not to rename them. This is needed because of our pre-js files,
|
|
|
|
* that is, the JS we hand-write to bundle into the output. That JS will be
|
|
|
|
* hit by the closure compiler and thus needs to know about what functions
|
|
|
|
* have special names and should not be minified.
|
|
|
|
*
|
|
|
|
* Emscripten does not support automatically generating an externs file, so we
|
|
|
|
* do it by hand. The general process is to write some JS code, and then put any
|
|
|
|
* calls to CanvasKit or related things in here. Running ./compile.sh and then
|
|
|
|
* looking at the minified results or running the Release trybot should
|
|
|
|
* verify nothing was missed. Optionally, looking directly at the minified
|
|
|
|
* pathkit.js can be useful when developing locally.
|
|
|
|
*
|
|
|
|
* Docs:
|
|
|
|
* https://github.com/cljsjs/packages/wiki/Creating-Externs
|
|
|
|
* https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
|
|
|
|
*
|
|
|
|
* Example externs:
|
|
|
|
* https://github.com/google/closure-compiler/tree/master/externs
|
|
|
|
*/
|
|
|
|
|
|
|
|
var CanvasKit = {
|
|
|
|
// public API (i.e. things we declare in the pre-js file)
|
2018-10-19 18:34:34 +00:00
|
|
|
Color: function() {},
|
|
|
|
/** @return {CanvasKit.SkRect} */
|
|
|
|
LTRBRect: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
/** @return {CanvasKit.SkRect} */
|
|
|
|
XYWHRect: function() {},
|
2018-12-04 18:57:36 +00:00
|
|
|
/** @return {ImageData} */
|
|
|
|
ImageData: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
MakeBlurMaskFilter: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
MakeCanvas: function() {},
|
|
|
|
MakeCanvasSurface: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
MakeImageShader: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
/** @return {CanvasKit.SkImage} */
|
|
|
|
MakeImageFromEncoded: function() {},
|
2018-11-29 20:07:02 +00:00
|
|
|
/** @return {LinearCanvasGradient} */
|
2018-11-03 11:51:19 +00:00
|
|
|
MakeLinearGradientShader: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
MakeRadialGradientShader: function() {},
|
|
|
|
MakeSWCanvasSurface: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
MakeSkDashPathEffect: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
MakeSkVertices: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
MakeSurface: function() {},
|
2018-11-29 20:07:02 +00:00
|
|
|
/** @return {RadialCanvasGradient} */
|
|
|
|
MakeTwoPointConicalGradientShader: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
MakeWebGLCanvasSurface: function() {},
|
2018-09-20 21:39:31 +00:00
|
|
|
currentContext: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
getColorComponents: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
getSkDataBytes: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
initFonts: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
multiplyByAlpha: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
setCurrentContext: function() {},
|
2018-09-20 21:39:31 +00:00
|
|
|
|
|
|
|
// private API (i.e. things declared in the bindings that we use
|
|
|
|
// in the pre-js file)
|
2018-12-04 18:57:36 +00:00
|
|
|
_MakeImage: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
_MakeImageShader: function() {},
|
|
|
|
_MakeLinearGradientShader: function() {},
|
|
|
|
_MakeRadialGradientShader: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_MakeSkDashPathEffect: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
_MakeSkVertices: function() {},
|
2018-11-29 20:07:02 +00:00
|
|
|
_MakeTwoPointConicalGradientShader: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
_decodeImage: function() {},
|
2018-11-30 19:05:58 +00:00
|
|
|
_getRasterDirectSurface: function() {},
|
2018-10-30 19:05:04 +00:00
|
|
|
_getRasterN32PremulSurface: function() {},
|
|
|
|
_getWebGLSurface: function() {},
|
2018-09-20 21:39:31 +00:00
|
|
|
|
2018-11-20 17:51:16 +00:00
|
|
|
// The testing object is meant to expose internal functions
|
|
|
|
// for more fine-grained testing, e.g. parseColor
|
|
|
|
_testing: {},
|
|
|
|
|
2018-09-20 21:39:31 +00:00
|
|
|
// Objects and properties on CanvasKit
|
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
SkCanvas: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
clear: function() {},
|
2018-11-29 20:07:02 +00:00
|
|
|
clipPath: function() {},
|
2018-12-07 15:09:11 +00:00
|
|
|
clipRect: function() {},
|
|
|
|
concat: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
drawImage: function() {},
|
|
|
|
drawImageRect: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
drawPaint: function() {},
|
|
|
|
drawPath: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
drawRect: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
drawShadow: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
drawText: function() {},
|
|
|
|
drawVertices: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
flush: function() {},
|
2018-12-07 15:09:11 +00:00
|
|
|
getTotalMatrix: function() {},
|
2018-11-29 20:07:02 +00:00
|
|
|
restore: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
rotate: function() {},
|
|
|
|
save: function() {},
|
|
|
|
scale: function() {},
|
|
|
|
skew: function() {},
|
|
|
|
translate: function() {},
|
2018-10-11 12:51:55 +00:00
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
// private API
|
2018-12-04 18:57:36 +00:00
|
|
|
_readPixels: function() {},
|
|
|
|
_writePixels: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
delete: function() {},
|
|
|
|
},
|
|
|
|
|
|
|
|
SkImage: {
|
2018-12-03 17:31:04 +00:00
|
|
|
// public API (from C++ bindings)
|
|
|
|
height: function() {},
|
|
|
|
width: function() {},
|
2018-11-14 23:01:19 +00:00
|
|
|
// private API
|
|
|
|
_encodeToData: function() {},
|
|
|
|
_encodeToDataWithFormat: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
},
|
2018-09-20 21:39:31 +00:00
|
|
|
|
2018-11-20 17:51:16 +00:00
|
|
|
SkMatrix: {
|
2018-11-26 16:47:54 +00:00
|
|
|
identity: function() {},
|
|
|
|
mapPoints: function() {},
|
|
|
|
multiply: function() {},
|
2018-11-20 17:51:16 +00:00
|
|
|
rotated: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
scaled: function() {},
|
|
|
|
skewed: function() {},
|
|
|
|
translated: function() {},
|
|
|
|
},
|
|
|
|
|
|
|
|
SkPaint: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
/** @return {CanvasKit.SkPaint} */
|
|
|
|
copy: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
getBlendMode: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
getColor: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
getFilterQuality: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
getStrokeCap: function() {},
|
|
|
|
getStrokeJoin: function() {},
|
|
|
|
getStrokeMiter: function() {},
|
|
|
|
getStrokeWidth: function() {},
|
|
|
|
getTextSize: function() {},
|
|
|
|
measureText: function() {},
|
|
|
|
setAntiAlias: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
setBlendMode: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
setColor: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
setFilterQuality: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
setMaskFilter: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
setPathEffect: function() {},
|
|
|
|
setShader: function() {},
|
|
|
|
setStrokeCap: function() {},
|
|
|
|
setStrokeJoin: function() {},
|
|
|
|
setStrokeMiter: function() {},
|
|
|
|
setStrokeWidth: function() {},
|
|
|
|
setStyle: function() {},
|
|
|
|
setTextSize: function() {},
|
|
|
|
|
|
|
|
//private API
|
|
|
|
delete: function() {},
|
2018-11-20 17:51:16 +00:00
|
|
|
},
|
|
|
|
|
2018-09-20 21:39:31 +00:00
|
|
|
SkPath: {
|
2018-10-19 18:34:34 +00:00
|
|
|
// public API (from C++ bindings)
|
2018-11-26 16:47:54 +00:00
|
|
|
computeTightBounds: function() {},
|
2018-12-07 18:03:08 +00:00
|
|
|
contains: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
/** @return {CanvasKit.SkPath} */
|
|
|
|
copy: function() {},
|
|
|
|
countPoints: function() {},
|
|
|
|
equals: function() {},
|
|
|
|
getBounds: function() {},
|
|
|
|
getFillType: function() {},
|
|
|
|
getPoint: function() {},
|
2018-12-07 18:03:08 +00:00
|
|
|
isEmpty: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
setFillType: function() {},
|
|
|
|
toSVGString: function() {},
|
2018-09-20 21:39:31 +00:00
|
|
|
|
|
|
|
// private API
|
2018-11-20 17:51:16 +00:00
|
|
|
_addArc: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_addPath: function() {},
|
2018-11-20 17:51:16 +00:00
|
|
|
_addRect: function() {},
|
2018-11-14 23:01:19 +00:00
|
|
|
_arc: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_arcTo: function() {},
|
2018-09-20 21:39:31 +00:00
|
|
|
_close: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_conicTo: function() {},
|
|
|
|
_cubicTo: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
_dash: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_lineTo: function() {},
|
|
|
|
_moveTo: function() {},
|
|
|
|
_op: function() {},
|
|
|
|
_quadTo: function() {},
|
|
|
|
_rect: function() {},
|
2018-09-20 21:39:31 +00:00
|
|
|
_simplify: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
_stroke: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_transform: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
_trim: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
delete: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
dump: function() {},
|
|
|
|
dumpHex: function() {},
|
2018-10-11 12:51:55 +00:00
|
|
|
},
|
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
SkRect: {
|
|
|
|
fLeft: {},
|
|
|
|
fTop: {},
|
|
|
|
fRight: {},
|
|
|
|
fBottom: {},
|
|
|
|
},
|
|
|
|
|
2018-10-11 12:51:55 +00:00
|
|
|
SkSurface: {
|
2018-10-19 18:34:34 +00:00
|
|
|
// public API (from C++ bindings)
|
|
|
|
/** @return {CanvasKit.SkCanvas} */
|
|
|
|
getCanvas: function() {},
|
|
|
|
/** @return {CanvasKit.SkImage} */
|
|
|
|
makeImageSnapshot: function() {},
|
|
|
|
|
2018-10-11 12:51:55 +00:00
|
|
|
// private API
|
2018-10-16 14:15:01 +00:00
|
|
|
_flush: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
_getRasterN32PremulSurface: function() {},
|
2018-10-17 11:57:18 +00:00
|
|
|
delete: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
},
|
|
|
|
|
2018-11-03 11:51:19 +00:00
|
|
|
SkVertices: {
|
|
|
|
// public API (from C++ bindings)
|
2018-11-28 17:51:56 +00:00
|
|
|
bounds: function() {},
|
|
|
|
mode: function() {},
|
|
|
|
uniqueID: function() {},
|
|
|
|
vertexCount: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
|
|
|
|
// private API
|
|
|
|
/** @return {CanvasKit.SkVertices} */
|
|
|
|
_applyBones: function() {},
|
|
|
|
},
|
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
// Constants and Enums
|
|
|
|
gpu: {},
|
|
|
|
skottie: {},
|
|
|
|
|
2018-11-27 18:26:59 +00:00
|
|
|
TRANSPARENT: {},
|
|
|
|
RED: {},
|
|
|
|
BLUE: {},
|
|
|
|
YELLOW: {},
|
|
|
|
CYAN: {},
|
|
|
|
BLACK: {},
|
2018-11-30 19:05:58 +00:00
|
|
|
WHITE: {},
|
|
|
|
|
|
|
|
AlphaType: {
|
|
|
|
Opaque: {},
|
|
|
|
Premul: {},
|
|
|
|
Unpremul: {},
|
|
|
|
},
|
2018-11-27 18:26:59 +00:00
|
|
|
|
|
|
|
BlendMode: {
|
|
|
|
Clear: {},
|
|
|
|
Src: {},
|
|
|
|
Dst: {},
|
|
|
|
SrcOver: {},
|
|
|
|
DstOver: {},
|
|
|
|
SrcIn: {},
|
|
|
|
DstIn: {},
|
|
|
|
SrcOut: {},
|
|
|
|
DstOut: {},
|
|
|
|
SrcATop: {},
|
|
|
|
DstATop: {},
|
|
|
|
Xor: {},
|
|
|
|
Plus: {},
|
|
|
|
Modulate: {},
|
|
|
|
Screen: {},
|
|
|
|
Overlay: {},
|
|
|
|
Darken: {},
|
|
|
|
Lighten: {},
|
|
|
|
ColorDodge: {},
|
|
|
|
ColorBurn: {},
|
|
|
|
HardLight: {},
|
|
|
|
SoftLight: {},
|
|
|
|
Difference: {},
|
|
|
|
Exclusion: {},
|
|
|
|
Multiply: {},
|
|
|
|
Hue: {},
|
|
|
|
Saturation: {},
|
|
|
|
Color: {},
|
|
|
|
Luminosity: {},
|
|
|
|
},
|
|
|
|
|
|
|
|
BlurStyle: {
|
|
|
|
Normal: {},
|
|
|
|
Solid: {},
|
|
|
|
Outer: {},
|
|
|
|
Inner: {},
|
|
|
|
},
|
|
|
|
|
2018-11-29 20:07:02 +00:00
|
|
|
ClipOp: {
|
|
|
|
Difference: {},
|
|
|
|
Intersect: {},
|
|
|
|
},
|
|
|
|
|
2018-11-30 19:05:58 +00:00
|
|
|
ColorType: {
|
|
|
|
Alpha_8: {},
|
|
|
|
RGB_565: {},
|
|
|
|
ARGB_4444: {},
|
|
|
|
RGBA_8888: {},
|
|
|
|
RGB_888x: {},
|
|
|
|
BGRA_8888: {},
|
|
|
|
RGBA_1010102: {},
|
|
|
|
RGB_101010x: {},
|
|
|
|
Gray_8: {},
|
|
|
|
RGBA_F16: {},
|
|
|
|
RGBA_F32: {},
|
|
|
|
},
|
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
FillType: {
|
2018-11-20 17:51:16 +00:00
|
|
|
Winding: {},
|
|
|
|
EvenOdd: {},
|
|
|
|
InverseWinding: {},
|
|
|
|
InverseEvenOdd: {},
|
2018-10-19 18:34:34 +00:00
|
|
|
},
|
|
|
|
|
2018-12-03 17:31:04 +00:00
|
|
|
FilterQuality: {
|
|
|
|
None: {},
|
|
|
|
Low: {},
|
|
|
|
Medium: {},
|
|
|
|
High: {},
|
|
|
|
},
|
|
|
|
|
2018-11-14 23:01:19 +00:00
|
|
|
ImageFormat: {
|
|
|
|
PNG: {},
|
|
|
|
JPEG: {},
|
|
|
|
},
|
|
|
|
|
2018-11-26 16:47:54 +00:00
|
|
|
PaintStyle: {
|
|
|
|
Fill: {},
|
|
|
|
Stroke: {},
|
|
|
|
StrokeAndFill: {},
|
|
|
|
},
|
|
|
|
|
2018-11-29 20:07:02 +00:00
|
|
|
PathOp: {
|
|
|
|
Difference: {},
|
|
|
|
Intersect: {},
|
|
|
|
Union: {},
|
|
|
|
XOR: {},
|
|
|
|
ReverseDifference: {},
|
|
|
|
},
|
|
|
|
|
2018-11-26 16:47:54 +00:00
|
|
|
StrokeCap: {
|
|
|
|
Butt: {},
|
|
|
|
Round: {},
|
|
|
|
Square: {},
|
|
|
|
},
|
|
|
|
|
|
|
|
StrokeJoin: {
|
|
|
|
Miter: {},
|
|
|
|
Round: {},
|
|
|
|
Bevel: {},
|
|
|
|
},
|
|
|
|
|
2018-11-29 20:07:02 +00:00
|
|
|
TileMode: {
|
|
|
|
Clamp: {},
|
|
|
|
Repeat: {},
|
|
|
|
Mirror: {},
|
2018-12-07 13:29:52 +00:00
|
|
|
Decal: {},
|
2018-11-29 20:07:02 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
VertexMode: {
|
|
|
|
Triangles: {},
|
|
|
|
TrianglesStrip: {},
|
|
|
|
TriangleFan: {},
|
|
|
|
},
|
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
// Things Enscriptem adds for us
|
|
|
|
|
|
|
|
/** Represents the heap of the WASM code
|
|
|
|
* @type {ArrayBuffer}
|
|
|
|
*/
|
|
|
|
buffer: {},
|
|
|
|
/**
|
|
|
|
* @type {Float32Array}
|
|
|
|
*/
|
2018-11-03 11:51:19 +00:00
|
|
|
HEAPF32: {},
|
2018-10-19 18:34:34 +00:00
|
|
|
/**
|
|
|
|
* @type {Uint8Array}
|
|
|
|
*/
|
|
|
|
HEAPU8: {},
|
2018-11-03 11:51:19 +00:00
|
|
|
/**
|
|
|
|
* @type {Uint16Array}
|
|
|
|
*/
|
|
|
|
HEAPU16: {},
|
|
|
|
/**
|
|
|
|
* @type {Int32Array}
|
|
|
|
*/
|
|
|
|
HEAP32: {},
|
2018-10-19 18:34:34 +00:00
|
|
|
|
|
|
|
_malloc: function() {},
|
|
|
|
_free: function() {},
|
|
|
|
onRuntimeInitialized: function() {},
|
|
|
|
};
|
2018-09-20 21:39:31 +00:00
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
// Public API things that are newly declared in the JS should go here.
|
|
|
|
// It's not enough to declare them above, because closure can still erase them
|
|
|
|
// unless they go on the prototype.
|
2018-11-20 17:51:16 +00:00
|
|
|
CanvasKit.SkPath.prototype.addArc = function() {};
|
2018-09-20 21:39:31 +00:00
|
|
|
CanvasKit.SkPath.prototype.addPath = function() {};
|
2018-11-20 17:51:16 +00:00
|
|
|
CanvasKit.SkPath.prototype.addRect = function() {};
|
2018-11-14 23:01:19 +00:00
|
|
|
CanvasKit.SkPath.prototype.arc = function() {};
|
2018-10-19 18:34:34 +00:00
|
|
|
CanvasKit.SkPath.prototype.arcTo = function() {};
|
2018-09-20 21:39:31 +00:00
|
|
|
CanvasKit.SkPath.prototype.close = function() {};
|
2018-10-19 18:34:34 +00:00
|
|
|
CanvasKit.SkPath.prototype.conicTo = function() {};
|
|
|
|
CanvasKit.SkPath.prototype.cubicTo = function() {};
|
2018-11-03 11:51:19 +00:00
|
|
|
CanvasKit.SkPath.prototype.dash = function() {};
|
2018-10-19 18:34:34 +00:00
|
|
|
CanvasKit.SkPath.prototype.lineTo = function() {};
|
|
|
|
CanvasKit.SkPath.prototype.moveTo = function() {};
|
|
|
|
CanvasKit.SkPath.prototype.op = function() {};
|
|
|
|
CanvasKit.SkPath.prototype.quadTo = function() {};
|
|
|
|
CanvasKit.SkPath.prototype.rect = function() {};
|
2018-09-20 21:39:31 +00:00
|
|
|
CanvasKit.SkPath.prototype.simplify = function() {};
|
2018-11-03 11:51:19 +00:00
|
|
|
CanvasKit.SkPath.prototype.stroke = function() {};
|
2018-09-20 21:39:31 +00:00
|
|
|
CanvasKit.SkPath.prototype.transform = function() {};
|
2018-11-03 11:51:19 +00:00
|
|
|
CanvasKit.SkPath.prototype.trim = function() {};
|
2018-09-20 21:39:31 +00:00
|
|
|
|
2018-10-11 12:51:55 +00:00
|
|
|
CanvasKit.SkSurface.prototype.flush = function() {};
|
2018-10-17 11:57:18 +00:00
|
|
|
CanvasKit.SkSurface.prototype.dispose = function() {};
|
2018-10-11 12:51:55 +00:00
|
|
|
|
2018-11-28 17:51:56 +00:00
|
|
|
/** @return {CanvasKit.SkVertices} */
|
2018-11-03 11:51:19 +00:00
|
|
|
CanvasKit.SkVertices.prototype.applyBones = function() {};
|
|
|
|
|
2018-11-14 23:01:19 +00:00
|
|
|
CanvasKit.SkImage.prototype.encodeToData = function() {};
|
|
|
|
|
2018-12-04 18:57:36 +00:00
|
|
|
/** @return {Uint8Array} */
|
|
|
|
CanvasKit.SkCanvas.prototype.readPixels = function() {};
|
|
|
|
CanvasKit.SkCanvas.prototype.writePixels = function() {};
|
|
|
|
|
2018-11-03 11:51:19 +00:00
|
|
|
// Define StrokeOpts object
|
|
|
|
var StrokeOpts = {};
|
|
|
|
StrokeOpts.prototype.width;
|
|
|
|
StrokeOpts.prototype.miter_limit;
|
|
|
|
StrokeOpts.prototype.cap;
|
|
|
|
StrokeOpts.prototype.join;
|
2018-12-07 18:03:08 +00:00
|
|
|
StrokeOpts.prototype.precision;
|
2018-11-03 11:51:19 +00:00
|
|
|
|
2018-11-29 20:07:02 +00:00
|
|
|
// Define everything created in the canvas2d spec here
|
2018-11-26 16:47:54 +00:00
|
|
|
var HTMLCanvas = {};
|
2018-12-03 17:31:04 +00:00
|
|
|
HTMLCanvas.prototype.decodeImage = function() {};
|
|
|
|
HTMLCanvas.prototype.dispose = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
HTMLCanvas.prototype.getContext = function() {};
|
|
|
|
HTMLCanvas.prototype.toDataURL = function() {};
|
|
|
|
|
|
|
|
var CanvasRenderingContext2D = {};
|
|
|
|
CanvasRenderingContext2D.prototype.addHitRegion = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.arc = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.arcTo = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.beginPath = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
|
2018-11-28 17:51:56 +00:00
|
|
|
CanvasRenderingContext2D.prototype.clearRect = function() {};
|
2018-11-29 20:07:02 +00:00
|
|
|
CanvasRenderingContext2D.prototype.clip = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.closePath = function() {};
|
2018-12-04 18:57:36 +00:00
|
|
|
CanvasRenderingContext2D.prototype.createImageData = function() {};
|
2018-11-29 20:07:02 +00:00
|
|
|
CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
|
2018-12-07 13:29:52 +00:00
|
|
|
CanvasRenderingContext2D.prototype.createPattern = function() {};
|
2018-11-29 20:07:02 +00:00
|
|
|
CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
|
2018-12-03 17:31:04 +00:00
|
|
|
CanvasRenderingContext2D.prototype.drawImage = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.ellipse = function() {};
|
2018-11-27 18:26:59 +00:00
|
|
|
CanvasRenderingContext2D.prototype.fill = function() {};
|
2018-11-28 17:51:56 +00:00
|
|
|
CanvasRenderingContext2D.prototype.fillRect = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.fillText = function() {};
|
2018-12-04 18:57:36 +00:00
|
|
|
CanvasRenderingContext2D.prototype.getImageData = function() {};
|
2018-11-28 17:51:56 +00:00
|
|
|
CanvasRenderingContext2D.prototype.getLineDash = function() {};
|
2018-12-07 18:03:08 +00:00
|
|
|
CanvasRenderingContext2D.prototype.isPointInPath = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.lineTo = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.measureText = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.moveTo = function() {};
|
2018-12-04 18:57:36 +00:00
|
|
|
CanvasRenderingContext2D.prototype.putImageData = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.rect = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.resetTransform = function() {};
|
2018-11-27 18:26:59 +00:00
|
|
|
CanvasRenderingContext2D.prototype.restore = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.rotate = function() {};
|
2018-11-27 18:26:59 +00:00
|
|
|
CanvasRenderingContext2D.prototype.save = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.scale = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
|
2018-11-28 17:51:56 +00:00
|
|
|
CanvasRenderingContext2D.prototype.setLineDash = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.setTransform = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.stroke = function() {};
|
2018-11-28 17:51:56 +00:00
|
|
|
CanvasRenderingContext2D.prototype.strokeRect = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
CanvasRenderingContext2D.prototype.strokeText = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.transform = function() {};
|
|
|
|
CanvasRenderingContext2D.prototype.translate = function() {};
|
|
|
|
|
2018-11-29 20:07:02 +00:00
|
|
|
var LinearCanvasGradient = {};
|
|
|
|
LinearCanvasGradient.prototype.addColorStop = function() {};
|
|
|
|
var RadialCanvasGradient = {};
|
|
|
|
RadialCanvasGradient.prototype.addColorStop = function() {};
|
2018-12-07 13:29:52 +00:00
|
|
|
var CanvasPattern = {};
|
|
|
|
CanvasPattern.prototype.setTransform = function() {};
|
2018-11-29 20:07:02 +00:00
|
|
|
|
2018-12-04 18:57:36 +00:00
|
|
|
var ImageData = {
|
|
|
|
/**
|
|
|
|
* @type {Uint8ClampedArray}
|
|
|
|
*/
|
|
|
|
data: {},
|
|
|
|
height: {},
|
|
|
|
width: {},
|
|
|
|
};
|
|
|
|
|
2018-12-07 13:29:52 +00:00
|
|
|
var DOMMatrix = {
|
|
|
|
a: {},
|
|
|
|
b: {},
|
|
|
|
c: {},
|
|
|
|
d: {},
|
|
|
|
e: {},
|
|
|
|
f: {},
|
|
|
|
};
|
|
|
|
|
2018-09-20 21:39:31 +00:00
|
|
|
// Not sure why this is needed - might be a bug in emsdk that this isn't properly declared.
|
2018-11-20 20:55:10 +00:00
|
|
|
function loadWebAssemblyModule() {};
|
2018-11-28 17:51:56 +00:00
|
|
|
|
|
|
|
var DOMMatrix = {};
|