未验证 提交 2c6be93f 编写于 作者: J Jason Simmons 提交者: GitHub

Clean up stale cache entries in Skia's GrContext (#6859)

Fixes https://github.com/flutter/flutter/issues/24160
上级 498bbd5e
......@@ -16,6 +16,10 @@
namespace shell {
// The rasterizer will tell Skia to purge cached resources that have not been
// used within this interval.
static constexpr std::chrono::milliseconds kSkiaCleanupExpiration(15000);
Rasterizer::Rasterizer(blink::TaskRunners task_runners)
: Rasterizer(std::move(task_runners),
std::make_unique<flow::CompositorContext>()) {}
......@@ -186,6 +190,9 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) {
external_view_embedder->SubmitFrame(surface_->GetContext());
}
FireNextFrameCallbackIfPresent();
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册