Do not pass invalid platform view rendering surfaces to the rasterizer (flutter/engine#21259)

This commit is contained in:
Jason Simmons
2020-09-28 11:57:01 -07:00
committed by GitHub
parent 67cfb02b18
commit 19b073917b

View File

@@ -72,9 +72,16 @@ void PlatformView::NotifyCreated() {
fml::TaskRunner::RunNowOrPostTask(
task_runners_.GetRasterTaskRunner(), [platform_view, &surface, &latch]() {
surface = platform_view->CreateRenderingSurface();
if (surface && !surface->IsValid()) {
surface.reset();
}
latch.Signal();
});
latch.Wait();
if (!surface) {
FML_LOG(ERROR) << "Failed to create platform view rendering surface";
return;
}
delegate_.OnPlatformViewCreated(std::move(surface));
}