aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/ports
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-09-19 12:13:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-19 12:13:16 -0700
commit1ae0e01accbca4b96a10b8a8c21917dd7bf27dc3 (patch)
tree61601c7afe04b356d2117fd2b00fd25faa01917b /include/ports
parent0262b5c1a0ab704e42d367b070a09bb83188d983 (diff)
Split SkFontConfigInterface globals and factory.
Chromium needs to be able to set up their build such that the globals continue existing but the SkFontMgr::Factory can be defined separately. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2346333002 CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review-Url: https://codereview.chromium.org/2346333002
Diffstat (limited to 'include/ports')
-rw-r--r--include/ports/SkFontConfigInterface.h11
-rw-r--r--include/ports/SkFontMgr_FontConfigInterface.h20
2 files changed, 24 insertions, 7 deletions
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h
index 30fc8a35fb..74f766f52e 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -25,9 +25,10 @@ class SK_API SkFontConfigInterface : public SkRefCnt {
public:
/**
- * Returns the global SkFontConfigInterface instance, and if it is not
- * NULL, calls ref() on it. The caller must balance this with a call to
- * unref().
+ * Returns the global SkFontConfigInterface instance. If it is not
+ * nullptr, calls ref() on it. The caller must balance this with a call to
+ * unref(). The default SkFontConfigInterface is the result of calling
+ * GetSingletonDirectInterface.
*/
static SkFontConfigInterface* RefGlobal();
@@ -105,7 +106,6 @@ public:
/**
* Return a singleton instance of a direct subclass that calls into
* libfontconfig. This does not affect the refcnt of the returned instance.
- * The mutex may be used to guarantee the singleton is only constructed once.
*/
static SkFontConfigInterface* GetSingletonDirectInterface();
@@ -115,7 +115,4 @@ public:
typedef SkRefCnt INHERITED;
};
-/** Creates a SkFontMgr which wraps a SkFontConfigInterface. */
-SK_API SkFontMgr* SkFontMgr_New_FCI(SkFontConfigInterface* fci);
-
#endif
diff --git a/include/ports/SkFontMgr_FontConfigInterface.h b/include/ports/SkFontMgr_FontConfigInterface.h
new file mode 100644
index 0000000000..356e54c87d
--- /dev/null
+++ b/include/ports/SkFontMgr_FontConfigInterface.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_FontConfigInterface_DEFINED
+#define SkFontMgr_FontConfigInterface_DEFINED
+
+#include "SkTypes.h"
+#include "SkRefCnt.h"
+
+class SkFontMgr;
+class SkFontConfigInterface;
+
+/** Creates a SkFontMgr which wraps a SkFontConfigInterface. */
+SK_API SkFontMgr* SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci);
+
+#endif // #ifndef SkFontMgr_FontConfigInterface_DEFINED