canvaskit-wasm
Advanced tools
Comparing version 0.38.2 to 0.39.0
@@ -9,2 +9,37 @@ # CanvasKit Changelog | ||
## [0.39.0] - 2023-10-11 | ||
### Added | ||
- `ImageFilter.getOutputBounds` returns the adjusted bounds of a rect after | ||
applying the `ImageFilter`. | ||
- `Picture.cullRect` which gives approximate bounds of the draw commands in the | ||
picture. | ||
- `Picture.approximateBytesUsed` which returns an approximation of the bytes | ||
used to store this picture. This size does not include large objects like | ||
images. | ||
- `FontMgr.matchFamilyStyle` finds the closest matching typeface to the specified familyName and style. | ||
- `Paint.setBlender` Sets the current blender. | ||
- `Blender.Mode` Create a blender that implements the specified BlendMode. | ||
- `RuntimeEffect.MakeForBlender` Compiles a RuntimeEffect from the given blender code. | ||
- `ManagedAnimation` getters and setters for lottie slots exported by Essential Graphics in AE. | ||
Color, scalar, vec2, text, and image slot types are supported. | ||
- `ManagedAnimation` WYSIWYG editor API: `attachEditor`, `enableEditor`, `dispatchEditorKey`, | ||
`dispatchEditorPointer`. | ||
- `InputState` and `ModifierKey` enums. | ||
- `Paragraph.getClosestGlyphInfoAtCoordinate` and `Paragraph.getGlyphInfoAt` return the information associated with the glyph or grapheme cluster in the paragraph at the specified location/index. | ||
- `Paragraph.getLineMetricsAt`, returns the line metrics of a line. | ||
- `Paragraph.getNumberOfLines`, returns the number of visible lines in the paragraph. | ||
- `Paragraph.getLineNumberAt`, finds the line that contains the given UTF-16 index. | ||
### Fixed | ||
- `EmbindObject` has been updated to allow TypeScript to differentiate between opaque | ||
types such as Shader, ColorFilter, et cetera. | ||
### Changed | ||
- `MakeSWCanvasSurface` now allows passing an `OffscreenCanvas` element. | ||
- `Picture.beginRecording` takes an optional `computeBounds` boolean argument | ||
which, when true, will cause the resulting recorded picture to compute a | ||
more accurate `cullRect` when it is created. | ||
## [0.38.2] - 2023-06-09 | ||
@@ -11,0 +46,0 @@ |
{ | ||
"name": "canvaskit-wasm", | ||
"version": "0.38.2", | ||
"version": "0.39.0", | ||
"description": "A WASM version of Skia's Canvas API", | ||
@@ -20,6 +20,6 @@ "main": "bin/canvaskit.js", | ||
"devDependencies": { | ||
"@definitelytyped/header-parser": "0.0.121", | ||
"@webgpu/types": "0.1.21", | ||
"dtslint": "4.2.1", | ||
"typescript": "4.7.4", | ||
"@definitelytyped/header-parser": "0.0.121", | ||
"@webgpu/types": "0.1.21" | ||
"typescript": "4.7.4" | ||
}, | ||
@@ -26,0 +26,0 @@ "exports": { |
@@ -443,2 +443,4 @@ // This file is type-checked by the Typescript definitions. It is not actually executed. | ||
paint.setPathEffect(pathEffect); | ||
// @ts-expect-error | ||
paint.setShader(colorFilter); | ||
paint.setShader(shader); | ||
@@ -562,2 +564,7 @@ paint.setStrokeCap(CK.StrokeCap.Round); | ||
const o = p.unresolvedCodepoints(); // $ExpectType number[] | ||
const q = p.getLineMetricsAt(0); // $ExpectType LineMetrics | null | ||
const r = p.getNumberOfLines(); // $ExpectType number | ||
const s = p.getLineNumberAt(0); // $ExpectType number | ||
const t = p.getGlyphInfoAt(0); //$ExpectType GlyphInfo | null | ||
const u = p.getClosestGlyphInfoAtCoordinate(10, 3); //$ExpectType GlyphInfo | null | ||
} | ||
@@ -703,2 +710,4 @@ | ||
const bytes = pic.serialize(); // $ExpectType Uint8Array | null | ||
const cullRect = pic.cullRect(); // $ExpectType Float32Array | ||
const approxBytesUsed = pic.approximateBytesUsed(); // $ExpectType number | ||
const pic2 = CK.MakePicture(bytes!); | ||
@@ -757,2 +766,6 @@ const shader1 = pic2!.makeShader(CK.TileMode.Clamp, CK.TileMode.Decal, CK.FilterMode.Nearest); | ||
}); | ||
const textProp = new CK.SlottableTextProperty({ // $ExpectType SlottableTextProperty | ||
fillColor: CK.Color(48, 37, 199), | ||
strokeColor: CK.Color(0, 100, 100) | ||
}); | ||
mAnim.setColor('slider', CK.WHITE); | ||
@@ -769,2 +782,15 @@ mAnim.setOpacity('slider', 0.8); | ||
const l = mAnim.setTransform('foo', [1, 2], [3, 4], [5, 6], 90, 1, 0); // $ExpectType boolean | ||
const m = mAnim.setColorSlot('foo', CK.BLUE); // $ExpectType boolean | ||
const n = mAnim.setScalarSlot('foo', 5); // $ExpectType boolean | ||
const o = mAnim.setVec2Slot('foo', [1, 2]); // $ExpectType boolean | ||
const p = mAnim.setImageSlot('foo', 'bar'); // $ExpectType boolean | ||
const q = mAnim.setTextSlot('foo', textProp); // $ExpectType boolean | ||
const r = mAnim.getColorSlot('foo'); // $ExpectType Float32Array | null | ||
const s = mAnim.getScalarSlot('foo'); // $ExpectType number | null | ||
const t = mAnim.getVec2Slot('foo'); // $ExpectType Float32Array | null | ||
const u = mAnim.getTextSlot('foo'); // $ExpectType SlottableTextProperty | null | ||
const v = mAnim.getSlotInfo(); // $ExpectType SlotInfo | ||
} | ||
@@ -942,4 +968,4 @@ | ||
var sample = gl.getParameter(gl.SAMPLES); | ||
var stencil = gl.getParameter(gl.STENCIL_BITS); | ||
const sample = gl.getParameter(gl.SAMPLES); | ||
const stencil = gl.getParameter(gl.STENCIL_BITS); | ||
const surfaceTen = CK.MakeOnScreenGLSurface(grCtx!, 100, 400, // $ExpectType Surface | ||
@@ -946,0 +972,0 @@ CK.ColorSpace.ADOBE_RGB, sample, stencil)!; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
24231963
8166
3
4
11