Chromium Code Reviews| Index: skia/ext/fontmgr_default_ipc.cc |
| =================================================================== |
| --- skia/ext/fontmgr_default_ipc.cc (revision 0) |
| +++ skia/ext/fontmgr_default_ipc.cc (working copy) |
| @@ -0,0 +1,23 @@ |
| +// Copyright (c) 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 "third_party/skia/include/core/SkTypes.h" |
| +#include "third_party/skia/include/ports/SkFontMgr.h" |
| +#include "third_party/skia/include/ports/SkTypeface_win.h" |
| + |
| +static SkFontMgr* gSkFontMgr = NULL; |
|
brettw
2014/03/11 21:38:15
Can this be in an anon namespace to avoid exportin
bungeman-chromium
2014/03/13 22:33:31
Done. This (and the rest of the machinery around t
|
| + |
| +void SK_API SkSetFontMgr(SkFontMgr* fontmgr) { |
| + gSkFontMgr = fontmgr; |
| +} |
| + |
| +SkFontMgr* SkFontMgr::Factory() { |
| + // We cannot directly 'new skia::FontMgrProxy_DirectWrite()'. |
| + // The proxy lives in content_common, since content_common depends on skia. |
| + if (gSkFontMgr) { |
| + return gSkFontMgr; |
| + } else { |
| + return SkFontMgr_New_DirectWrite(); |
| + } |
| +} |