Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: content/common/dwrite_font_platform_win.cc

Issue 796643004: Experimental change: Remove DirectWrite 1750 font limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified data file version in DirectWrite unittest. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/test/data/font/dwrite_font_cache_arial.dat » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3981ff24bd1a58ae3a43681264716895cda3cac7..2f49da1e0effe697fc799d4f0e9400c7c938f704 100644
--- a/content/common/dwrite_font_platform_win.cc
+++ b/content/common/dwrite_font_platform_win.cc
@@ -84,9 +84,9 @@ const double kArbitraryCacheFileSizeLimit = (20 * 1024 * 1024);
// that file directly from system fonts folder.
const unsigned int kMaxFontFileNameLength = 34;
-const DWORD kCacheFileVersion = 101;
-const DWORD kFileSignature = 0x4D4F5243; // CROM
-const DWORD kMagicCompletionSignature = 0x454E4F44; // DONE
+const DWORD kCacheFileVersion = 102;
+const DWORD kFileSignature = 0x4D4F5243; // CROM
+const DWORD kMagicCompletionSignature = 0x454E4F44; // DONE
const DWORD kUndefinedDWORDS = 36;
@@ -1025,16 +1025,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()) {
@@ -1102,16 +1097,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.
- 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);
+ 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()) {
« no previous file with comments | « no previous file | content/test/data/font/dwrite_font_cache_arial.dat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698