canvaskit-wasm
Advanced tools
Comparing version 0.35.0 to 0.36.0
@@ -9,2 +9,22 @@ # CanvasKit Changelog | ||
## [0.36.0] - 2022-08-16 | ||
### Added | ||
- The following path methods: `addCircle`, `CanInterpolate`, and `MakeFromPathInterpolation`. | ||
- The following ImageFilter factory methods: `MakeBlend`, `MakeDilate`, `MakeDisplacementMap`, | ||
`MakeDropShadow`, `MakeDropShadowOnly`, `MakeErode`, `MakeImage`, `MakeOffset`, and `MakeShader`. | ||
- The `MakeLuma` ColorFilter factory method. | ||
- The `fontVariations` TextStyle property. | ||
- `ColorFilter.MakeBlend` supports float colors under the hood and takes an optional colorspace. | ||
### Changed | ||
- Updated `dtslint`, `typescript`, and `@webgpu/types` versions, used for testing index.d.ts types. | ||
### Fixed | ||
- `Image.readPixels` should work on `Image`s created with `MakeLazyImageFromTextureSource` | ||
(https://github.com/flutter/flutter/issues/103803) | ||
### Known Issues | ||
- `ImageFilter.MakeDisplacementMap` is not behaving as expected in certain circumstances. | ||
## [0.35.0] - 2022-06-30 | ||
@@ -11,0 +31,0 @@ |
{ | ||
"name": "canvaskit-wasm", | ||
"version": "0.35.0", | ||
"version": "0.36.0", | ||
"description": "A WASM version of Skia's Canvas API", | ||
@@ -20,8 +20,7 @@ "main": "bin/canvaskit.js", | ||
"devDependencies": { | ||
"dtslint": "^4.0.4", | ||
"typescript": "^4.0.3" | ||
}, | ||
"dependencies": { | ||
"@webgpu/types": "^0.1.20" | ||
"dtslint": "4.2.1", | ||
"typescript": "4.7.4", | ||
"@definitelytyped/header-parser": "0.0.121", | ||
"@webgpu/types": "0.1.21" | ||
} | ||
} |
@@ -230,2 +230,3 @@ // This file is type-checked by the Typescript definitions. It is not actually executed. | ||
const filterFive = cf.MakeLerp(0.7, filterThree, filterFour); // $ExpectType ColorFilter | ||
const filterSeven = cf.MakeBlend(CK.MAGENTA, CK.BlendMode.SrcOut, CK.ColorSpace.DISPLAY_P3); // $ExpectType ColorFilter | ||
@@ -240,2 +241,3 @@ const r = CK.ColorMatrix.rotated(0, .707, -.707); // $ExpectType Float32Array | ||
const filterSix = CK.ColorFilter.MakeMatrix(cm); // $ExpectType ColorFilter | ||
const luma = CK.ColorFilter.MakeLuma(); // $ExpectType ColorFilter | ||
} | ||
@@ -290,3 +292,4 @@ | ||
CK.Matrix.identity()); | ||
const pixels = img.readPixels(85, 1000, { // $ExpectType Float32Array | Uint8Array | null | ||
// See https://github.com/microsoft/dtslint/issues/191#issuecomment-1108307671 for below | ||
const pixels = img.readPixels(85, 1000, { // $ExpectType Float32Array | Uint8Array | null || Uint8Array | Float32Array | null | ||
width: 79, | ||
@@ -312,4 +315,4 @@ height: 205, | ||
function imageFilterTests(CK: CanvasKit, colorFilter?: ColorFilter) { | ||
if (!colorFilter) return; | ||
function imageFilterTests(CK: CanvasKit, colorFilter?: ColorFilter, img?: Image, shader?: Shader) { | ||
if (!colorFilter || !img || !shader) return; | ||
const imgf = CK.ImageFilter; // less typing | ||
@@ -331,2 +334,24 @@ const filter = imgf.MakeBlur(2, 4, CK.TileMode.Mirror, null); // $ExpectType ImageFilter | ||
filter6); | ||
let filter10 = imgf.MakeBlend(CK.BlendMode.SrcOver, filter8, filter9); // $ExpectType ImageFilter | ||
filter10 = imgf.MakeBlend(CK.BlendMode.Xor, null, null); | ||
let filter11 = imgf.MakeDilate(2, 10, null); // $ExpectType ImageFilter | ||
filter11 = imgf.MakeDilate(2, 10, filter11); | ||
let filter12 = imgf.MakeErode(2, 10, null); // $ExpectType ImageFilter | ||
filter12 = imgf.MakeErode(2, 10, filter12); | ||
let filter13 = imgf.MakeDisplacementMap(// $ExpectType ImageFilter | ||
CK.ColorChannel.Red, CK.ColorChannel.Alpha, 3.2, filter11, filter12); | ||
filter13 = imgf.MakeDisplacementMap( | ||
CK.ColorChannel.Blue, CK.ColorChannel.Green, 512, null, null); | ||
let filter14 = imgf.MakeDropShadow(10, -30, 4.0, 2.0, CK.MAGENTA, null); // $ExpectType ImageFilter | ||
filter14 = imgf.MakeDropShadow(10, -30, 4.0, 2.0, CK.MAGENTA, filter14); | ||
filter14 = imgf.MakeDropShadowOnly(10, -30, 4.0, 2.0, CK.CYAN, null); | ||
filter14 = imgf.MakeDropShadowOnly(10, -30, 4.0, 2.0, CK.CYAN, filter14); | ||
let filter15 = imgf.MakeImage(img, { B: 1 / 3, C: 1 / 3 }); // $ExpectType ImageFilter | null | ||
filter15 = imgf.MakeImage(img, { filter: CK.FilterMode.Linear }, | ||
CK.LTRBRect(1, 2, 3, 4), CK.XYWHRect(5, 6, 7, 8)); | ||
let filter16 = imgf.MakeOffset(5, 3, null); // $ExpectType ImageFilter | ||
filter16 = imgf.MakeOffset(-100.3, -18, filter16); | ||
imgf.MakeShader(shader); // $ExpectType ImageFilter | ||
} | ||
@@ -446,3 +471,2 @@ | ||
const p7 = p3.makeAsWinding(); // $ExpectType Path | null | ||
const someRect = CK.LTRBRect(10, 20, 30, 40); | ||
@@ -459,2 +483,3 @@ // Making sure arrays are accepted as rrects. | ||
path.addRect(someRect, true); | ||
path.addCircle(10, 10, 10); | ||
path.addRRect(someRRect); | ||
@@ -516,2 +541,6 @@ path.addRRect(someRRect, true); | ||
path.trim(0.1, 0.7, false); | ||
if (CK.Path.CanInterpolate(p3, p4)) { | ||
const interpolated = CK.Path.MakeFromPathInterpolation(p3, p4, 0.5); // $ExpectType Path | null | ||
} | ||
} | ||
@@ -571,2 +600,3 @@ | ||
fontFeatures: [{name: 'smcp', value: 1}], | ||
fontVariations: [{axis: 'wght', value: 100}], | ||
shadows: [{color: CK.BLACK, blurRadius: 15}, | ||
@@ -573,0 +603,0 @@ {color: CK.RED, blurRadius: 5, offset: [10, 10]}], |
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
0
7770
24614550
4
- Removed@webgpu/types@^0.1.20
- Removed@webgpu/types@0.1.51(transitive)