Chromium Code Reviews| 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/public/renderer/render_font_warmup_win.h" | 5 #include "content/public/renderer/render_font_warmup_win.h" |
| 6 | 6 |
| 7 #include <dwrite.h> | 7 #include <dwrite.h> |
| 8 | 8 |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 paint_warmup.setTypeface(typeface); | 184 paint_warmup.setTypeface(typeface); |
| 185 wchar_t glyph = L'S'; | 185 wchar_t glyph = L'S'; |
| 186 paint_warmup.measureText(&glyph, 2); | 186 paint_warmup.measureText(&glyph, 2); |
| 187 } | 187 } |
| 188 | 188 |
| 189 SkFontMgr* GetPreSandboxWarmupFontMgr() { | 189 SkFontMgr* GetPreSandboxWarmupFontMgr() { |
| 190 if (!g_warmup_fontmgr) { | 190 if (!g_warmup_fontmgr) { |
| 191 IDWriteFactory* factory; | 191 IDWriteFactory* factory; |
| 192 CreateDirectWriteFactory(&factory); | 192 CreateDirectWriteFactory(&factory); |
| 193 | 193 |
| 194 IDWriteFontCollection* collection = GetCustomFontCollection(factory); | 194 GetCustomFontCollection(factory); |
|
Peter Kasting
2014/11/18 00:41:03
I assumed calling this was important to warm up so
| |
| 195 | 195 |
| 196 PatchDWriteFactory(factory); | 196 PatchDWriteFactory(factory); |
| 197 | 197 |
| 198 blink::WebFontRendering::setDirectWriteFactory(factory); | 198 blink::WebFontRendering::setDirectWriteFactory(factory); |
| 199 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(factory); | 199 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(factory); |
| 200 } | 200 } |
| 201 return g_warmup_fontmgr; | 201 return g_warmup_fontmgr; |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace content | 204 } // namespace content |
| OLD | NEW |