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

Reland "Clean up stale cache entries in Skia's GrContext" (#6867)

Check for software rendering modes that do not have a GrContext
上级 e6f22b74
......@@ -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,10 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) {
external_view_embedder->SubmitFrame(surface_->GetContext());
}
FireNextFrameCallbackIfPresent();
if (surface_->GetContext())
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册