OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "third_party/skia/include/core/SkTypes.h" |
| 6 #include "third_party/skia/include/ports/SkFontMgr.h" |
| 7 #include "third_party/skia/include/ports/SkTypeface_win.h" |
| 8 |
| 9 namespace { |
| 10 |
| 11 static SkFontMgr* default_fontmgr = NULL; |
| 12 |
| 13 }; // namespace |
| 14 |
| 15 void SK_API SkSetFontMgr(SkFontMgr* fontmgr) { |
| 16 ::default_fontmgr = SkRef(fontmgr); |
| 17 } |
| 18 |
| 19 SkFontMgr* SkFontMgr::Factory() { |
| 20 if (::default_fontmgr) { |
| 21 return SkRef(::default_fontmgr); |
| 22 } else { |
| 23 SkFontMgr* fontmgr = SkFontMgr_New_DirectWrite(); |
| 24 if (NULL == fontmgr) { |
| 25 fontmgr = SkFontMgr_New_GDI(); |
| 26 } |
| 27 return fontmgr; |
| 28 } |
| 29 } |
OLD | NEW |