Reland dispose images when done (#67100) (#67177)

* Reland dispose images when done (#67100)

Changes since last time:

- Test for CanvasKit image rendering
  (https://github.com/flutter/flutter/pull/67176)
- Fix CanvasKit dispose impl
  (https://github.com/flutter/engine/pull/21555)
- Update internal google3 customer with a problematic ImageStream
  Listener impl (cl/335091311, cl/335459002)

This reverts commit 473358d93d.
This commit is contained in:
Dan Field
2020-10-05 12:03:27 -07:00
committed by GitHub
parent ece2f98eb0
commit 2cdec25877
17 changed files with 833 additions and 117 deletions

View File

@@ -166,7 +166,7 @@ class AnimationSheetBuilder {
key: key,
cellSize: frameSize,
children: frames.map((ui.Image image) => RawImage(
image: image,
image: image.clone(),
width: frameSize.width,
height: frameSize.height,
)).toList(),

View File

@@ -38,12 +38,12 @@ Future<ui.Image> createTestImage({
final int cacheKey = hashValues(width, height);
if (cache && _cache.containsKey(cacheKey)) {
return _cache[cacheKey]!;
return _cache[cacheKey]!.clone();
}
final ui.Image image = await _createImage(width, height);
if (cache) {
_cache[cacheKey] = image;
_cache[cacheKey] = image.clone();
}
return image;
});