Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: skia/ext/fontmgr_default_win.cc

Issue 132113015: IPC interface for font management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Match final interface and cleanup usage. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: skia/ext/fontmgr_default_win.cc
===================================================================
--- skia/ext/fontmgr_default_win.cc (revision 0)
+++ skia/ext/fontmgr_default_win.cc (working copy)
@@ -0,0 +1,29 @@
+// 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"
+
+namespace {
+
+static SkFontMgr* default_fontmgr = NULL;
+
+}; // namespace
+
+void SK_API SkSetFontMgr(SkFontMgr* fontmgr) {
+ ::default_fontmgr = SkRef(fontmgr);
+}
+
+SkFontMgr* SkFontMgr::Factory() {
+ if (::default_fontmgr) {
+ return SkRef(::default_fontmgr);
+ } else {
+ SkFontMgr* fontmgr = SkFontMgr_New_DirectWrite();
+ if (NULL == fontmgr) {
+ fontmgr = SkFontMgr_New_GDI();
+ }
+ return fontmgr;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698