roll CanvasKit 0.27.0 (flutter/engine#26304)

This commit is contained in:
Yegor
2021-05-20 17:54:01 -07:00
committed by GitHub
parent 49bd6973e4
commit 40327d5d01
6 changed files with 17 additions and 22 deletions

View File

@@ -778,7 +778,7 @@ class SkAnimatedImage {
/// Returns duration in milliseconds.
external int getRepetitionCount();
external int decodeNextFrame();
external SkImage getCurrentFrame();
external SkImage makeImageAtCurrentFrame();
external int width();
external int height();
@@ -1523,7 +1523,6 @@ class SkCanvas {
external void skew(double x, double y);
external void concat(Float32List matrix);
external void translate(double x, double y);
external void flush();
external void drawPicture(SkPicture picture);
external void drawParagraph(
SkParagraph paragraph,

View File

@@ -175,7 +175,7 @@ class CkAnimatedImage extends ManagedSkiaObject<SkAnimatedImage>
assert(_debugCheckIsNotDisposed());
final int durationMillis = skiaObject.decodeNextFrame();
final Duration duration = Duration(milliseconds: durationMillis);
final CkImage image = CkImage(skiaObject.getCurrentFrame());
final CkImage image = CkImage(skiaObject.makeImageAtCurrentFrame());
_nextFrameIndex = (_nextFrameIndex + 1) % _frameCount;
return Future<ui.FrameInfo>.value(AnimatedImageFrameInfo(duration, image));
}

View File

@@ -84,7 +84,7 @@ const bool canvasKitForceCpuOnly = bool.fromEnvironment(
/// NPM, update this URL to `https://unpkg.com/canvaskit-wasm@0.34.0/bin/`.
const String canvasKitBaseUrl = String.fromEnvironment(
'FLUTTER_WEB_CANVASKIT_URL',
defaultValue: 'https://unpkg.com/canvaskit-wasm@0.26.0/bin/',
defaultValue: 'https://unpkg.com/canvaskit-wasm@0.27.0/bin/',
);
final String canvasKitBuildUrl =
canvasKitBaseUrl + (kProfileMode ? 'profiling/' : '');

View File

@@ -292,7 +292,7 @@ void _imageTests() {
expect(nonAnimated.width(), 1);
expect(nonAnimated.height(), 1);
final SkImage frame = nonAnimated.getCurrentFrame();
final SkImage frame = nonAnimated.makeImageAtCurrentFrame();
expect(frame.width(), 1);
expect(frame.height(), 1);
@@ -317,7 +317,7 @@ void _imageTests() {
expect(animated.width(), 1);
expect(animated.height(), 1);
for (int i = 0; i < 100; i++) {
final SkImage frame = animated.getCurrentFrame();
final SkImage frame = animated.makeImageAtCurrentFrame();
expect(frame.width(), 1);
expect(frame.height(), 1);
expect(animated.decodeNextFrame(), 100);
@@ -956,7 +956,7 @@ void _canvasTests() {
final SkAnimatedImage image =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage);
canvas.drawAtlas(
image.getCurrentFrame(),
image.makeImageAtCurrentFrame(),
Float32List.fromList([0, 0, 1, 1]),
Float32List.fromList([1, 0, 2, 3]),
SkPaint(),
@@ -985,7 +985,7 @@ void _canvasTests() {
final SkAnimatedImage image =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage);
canvas.drawImageOptions(
image.getCurrentFrame(),
image.makeImageAtCurrentFrame(),
10,
20,
canvasKit.FilterMode.Linear,
@@ -998,7 +998,7 @@ void _canvasTests() {
final SkAnimatedImage image =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage);
canvas.drawImageCubic(
image.getCurrentFrame(),
image.makeImageAtCurrentFrame(),
10,
20,
0.3,
@@ -1011,7 +1011,7 @@ void _canvasTests() {
final SkAnimatedImage image =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage);
canvas.drawImageRectOptions(
image.getCurrentFrame(),
image.makeImageAtCurrentFrame(),
Float32List.fromList([0, 0, 1, 1]),
Float32List.fromList([0, 0, 1, 1]),
canvasKit.FilterMode.Linear,
@@ -1024,7 +1024,7 @@ void _canvasTests() {
final SkAnimatedImage image =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage);
canvas.drawImageRectCubic(
image.getCurrentFrame(),
image.makeImageAtCurrentFrame(),
Float32List.fromList([0, 0, 1, 1]),
Float32List.fromList([0, 0, 1, 1]),
0.3,
@@ -1037,7 +1037,7 @@ void _canvasTests() {
final SkAnimatedImage image =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage);
canvas.drawImageNine(
image.getCurrentFrame(),
image.makeImageAtCurrentFrame(),
Float32List.fromList([0, 0, 1, 1]),
Float32List.fromList([0, 0, 1, 1]),
canvasKit.FilterMode.Linear,
@@ -1154,10 +1154,6 @@ void _canvasTests() {
canvas.translate(4, 5);
});
test('flush', () {
canvas.flush();
});
test('drawPicture', () {
final SkPictureRecorder otherRecorder = SkPictureRecorder();
final SkCanvas otherCanvas =

View File

@@ -74,7 +74,7 @@ void testMain() {
test('CkImage toString', () {
final SkImage skImage =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage)
.getCurrentFrame();
.makeImageAtCurrentFrame();
final CkImage image = CkImage(skImage);
expect(image.toString(), '[1×1]');
image.dispose();
@@ -84,7 +84,7 @@ void testMain() {
test('CkImage can be explicitly disposed of', () {
final SkImage skImage =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage)
.getCurrentFrame();
.makeImageAtCurrentFrame();
final CkImage image = CkImage(skImage);
expect(image.debugDisposed, false);
expect(image.box.isDeletedPermanently, false);
@@ -100,7 +100,7 @@ void testMain() {
test('CkImage can be explicitly disposed of when cloned', () async {
final SkImage skImage =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage)
.getCurrentFrame();
.makeImageAtCurrentFrame();
final CkImage image = CkImage(skImage);
final SkiaObjectBox<CkImage, SkImage> box = image.box;
expect(box.refCount, 1);
@@ -134,7 +134,7 @@ void testMain() {
test('CkImage toByteData', () async {
final SkImage skImage =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage)
.getCurrentFrame();
.makeImageAtCurrentFrame();
final CkImage image = CkImage(skImage);
expect((await image.toByteData()).lengthInBytes, greaterThan(0));
expect((await image.toByteData(format: ui.ImageByteFormat.png)).lengthInBytes, greaterThan(0));
@@ -146,7 +146,7 @@ void testMain() {
browserSupportsFinalizationRegistry = false;
final SkImage skImage =
canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage)
.getCurrentFrame();
.makeImageAtCurrentFrame();
final CkImage image = CkImage(skImage);
expect(image.box.rawSkiaObject, isNotNull);

View File

@@ -62,7 +62,7 @@ void testMain() {
});
test('Image shader', () {
final SkImage skImage = canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage).getCurrentFrame();
final SkImage skImage = canvasKit.MakeAnimatedImageFromEncoded(kTransparentImage).makeImageAtCurrentFrame();
final CkImage image = CkImage(skImage);
final CkImageShader imageShader = ui.ImageShader(
image,