Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a6fb429

Browse files
authored
Merge branch 'main' into diagnostics-r3
2 parents 09ed6b3 + ed95b49 commit a6fb429

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vars = {
1414
'flutter_git': 'https://flutter.googlesource.com',
1515
'skia_git': 'https://skia.googlesource.com',
1616
'llvm_git': 'https://llvm.googlesource.com',
17-
'skia_revision': 'b5ad5bf3696d91924e5e9a39d3ebe9b6c56ca260',
17+
'skia_revision': '8db309541ad99394b7d6750b0c0ec8a3872abbc5',
1818

1919
# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
2020
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
@@ -56,7 +56,7 @@ vars = {
5656
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
5757
# You can use //tools/dart/create_updated_flutter_deps.py to produce
5858
# updated revision list of existing dependencies.
59-
'dart_revision': '5df6a6e0c037146eafd3b505647cb6115a3cd81f',
59+
'dart_revision': 'efabc916307817f754f0273cb912d59c4101cb57',
6060

6161
# WARNING: DO NOT EDIT MANUALLY
6262
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py

ci/licenses_golden/licenses_skia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: ffcfcfb7deb379c418ab887fed00374c
1+
Signature: d9d9d8dcf8eb70d3098e919af32d5a20
22

33
====================================================================================================
44
LIBRARY: etc1

lib/web_ui/lib/src/engine/canvaskit/image.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class CkResizingCodec extends ResizingCodec {
130130
return image;
131131
}
132132

133+
image.dispose();
133134
return CkImage(skImage, imageSource: ImageBitmapImageSource(bitmap));
134135
}
135136
}

lib/web_ui/test/canvaskit/image_test.dart

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ void main() {
2121
void testMain() {
2222
setUpCanvasKitTest();
2323

24+
tearDown(() {
25+
ui.Image.onCreate = null;
26+
ui.Image.onDispose = null;
27+
});
28+
2429
test('toImage succeeds', () async {
2530
final ui.Image image = await _createImage();
2631
expect(image.runtimeType.toString(), equals('CkImage'));
@@ -44,8 +49,6 @@ void testMain() {
4449

4550
expect(onCreateInvokedCount, 2);
4651
expect(createdImage, image2);
47-
48-
ui.Image.onCreate = null;
4952
});
5053

5154
test('dispose() invokes onDispose once', () async {
@@ -65,8 +68,6 @@ void testMain() {
6568

6669
expect(onDisposeInvokedCount, 2);
6770
expect(disposedImage, image2);
68-
69-
ui.Image.onDispose = null;
7071
});
7172

7273
test('fetchImage fetches image in chunks', () async {
@@ -106,6 +107,30 @@ void testMain() {
106107
expect(size?.width, 600);
107108
expect(size?.height, 300);
108109
});
110+
111+
test('instantiateImageCodecWithSize disposes temporary image', () async {
112+
final Set<ui.Image> activeImages = <ui.Image>{};
113+
ui.Image.onCreate = activeImages.add;
114+
ui.Image.onDispose = activeImages.remove;
115+
116+
final ui.Image image = await _createImage();
117+
final ByteData? imageData = await image.toByteData(format: ui.ImageByteFormat.png);
118+
final ui.ImmutableBuffer imageBuffer = await ui.ImmutableBuffer.fromUint8List(imageData!.buffer.asUint8List());
119+
image.dispose();
120+
121+
final ui.Codec codec = await ui.instantiateImageCodecWithSize(
122+
imageBuffer,
123+
getTargetSize: (w, h) => ui.TargetImageSize(width: w ~/ 2, height: h ~/ 2)
124+
);
125+
final ui.FrameInfo frameInfo = await codec.getNextFrame();
126+
127+
expect(activeImages.length, 1);
128+
129+
frameInfo.image.dispose();
130+
codec.dispose();
131+
132+
expect(activeImages.length, 0);
133+
});
109134
}
110135

111136
Future<ui.Image> _createImage() => _createPicture().toImage(10, 10);

sky/packages/sky_engine/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31926,7 +31926,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
3192631926
This Source Code Form is "Incompatible With Secondary Licenses", as
3192731927
defined by the Mozilla Public License, v. 2.0.
3192831928

31929-
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/5df6a6e0c037146eafd3b505647cb6115a3cd81f
31929+
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/efabc916307817f754f0273cb912d59c4101cb57
3193031930
/third_party/fallback_root_certificates/
3193131931

3193231932
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)