| Index: third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp
|
| index b5c526018e836751b1ff0dbe79afe6ce776bf5d5..6bdcd59fcd2d2fdd6f9be91b7244d8e41bad5d22 100644
|
| --- a/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp
|
| +++ b/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp
|
| @@ -15,7 +15,9 @@
|
| namespace {
|
|
|
| const unsigned CanvasFontCacheMaxFonts = 50;
|
| +const unsigned CanvasFontCacheMaxFontsLowEnd = 5;
|
| const unsigned CanvasFontCacheHardMaxFonts = 250;
|
| +const unsigned CanvasFontCacheHardMaxFontsLowEnd = 20;
|
| const unsigned CanvasFontCacheHiddenMaxFonts = 1;
|
| const int defaultFontSize = 10;
|
| const char defaultFontFamily[] = "sans-serif";
|
| @@ -45,12 +47,15 @@ CanvasFontCache::~CanvasFontCache() {
|
| }
|
|
|
| unsigned CanvasFontCache::MaxFonts() {
|
| - return CanvasFontCacheMaxFonts;
|
| + return MemoryCoordinator::IsLowEndDevice() ? CanvasFontCacheMaxFontsLowEnd
|
| + : CanvasFontCacheMaxFonts;
|
| }
|
|
|
| unsigned CanvasFontCache::HardMaxFonts() {
|
| return document_->hidden() ? CanvasFontCacheHiddenMaxFonts
|
| - : CanvasFontCacheHardMaxFonts;
|
| + : (MemoryCoordinator::IsLowEndDevice()
|
| + ? CanvasFontCacheHardMaxFontsLowEnd
|
| + : CanvasFontCacheHardMaxFonts);
|
| }
|
|
|
| bool CanvasFontCache::GetFontUsingDefaultStyle(const String& font_string,
|
|
|