mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1303054 - use dynamic cache size with SkiaGL on desktop. r=milan
MozReview-Commit-ID: 3Hhsa1SNcXw
This commit is contained in:
parent
31d21069da
commit
4649ee4713
@ -100,8 +100,6 @@
|
||||
#include "mozilla/layers/GrallocTextureHost.h"
|
||||
#endif
|
||||
|
||||
#include "mozilla/Hal.h"
|
||||
|
||||
#ifdef USE_SKIA
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic push
|
||||
@ -144,6 +142,7 @@ class mozilla::gl::SkiaGLGlue : public GenericAtomicRefCounted {
|
||||
#include "gfxVR.h"
|
||||
#include "VRManagerChild.h"
|
||||
#include "mozilla/gfx/GPUParent.h"
|
||||
#include "prsystem.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
@ -506,7 +505,8 @@ gfxPlatform::gfxPlatform()
|
||||
#endif
|
||||
InitBackendPrefs(canvasMask, BackendType::CAIRO,
|
||||
contentMask, BackendType::CAIRO);
|
||||
mTotalSystemMemory = mozilla::hal::GetTotalSystemMemory();
|
||||
|
||||
mTotalSystemMemory = PR_GetPhysicalMemorySize();
|
||||
|
||||
VRManager::ManagerInit();
|
||||
}
|
||||
@ -1274,7 +1274,7 @@ gfxPlatform::InitializeSkiaCacheLimits()
|
||||
#ifdef USE_SKIA_GPU
|
||||
bool usingDynamicCache = gfxPrefs::CanvasSkiaGLDynamicCache();
|
||||
int cacheItemLimit = gfxPrefs::CanvasSkiaGLCacheItems();
|
||||
int cacheSizeLimit = gfxPrefs::CanvasSkiaGLCacheSize();
|
||||
uint64_t cacheSizeLimit = std::max(gfxPrefs::CanvasSkiaGLCacheSize(), (int32_t)0);
|
||||
|
||||
// Prefs are in megabytes, but we want the sizes in bytes
|
||||
cacheSizeLimit *= 1024*1024;
|
||||
@ -1289,11 +1289,14 @@ gfxPlatform::InitializeSkiaCacheLimits()
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure cache size doesn't overflow on 32-bit platforms.
|
||||
cacheSizeLimit = std::min(cacheSizeLimit, (uint64_t)SIZE_MAX);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf_stderr("Determined SkiaGL cache limits: Size %i, Items: %i\n", cacheSizeLimit, cacheItemLimit);
|
||||
printf_stderr("Determined SkiaGL cache limits: Size %" PRIu64 ", Items: %i\n", cacheSizeLimit, cacheItemLimit);
|
||||
#endif
|
||||
|
||||
mSkiaGlue->GetGrContext()->setResourceCacheLimits(cacheItemLimit, cacheSizeLimit);
|
||||
mSkiaGlue->GetGrContext()->setResourceCacheLimits(cacheItemLimit, (size_t)cacheSizeLimit);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -770,7 +770,7 @@ protected:
|
||||
// max number of entries in word cache
|
||||
int32_t mWordCacheMaxEntries;
|
||||
|
||||
uint32_t mTotalSystemMemory;
|
||||
uint64_t mTotalSystemMemory;
|
||||
|
||||
// Hardware vsync source. Only valid on parent process
|
||||
RefPtr<mozilla::gfx::VsyncSource> mVsyncSource;
|
||||
|
@ -786,6 +786,8 @@ pref("gfx.content.azure.backends", "skia");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
pref("gfx.canvas.skiagl.dynamic-cache", true);
|
||||
|
||||
pref("gfx.text.disable-aa", false);
|
||||
|
||||
pref("gfx.work-around-driver-bugs", true);
|
||||
|
Loading…
Reference in New Issue
Block a user