Chromium Code Reviews| Index: content/common/dwrite_font_platform_win.cc |
| diff --git a/content/common/dwrite_font_platform_win.cc b/content/common/dwrite_font_platform_win.cc |
| index 5d56ce4b55549cf41cbca6d840421b801ff1961f..c2947ab5ee5a089a978fcaa2c15925704dcf6711 100644 |
| --- a/content/common/dwrite_font_platform_win.cc |
| +++ b/content/common/dwrite_font_platform_win.cc |
| @@ -84,7 +84,7 @@ const double kArbitraryCacheFileSizeLimit = (20 * 1024 * 1024); |
| // that file directly from system fonts folder. |
| const unsigned int kMaxFontFileNameLength = 34; |
| -const DWORD kCacheFileVersion = 101; |
| +const DWORD kCacheFileVersion = 102; |
| const DWORD kFileSignature = 0x4D4F5243; // CROM |
| const DWORD kMagicCompletionSignature = 0x454E4F44; // DONE |
| @@ -1028,16 +1028,11 @@ IDWriteFontCollection* GetCustomFontCollection(IDWriteFactory* factory) { |
| bool cache_file_loaded = g_font_loader->LoadCacheFile(); |
| - // We try here to put arbitrary limit on max number of fonts that could |
| - // be loaded, otherwise we fallback to restricted set of fonts. |
| - const UINT32 kMaxFontThreshold = 1750; |
| HRESULT hr = E_FAIL; |
| - if (g_font_loader->GetFontMapSize() < kMaxFontThreshold) { |
| - g_font_loader->EnableCollectionBuildingMode(true); |
| - hr = factory->CreateCustomFontCollection( |
| - g_font_loader.Get(), NULL, 0, g_font_collection.GetAddressOf()); |
| - g_font_loader->EnableCollectionBuildingMode(false); |
| - } |
| + g_font_loader->EnableCollectionBuildingMode(true); |
| + hr = factory->CreateCustomFontCollection( |
| + g_font_loader.Get(), NULL, 0, g_font_collection.GetAddressOf()); |
| + g_font_loader->EnableCollectionBuildingMode(false); |
| bool loading_restricted = false; |
| if (FAILED(hr) || !g_font_collection.Get()) { |
| @@ -1105,16 +1100,11 @@ bool BuildFontCacheInternal(const WCHAR* file_name) { |
| mswr::ComPtr<IDWriteFontCollection> font_collection; |
| - // We try here to put arbitrary limit on max number of fonts that could |
| - // be loaded, otherwise we fallback to restricted set of fonts. |
|
cpu_(ooo_6.6-7.5)
2014/12/11 23:31:24
we had the same constant twice?
Shrikant Kelkar
2014/12/11 23:43:50
Acknowledged.
|
| - const UINT32 kMaxFontThreshold = 1750; |
| HRESULT hr = E_FAIL; |
| - if (g_font_loader->GetFontMapSize() < kMaxFontThreshold) { |
| - g_font_loader->EnableCollectionBuildingMode(true); |
| - hr = factory->CreateCustomFontCollection( |
| - g_font_loader.Get(), NULL, 0, font_collection.GetAddressOf()); |
| - g_font_loader->EnableCollectionBuildingMode(false); |
| - } |
| + g_font_loader->EnableCollectionBuildingMode(true); |
|
cpu_(ooo_6.6-7.5)
2014/12/11 23:31:24
can it handle 20K fonts? is so go ahead. lgtm.
Shrikant Kelkar
2014/12/11 23:43:50
It may not.. but in this experiment let's see to w
|
| + hr = factory->CreateCustomFontCollection( |
| + g_font_loader.Get(), NULL, 0, font_collection.GetAddressOf()); |
| + g_font_loader->EnableCollectionBuildingMode(false); |
| bool loading_restricted = false; |
| if (FAILED(hr) || !font_collection.Get()) { |