From 11d0020dd63da4a3d4c5f92025596b17ea36eb95 Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Tue, 24 Mar 2020 20:10:10 -0700 Subject: [PATCH] Flush background canvas before allocating a new surface (flutter/engine#17308) --- .../darwin/ios/framework/Source/FlutterPlatformViews.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index b96fcbbbaa7..32c91c91e40 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -451,6 +451,9 @@ bool FlutterPlatformViewsController::SubmitFrame(GrContext* gr_context, std::shared_ptr ios_context, SkCanvas* background_canvas) { DisposeViews(); + + // Resolve all pending GPU operations before allocating a new surface. + background_canvas->flush(); // Clipping the background canvas before drawing the picture recorders requires to // save and restore the clip context. SkAutoCanvasRestore save(background_canvas, /*doSave=*/true);