OLD | NEW |
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/common/font_warmup_win.h" | 5 #include "content/common/font_warmup_win.h" |
6 | 6 |
7 #include <dwrite.h> | 7 #include <dwrite.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 475 |
476 SkFontMgr* GetPreSandboxWarmupFontMgr() { | 476 SkFontMgr* GetPreSandboxWarmupFontMgr() { |
477 if (!g_warmup_fontmgr) { | 477 if (!g_warmup_fontmgr) { |
478 IDWriteFactory* factory; | 478 IDWriteFactory* factory; |
479 CreateDirectWriteFactory(&factory); | 479 CreateDirectWriteFactory(&factory); |
480 | 480 |
481 GetCustomFontCollection(factory); | 481 GetCustomFontCollection(factory); |
482 | 482 |
483 PatchDWriteFactory(factory); | 483 PatchDWriteFactory(factory); |
484 | 484 |
485 blink::WebFontRendering::setDirectWriteFactory(factory); | |
486 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(factory); | 485 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(factory); |
| 486 blink::WebFontRendering::setSkiaFontManager(g_warmup_fontmgr); |
487 } | 487 } |
488 return g_warmup_fontmgr; | 488 return g_warmup_fontmgr; |
489 } | 489 } |
490 | 490 |
491 GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) { | 491 GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) { |
492 if (ShouldUseDirectWriteFontProxyFieldTrial() && !g_warmup_fontmgr) | 492 if (ShouldUseDirectWriteFontProxyFieldTrial() && !g_warmup_fontmgr) |
493 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(); | 493 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(); |
494 // If not using the font proxy, we assume |g_warmup_fontmgr| is already | 494 // If not using the font proxy, we assume |g_warmup_fontmgr| is already |
495 // initialized before this function is called. | 495 // initialized before this function is called. |
496 DCHECK(g_warmup_fontmgr); | 496 DCHECK(g_warmup_fontmgr); |
(...skipping 23 matching lines...) Expand all Loading... |
520 // down for the CC HUD code, so use the same one here. Note that we don't use | 520 // down for the CC HUD code, so use the same one here. Note that we don't use |
521 // a monospace as would be nice in an attempt to avoid a small startup time | 521 // a monospace as would be nice in an attempt to avoid a small startup time |
522 // regression, see http://crbug.com/463613. | 522 // regression, see http://crbug.com/463613. |
523 skia::RefPtr<SkTypeface> hud_typeface = skia::AdoptRef( | 523 skia::RefPtr<SkTypeface> hud_typeface = skia::AdoptRef( |
524 GetPreSandboxWarmupFontMgr()->legacyCreateTypeface("Times New Roman", 0)); | 524 GetPreSandboxWarmupFontMgr()->legacyCreateTypeface("Times New Roman", 0)); |
525 DoPreSandboxWarmupForTypeface(hud_typeface.get()); | 525 DoPreSandboxWarmupForTypeface(hud_typeface.get()); |
526 gfx::SetHudTypeface(hud_typeface); | 526 gfx::SetHudTypeface(hud_typeface); |
527 } | 527 } |
528 | 528 |
529 } // namespace content | 529 } // namespace content |
OLD | NEW |