Chromium Code Reviews| Index: skia/ext/fontmgr_default_win.cc |
| diff --git a/skia/ext/fontmgr_default_win.cc b/skia/ext/fontmgr_default_win.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3d251d0902ece1a7ae565246f3f2fa7d882905a5 |
| --- /dev/null |
| +++ b/skia/ext/fontmgr_default_win.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "skia/ext/fontmgr_default_win.h" |
| + |
| +#include "third_party/skia/include/ports/SkFontMgr.h" |
| +#include "third_party/skia/include/ports/SkTypeface_win.h" |
| + |
| +namespace { |
| + |
| +SkFontMgr* g_default_fontmgr; |
| + |
| +} // namespace |
| + |
| +void SetDefaultSkiaFactory(SkFontMgr* fontmgr) { |
| + g_default_fontmgr = fontmgr; |
| +} |
| + |
| +SK_API SkFontMgr* SkFontMgr::Factory() { |
| + // This will be set when DirectWrite is in use, and an SkFontMgr has been |
| + // created with the pre-sandbox warmed up one. Otherwise, we fallback to a |
| + // GDI SkFontMgr which is used in the browser. |
| + if (g_default_fontmgr) |
| + return g_default_fontmgr; |
|
bungeman-skia
2014/06/18 19:49:36
Note that SkFontMgr is SkRefCnt, so it might make
scottmg
2014/06/18 20:02:49
Done.
Just to confirm, the interpretation now is
|
| + return SkFontMgr_New_GDI(); |
| +} |