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() {},
|
2019-03-08 15:04:28 +00:00
|
|
|
|
|
|
|
GetWebGLContext: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
MakeBlurMaskFilter: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
MakeCanvas: function() {},
|
|
|
|
MakeCanvasSurface: function() {},
|
2019-03-08 15:04:28 +00:00
|
|
|
MakeGrContext: 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() {},
|
2019-03-08 15:04:28 +00:00
|
|
|
MakeOnScreenGLSurface: function() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
MakePathFromCmds: function() {},
|
2018-12-17 21:01:36 +00:00
|
|
|
MakePathFromOp: function() {},
|
|
|
|
MakePathFromSVGString: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
MakeRadialGradientShader: function() {},
|
2019-03-08 15:04:28 +00:00
|
|
|
MakeRenderTarget: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
MakeSWCanvasSurface: function() {},
|
2019-02-28 15:06:18 +00:00
|
|
|
MakeManagedAnimation: 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() {},
|
|
|
|
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
|
|
|
_MakeLinearGradientShader: function() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
_MakePathFromCmds: function() {},
|
2018-11-03 11:51:19 +00:00
|
|
|
_MakeRadialGradientShader: function() {},
|
2019-02-28 15:06:18 +00:00
|
|
|
_MakeManagedAnimation: 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() {},
|
2019-02-22 15:04:06 +00:00
|
|
|
_drawShapedText: function() {},
|
2018-11-30 19:05:58 +00:00
|
|
|
_getRasterDirectSurface: function() {},
|
2018-10-30 19:05:04 +00:00
|
|
|
_getRasterN32PremulSurface: 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
|
|
|
|
|
2019-03-22 19:41:36 +00:00
|
|
|
GrContext: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
getResourceCacheLimitBytes: function() {},
|
|
|
|
getResourceCacheUsageBytes: function() {},
|
|
|
|
setResourceCacheLimitBytes: function() {},
|
|
|
|
},
|
|
|
|
|
2019-03-15 19:36:29 +00:00
|
|
|
RSXFormBuilder: function() {},
|
2019-03-29 14:39:52 +00:00
|
|
|
SkColorBuilder: function() {},
|
|
|
|
SkRectBuilder: function() {},
|
2019-03-15 19:36:29 +00:00
|
|
|
|
2019-02-22 15:04:06 +00:00
|
|
|
ShapedText: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
getBounds: function() {},
|
|
|
|
},
|
|
|
|
|
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() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
drawArc: function() {},
|
2018-12-03 17:31:04 +00:00
|
|
|
drawImage: function() {},
|
|
|
|
drawImageRect: function() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
drawLine: function() {},
|
|
|
|
drawOval: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
drawPaint: function() {},
|
|
|
|
drawPath: function() {},
|
2019-04-05 17:00:01 +00:00
|
|
|
drawPicture: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
drawRect: function() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
drawRoundRect: function() {},
|
2018-11-27 18:26:59 +00:00
|
|
|
drawShadow: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
drawText: function() {},
|
2019-01-14 13:36:08 +00:00
|
|
|
drawTextBlob: function() {},
|
2018-11-28 17:51:56 +00:00
|
|
|
drawVertices: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
flush: function() {},
|
2018-12-07 15:09:11 +00:00
|
|
|
getTotalMatrix: function() {},
|
2019-03-08 15:04:28 +00:00
|
|
|
makeSurface: function() {},
|
2018-11-29 20:07:02 +00:00
|
|
|
restore: function() {},
|
2019-03-06 13:25:36 +00:00
|
|
|
restoreToCount: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
rotate: function() {},
|
|
|
|
save: function() {},
|
2019-03-06 13:25:36 +00:00
|
|
|
saveLayer: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
scale: function() {},
|
|
|
|
skew: function() {},
|
|
|
|
translate: function() {},
|
2018-10-11 12:51:55 +00:00
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
// private API
|
2019-03-29 14:39:52 +00:00
|
|
|
_drawAtlas: function() {},
|
2019-01-14 13:36:08 +00:00
|
|
|
_drawSimpleText: function() {},
|
2018-12-04 18:57:36 +00:00
|
|
|
_readPixels: function() {},
|
|
|
|
_writePixels: function() {},
|
2018-10-19 18:34:34 +00:00
|
|
|
delete: function() {},
|
|
|
|
},
|
|
|
|
|
2019-01-02 20:13:57 +00:00
|
|
|
SkFont: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
getScaleX: function() {},
|
|
|
|
getSize: function() {},
|
|
|
|
getSkewX: function() {},
|
|
|
|
getTypeface: function() {},
|
|
|
|
measureText: function() {},
|
|
|
|
setScaleX: function() {},
|
|
|
|
setSize: function() {},
|
|
|
|
setSkewX: function() {},
|
|
|
|
setTypeface: function() {},
|
2019-03-15 19:36:29 +00:00
|
|
|
// private API (from C++ bindings)
|
|
|
|
_getWidths: function() {},
|
2019-01-02 20:13:57 +00:00
|
|
|
},
|
|
|
|
|
2018-12-12 15:35:13 +00:00
|
|
|
SkFontMgr: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
RefDefault: function() {},
|
|
|
|
countFamilies: function() {},
|
|
|
|
|
|
|
|
// private API
|
|
|
|
_makeTypefaceFromData: function() {},
|
|
|
|
},
|
|
|
|
|
2018-10-19 18:34:34 +00:00
|
|
|
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() {},
|
2019-04-04 13:28:53 +00:00
|
|
|
_makeShader: 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() {},
|
2019-03-14 14:55:10 +00:00
|
|
|
invert: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
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() {},
|
|
|
|
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() {},
|
|
|
|
|
|
|
|
//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-12-14 21:10:38 +00:00
|
|
|
isVolatile: function() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
reset: function() {},
|
|
|
|
rewind: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
setFillType: function() {},
|
2018-12-14 21:10:38 +00:00
|
|
|
setIsVolatile: function() {},
|
2018-11-26 16:47:54 +00:00
|
|
|
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() {},
|
2019-01-07 16:08:55 +00:00
|
|
|
_addRoundRect: 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
|
|
|
},
|
|
|
|
|
2019-03-15 19:36:29 +00:00
|
|
|
SkPathMeasure: {
|
|
|
|
getLength: function() {},
|
|
|
|
getPosTan: function() {},
|
|
|
|
isClosed: function() {},
|
|
|
|
nextContour: function() {},
|
|
|
|
},
|
|
|
|
|
2019-04-05 17:00:01 +00:00
|
|
|
SkPicture: {
|
|
|
|
DEBUGONLY_serialize: function() {},
|
|
|
|
},
|
|
|
|
|
|
|
|
SkPictureRecorder: {
|
|
|
|
beginRecording: function() {},
|
|
|
|
finishRecordingAsPicture: function() {},
|
|
|
|
},
|
|
|
|
|
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() {},
|
2019-03-08 15:04:28 +00:00
|
|
|
makeSurface: function() {},
|
2019-03-22 19:41:36 +00:00
|
|
|
grContext: {},
|
2018-10-19 18:34:34 +00:00
|
|
|
|
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
|
|
|
},
|
|
|
|
|
2019-01-14 13:36:08 +00:00
|
|
|
SkTextBlob: {
|
2019-03-15 19:36:29 +00:00
|
|
|
// public API (both C++ and JS bindings)
|
|
|
|
MakeFromRSXform: function() {},
|
2019-01-14 13:36:08 +00:00
|
|
|
MakeFromText: function() {},
|
2019-03-15 19:36:29 +00:00
|
|
|
MakeOnPath: function() {},
|
|
|
|
// private API (from C++ bindings)
|
|
|
|
_MakeFromRSXform: function() {},
|
2019-01-14 13:36:08 +00:00
|
|
|
_MakeFromText: function() {},
|
|
|
|
},
|
|
|
|
|
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() {},
|
|
|
|
},
|
|
|
|
|
2019-06-03 18:38:05 +00:00
|
|
|
_SkVerticesBuilder: {
|
|
|
|
// public API (from C++ bindings)
|
|
|
|
boneIndices: function() {},
|
|
|
|
boneWeights: function() {},
|
|
|
|
colors: function() {},
|
|
|
|
detach: function() {},
|
|
|
|
indices: function() {},
|
|
|
|
positions: function() {},
|
|
|
|
texCoords: 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: {},
|
|
|
|
|
2019-01-07 16:08:55 +00:00
|
|
|
MOVE_VERB: {},
|
|
|
|
LINE_VERB: {},
|
|
|
|
QUAD_VERB: {},
|
|
|
|
CONIC_VERB: {},
|
|
|
|
CUBIC_VERB: {},
|
|
|
|
CLOSE_VERB: {},
|
|
|
|
|
2018-11-30 19:05:58 +00:00
|
|
|
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: {},
|
|
|
|
},
|
|
|
|
|
2019-01-14 13:36:08 +00:00
|
|
|
TextEncoding: {
|
|
|
|
UTF8: {},
|
|
|
|
UTF16: {},
|
|
|
|
UTF32: {},
|
|
|
|
GlyphID: {},
|
|
|
|
},
|
|
|
|
|
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: {},
|
2019-02-28 15:06:18 +00:00
|
|
|
/**
|
|
|
|
* @type {Uint32Array}
|
|
|
|
*/
|
|
|
|
HEAPU32: {},
|
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() {};
|
2019-01-07 16:08:55 +00:00
|
|
|
CanvasKit.SkPath.prototype.addRoundRect = 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
|
|
|
|
2019-04-05 17:00:01 +00:00
|
|
|
CanvasKit.SkPicture.prototype.DEBUGONLY_saveAsFile = function() {};
|
|
|
|
|
2018-10-17 11:57:18 +00:00
|
|
|
CanvasKit.SkSurface.prototype.dispose = function() {};
|
2019-03-19 13:34:37 +00:00
|
|
|
CanvasKit.SkSurface.prototype.flush = function() {};
|
|
|
|
CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
|
2019-04-05 17:00:01 +00:00
|
|
|
CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = 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() {};
|
2019-04-04 13:28:53 +00:00
|
|
|
CanvasKit.SkImage.prototype.makeShader = function() {};
|
2018-11-14 23:01:19 +00:00
|
|
|
|
2019-03-29 14:39:52 +00:00
|
|
|
CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
|
2019-01-14 13:36:08 +00:00
|
|
|
CanvasKit.SkCanvas.prototype.drawText = function() {};
|
2018-12-04 18:57:36 +00:00
|
|
|
/** @return {Uint8Array} */
|
|
|
|
CanvasKit.SkCanvas.prototype.readPixels = function() {};
|
|
|
|
CanvasKit.SkCanvas.prototype.writePixels = function() {};
|
|
|
|
|
2018-12-12 15:35:13 +00:00
|
|
|
CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
|
|
|
|
|
2019-03-15 19:36:29 +00:00
|
|
|
CanvasKit.SkFont.prototype.getWidths = function() {};
|
|
|
|
|
|
|
|
CanvasKit.RSXFormBuilder.prototype.build = function() {};
|
|
|
|
CanvasKit.RSXFormBuilder.prototype.delete = function() {};
|
|
|
|
CanvasKit.RSXFormBuilder.prototype.push = function() {};
|
2019-03-29 14:39:52 +00:00
|
|
|
CanvasKit.RSXFormBuilder.prototype.set = function() {};
|
|
|
|
|
|
|
|
CanvasKit.SkColorBuilder.prototype.build = function() {};
|
|
|
|
CanvasKit.SkColorBuilder.prototype.delete = function() {};
|
|
|
|
CanvasKit.SkColorBuilder.prototype.push = function() {};
|
|
|
|
CanvasKit.SkColorBuilder.prototype.set = function() {};
|
2019-03-15 19:36:29 +00:00
|
|
|
|
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() {};
|
2018-12-14 20:03:41 +00:00
|
|
|
HTMLCanvas.prototype.loadFont = function() {};
|
2018-12-17 21:01:36 +00:00
|
|
|
HTMLCanvas.prototype.makePath2D = function() {};
|
2018-11-26 16:47:54 +00:00
|
|
|
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-12-17 21:01:36 +00:00
|
|
|
var Path2D = {};
|
|
|
|
Path2D.prototype.addPath = function() {};
|
|
|
|
Path2D.prototype.arc = function() {};
|
|
|
|
Path2D.prototype.arcTo = function() {};
|
|
|
|
Path2D.prototype.bezierCurveTo = function() {};
|
|
|
|
Path2D.prototype.closePath = function() {};
|
|
|
|
Path2D.prototype.ellipse = function() {};
|
|
|
|
Path2D.prototype.lineTo = function() {};
|
|
|
|
Path2D.prototype.moveTo = function() {};
|
|
|
|
Path2D.prototype.quadraticCurveTo = function() {};
|
|
|
|
Path2D.prototype.rect = 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() {};
|