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

Side by Side Diff: content/renderer/renderer_font_platform_win.cc

Issue 557633003: Raise kMaxFontThreshold (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/renderer_font_platform_win.h" 5 #include "content/renderer/renderer_font_platform_win.h"
6 6
7 #include <dwrite.h> 7 #include <dwrite.h>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <wrl/implements.h> 10 #include <wrl/implements.h>
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 IDWriteFontCollection* GetCustomFontCollection(IDWriteFactory* factory) { 343 IDWriteFontCollection* GetCustomFontCollection(IDWriteFactory* factory) {
344 if (g_font_collection.Get() != NULL) 344 if (g_font_collection.Get() != NULL)
345 return g_font_collection.Get(); 345 return g_font_collection.Get();
346 346
347 base::TimeTicks start_tick = base::TimeTicks::Now(); 347 base::TimeTicks start_tick = base::TimeTicks::Now();
348 348
349 FontCollectionLoader::Initialize(factory); 349 FontCollectionLoader::Initialize(factory);
350 350
351 // We try here to put arbitrary limit on max number of fonts that could 351 // We try here to put arbitrary limit on max number of fonts that could
352 // be loaded, otherwise we fallback to restricted set of fonts. 352 // be loaded, otherwise we fallback to restricted set of fonts.
353 const UINT32 kMaxFontThreshold = 1000; 353 const UINT32 kMaxFontThreshold = 1750;
354 HRESULT hr = E_FAIL; 354 HRESULT hr = E_FAIL;
355 if (g_font_loader->GetFontMapSize() < kMaxFontThreshold) { 355 if (g_font_loader->GetFontMapSize() < kMaxFontThreshold) {
356 hr = factory->CreateCustomFontCollection( 356 hr = factory->CreateCustomFontCollection(
357 g_font_loader.Get(), NULL, 0, g_font_collection.GetAddressOf()); 357 g_font_loader.Get(), NULL, 0, g_font_collection.GetAddressOf());
358 } 358 }
359 359
360 bool loadingRestricted = false; 360 bool loadingRestricted = false;
361 if (FAILED(hr) || !g_font_collection.Get()) { 361 if (FAILED(hr) || !g_font_collection.Get()) {
362 // We will try here just one more time with restricted font set. 362 // We will try here just one more time with restricted font set.
363 g_font_loader->LoadRestrictedFontList(); 363 g_font_loader->LoadRestrictedFontList();
(...skipping 12 matching lines...) Expand all
376 CHECK(g_font_collection.Get() != NULL); 376 CHECK(g_font_collection.Get() != NULL);
377 377
378 UMA_HISTOGRAM_TIMES("DirectWrite.Fonts.LoadTime", time_delta); 378 UMA_HISTOGRAM_TIMES("DirectWrite.Fonts.LoadTime", time_delta);
379 379
380 base::debug::ClearCrashKey(kFontKeyName); 380 base::debug::ClearCrashKey(kFontKeyName);
381 381
382 return g_font_collection.Get(); 382 return g_font_collection.Get();
383 } 383 }
384 384
385 } // namespace content 385 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698