のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

USE_SKIA_GPU

901 void
902 gfxPlatform::InitializeSkiaCaches()
903 {
904 #ifdef USE_SKIA_GPU
905   if (UseAcceleratedSkiaCanvas()) {
906     bool usingDynamicCache = Preferences::GetBool("gfx.canvas.skiagl.dynamic-cache", false);
907 
908     int cacheItemLimit = Preferences::GetInt("gfx.canvas.skiagl.cache-items", 256);
909     int cacheSizeLimit = Preferences::GetInt("gfx.canvas.skiagl.cache-size", 96);
910 
911     // Prefs are in megabytes, but we want the sizes in bytes
912     cacheSizeLimit *= 1024*1024;
913 
914     if (usingDynamicCache) {
915       uint32_t totalMemory = mozilla::hal::GetTotalSystemMemory();
916 
917       if (totalMemory <= 256*1024*1024) {
918         // We need a very minimal cache on 256 meg devices
919         cacheSizeLimit = 2*1024*1024;
920       } else if (totalMemory > 0) {
921         cacheSizeLimit = totalMemory / 16;
922       }
923     }
924 
925 #ifdef DEBUG
926     printf_stderr("Determined SkiaGL cache limits: Size %i, Items: %i\n", cacheSizeLimit, cacheItemLimit);
927 #endif
928 
929     Factory::SetGlobalSkiaCacheLimits(cacheItemLimit, cacheSizeLimit);
930   }
931 #endif
932 }