Use performDeferredCleanup instead of freeGpuResources (flutter/engine#20413)

This commit is contained in:
Dan Field
2020-08-11 14:01:01 -07:00
committed by GitHub
parent 606cb02b86
commit 8c0b89b1f4

View File

@@ -99,15 +99,17 @@ void Rasterizer::Teardown() {
void Rasterizer::NotifyLowMemoryWarning() const {
if (!surface_) {
FML_DLOG(INFO) << "Rasterizer::PurgeCaches called with no surface.";
FML_DLOG(INFO)
<< "Rasterizer::NotifyLowMemoryWarning called with no surface.";
return;
}
auto context = surface_->GetContext();
if (!context) {
FML_DLOG(INFO) << "Rasterizer::PurgeCaches called with no GrContext.";
FML_DLOG(INFO)
<< "Rasterizer::NotifyLowMemoryWarning called with no GrContext.";
return;
}
context->freeGpuResources();
context->performDeferredCleanup(std::chrono::milliseconds(0));
}
flutter::TextureRegistry* Rasterizer::GetTextureRegistry() {