mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1061943 - Purge all GradientCache on memory-pressure r=jrmuizel
This commit is contained in:
parent
1f8d0085b8
commit
79d583db14
@ -207,6 +207,14 @@ gfxGradientCache::GetOrCreateGradientStops(DrawTarget *aDT, nsTArray<GradientSto
|
||||
return gs;
|
||||
}
|
||||
|
||||
void
|
||||
gfxGradientCache::PurgeAllCaches()
|
||||
{
|
||||
if (gGradientCache) {
|
||||
gGradientCache->AgeAllGenerations();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gfxGradientCache::Shutdown()
|
||||
{
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
nsTArray<gfx::GradientStop>& aStops,
|
||||
gfx::ExtendMode aExtend);
|
||||
|
||||
static void PurgeAllCaches();
|
||||
static void Shutdown();
|
||||
};
|
||||
|
||||
|
@ -220,6 +220,7 @@ MemoryPressureObserver::Observe(nsISupports *aSubject,
|
||||
{
|
||||
NS_ASSERTION(strcmp(aTopic, "memory-pressure") == 0, "unexpected event topic");
|
||||
Factory::PurgeAllCaches();
|
||||
gfxGradientCache::PurgeAllCaches();
|
||||
|
||||
gfxPlatform::GetPlatform()->PurgeSkiaCache();
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user