Dispose of embedded views in CanvasKit after resize (flutter/engine#27294)

This commit is contained in:
Harry Terkelsen 2021-07-09 15:43:56 -07:00 committed by GitHub
parent 4154082b2a
commit 2fbc4522df
2 changed files with 15 additions and 5 deletions

View File

@ -70,10 +70,6 @@ class HtmlViewEmbedder {
ui.Size _frameSize = ui.window.physicalSize;
void set frameSize(ui.Size size) {
if (_frameSize == size) {
return;
}
_activeCompositionOrder.clear();
_frameSize = size;
}

View File

@ -312,7 +312,7 @@ void testMain() {
// Expect: success. Just checking the system is not left in a corrupted state.
await _createPlatformView(0, 'test-platform-view');
renderTestScene(viewCount: 0);
// TODO(yjbanov): skipped due to https://github.com/flutter/flutter/issues/73867
// TODO(yjbanov): skipped due to https://github.com/flutter/flutter/issues/73867
}, skip: isSafari);
test('embeds and disposes of a platform view', () async {
@ -379,6 +379,20 @@ void testMain() {
isNotNull,
);
// Render a frame with a different platform view.
await _createPlatformView(1, 'test-platform-view');
sb = LayerSceneBuilder();
sb.pushOffset(0, 0);
sb.addPlatformView(1, width: 10, height: 10);
dispatcher.rasterizer!.draw(sb.build().layerTree);
expect(
domRenderer.sceneElement!.querySelectorAll('flt-platform-view-slot'),
hasLength(1));
expect(
domRenderer.glassPaneElement!.querySelectorAll('flt-platform-view'),
hasLength(2));
// Render a frame without a platform view, but also without disposing of
// the platform view.
sb = LayerSceneBuilder();