mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Clean up stale cache entries in Skia's GrContext (#6859)
Fixes https://github.com/flutter/flutter/issues/24160
This commit is contained in:
parent
498bbd5ef9
commit
2c6be93fa9
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user