aboutsummaryrefslogtreecommitdiff
path: root/src/deps/skia/include/ports
diff options
context:
space:
mode:
Diffstat (limited to 'src/deps/skia/include/ports')
-rw-r--r--src/deps/skia/include/ports/BUILD.bazel159
-rw-r--r--src/deps/skia/include/ports/SkCFObject.h184
-rw-r--r--src/deps/skia/include/ports/SkFontConfigInterface.h115
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_FontConfigInterface.h20
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_android.h45
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_directory.h21
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_empty.h21
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_fontconfig.h22
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_fuchsia.h19
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_indirect.h102
-rw-r--r--src/deps/skia/include/ports/SkFontMgr_mac_ct.h27
-rw-r--r--src/deps/skia/include/ports/SkImageGeneratorCG.h20
-rw-r--r--src/deps/skia/include/ports/SkImageGeneratorNDK.h40
-rw-r--r--src/deps/skia/include/ports/SkImageGeneratorWIC.h35
-rw-r--r--src/deps/skia/include/ports/SkRemotableFontMgr.h139
-rw-r--r--src/deps/skia/include/ports/SkTypeface_mac.h44
-rw-r--r--src/deps/skia/include/ports/SkTypeface_win.h79
17 files changed, 1092 insertions, 0 deletions
diff --git a/src/deps/skia/include/ports/BUILD.bazel b/src/deps/skia/include/ports/BUILD.bazel
new file mode 100644
index 000000000..4b9b65e07
--- /dev/null
+++ b/src/deps/skia/include/ports/BUILD.bazel
@@ -0,0 +1,159 @@
+load("//bazel:macros.bzl", "generated_cc_atom")
+
+generated_cc_atom(
+ name = "SkCFObject_hdr",
+ hdrs = ["SkCFObject.h"],
+ visibility = ["//:__subpackages__"],
+ deps = ["//include/core:SkTypes_hdr"],
+)
+
+generated_cc_atom(
+ name = "SkFontConfigInterface_hdr",
+ hdrs = ["SkFontConfigInterface.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkFontStyle_hdr",
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkStream_hdr",
+ "//include/core:SkTypeface_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_FontConfigInterface_hdr",
+ hdrs = ["SkFontMgr_FontConfigInterface.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_android_hdr",
+ hdrs = ["SkFontMgr_android.h"],
+ visibility = ["//:__subpackages__"],
+ deps = ["//include/core:SkRefCnt_hdr"],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_directory_hdr",
+ hdrs = ["SkFontMgr_directory.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_empty_hdr",
+ hdrs = ["SkFontMgr_empty.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_fontconfig_hdr",
+ hdrs = ["SkFontMgr_fontconfig.h"],
+ visibility = ["//:__subpackages__"],
+ deps = ["//include/core:SkRefCnt_hdr"],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_fuchsia_hdr",
+ hdrs = ["SkFontMgr_fuchsia.h"],
+ visibility = ["//:__subpackages__"],
+ deps = ["//include/core:SkRefCnt_hdr"],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_indirect_hdr",
+ hdrs = ["SkFontMgr_indirect.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ ":SkRemotableFontMgr_hdr",
+ "//include/core:SkFontMgr_hdr",
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkTypeface_hdr",
+ "//include/core:SkTypes_hdr",
+ "//include/private:SkMutex_hdr",
+ "//include/private:SkOnce_hdr",
+ "//include/private:SkTArray_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkFontMgr_mac_ct_hdr",
+ hdrs = ["SkFontMgr_mac_ct.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkImageGeneratorCG_hdr",
+ hdrs = ["SkImageGeneratorCG.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkData_hdr",
+ "//include/core:SkImageGenerator_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkImageGeneratorNDK_hdr",
+ hdrs = ["SkImageGeneratorNDK.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkData_hdr",
+ "//include/core:SkImageGenerator_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkImageGeneratorWIC_hdr",
+ hdrs = ["SkImageGeneratorWIC.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkData_hdr",
+ "//include/core:SkImageGenerator_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkRemotableFontMgr_hdr",
+ hdrs = ["SkRemotableFontMgr.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkFontStyle_hdr",
+ "//include/core:SkRefCnt_hdr",
+ "//include/core:SkTypes_hdr",
+ "//include/private:SkTemplates_hdr",
+ ],
+)
+
+generated_cc_atom(
+ name = "SkTypeface_mac_hdr",
+ hdrs = ["SkTypeface_mac.h"],
+ visibility = ["//:__subpackages__"],
+ deps = ["//include/core:SkTypeface_hdr"],
+)
+
+generated_cc_atom(
+ name = "SkTypeface_win_hdr",
+ hdrs = ["SkTypeface_win.h"],
+ visibility = ["//:__subpackages__"],
+ deps = [
+ "//include/core:SkTypeface_hdr",
+ "//include/core:SkTypes_hdr",
+ ],
+)
diff --git a/src/deps/skia/include/ports/SkCFObject.h b/src/deps/skia/include/ports/SkCFObject.h
new file mode 100644
index 000000000..4dc70863f
--- /dev/null
+++ b/src/deps/skia/include/ports/SkCFObject.h
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2019 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkCFObject_DEFINED
+#define SkCFObject_DEFINED
+
+#ifdef __APPLE__
+
+#include "include/core/SkTypes.h"
+
+#include <cstddef> // std::nullptr_t
+
+#import <CoreFoundation/CoreFoundation.h>
+
+/**
+ * Wrapper class for managing lifetime of CoreFoundation objects. It will call
+ * CFRetain and CFRelease appropriately on creation, assignment, and deletion.
+ * Based on sk_sp<>.
+ */
+template <typename T> static inline T SkCFSafeRetain(T obj) {
+ if (obj) {
+ CFRetain(obj);
+ }
+ return obj;
+}
+
+template <typename T> static inline void SkCFSafeRelease(T obj) {
+ if (obj) {
+ CFRelease(obj);
+ }
+}
+
+template <typename T> class sk_cfp {
+public:
+ using element_type = T;
+
+ constexpr sk_cfp() {}
+ constexpr sk_cfp(std::nullptr_t) {}
+
+ /**
+ * Shares the underlying object by calling CFRetain(), so that both the argument and the newly
+ * created sk_cfp both have a reference to it.
+ */
+ sk_cfp(const sk_cfp<T>& that) : fObject(SkCFSafeRetain(that.get())) {}
+
+ /**
+ * Move the underlying object from the argument to the newly created sk_cfp. Afterwards only
+ * the new sk_cfp will have a reference to the object, and the argument will point to null.
+ * No call to CFRetain() or CFRelease() will be made.
+ */
+ sk_cfp(sk_cfp<T>&& that) : fObject(that.release()) {}
+
+ /**
+ * Adopt the bare object into the newly created sk_cfp.
+ * No call to CFRetain() or CFRelease() will be made.
+ */
+ explicit sk_cfp(T obj) {
+ fObject = obj;
+ }
+
+ /**
+ * Calls CFRelease() on the underlying object pointer.
+ */
+ ~sk_cfp() {
+ SkCFSafeRelease(fObject);
+ SkDEBUGCODE(fObject = nil);
+ }
+
+ sk_cfp<T>& operator=(std::nullptr_t) { this->reset(); return *this; }
+
+ /**
+ * Shares the underlying object referenced by the argument by calling CFRetain() on it. If this
+ * sk_cfp previously had a reference to an object (i.e. not null) it will call CFRelease()
+ * on that object.
+ */
+ sk_cfp<T>& operator=(const sk_cfp<T>& that) {
+ if (this != &that) {
+ this->reset(SkCFSafeRetain(that.get()));
+ }
+ return *this;
+ }
+
+ /**
+ * Move the underlying object from the argument to the sk_cfp. If the sk_cfp
+ * previously held a reference to another object, CFRelease() will be called on that object.
+ * No call to CFRetain() will be made.
+ */
+ sk_cfp<T>& operator=(sk_cfp<T>&& that) {
+ this->reset(that.release());
+ return *this;
+ }
+
+ explicit operator bool() const { return this->get() != nil; }
+
+ T get() const { return fObject; }
+ T operator*() const {
+ SkASSERT(fObject);
+ return fObject;
+ }
+
+ /**
+ * Adopt the new object, and call CFRelease() on any previously held object (if not null).
+ * No call to CFRetain() will be made.
+ */
+ void reset(T object = nil) {
+ // Need to unref after assigning, see
+ // http://wg21.cmeerw.net/lwg/issue998
+ // http://wg21.cmeerw.net/lwg/issue2262
+ T oldObject = fObject;
+ fObject = object;
+ SkCFSafeRelease(oldObject);
+ }
+
+ /**
+ * Shares the new object by calling CFRetain() on it. If this sk_cfp previously had a
+ * reference to an object (i.e. not null) it will call CFRelease() on that object.
+ */
+ void retain(T object) {
+ if (fObject != object) {
+ this->reset(SkCFSafeRetain(object));
+ }
+ }
+
+ /**
+ * Return the original object, and set the internal object to nullptr.
+ * The caller must assume ownership of the object, and manage its reference count directly.
+ * No call to CFRelease() will be made.
+ */
+ T SK_WARN_UNUSED_RESULT release() {
+ T obj = fObject;
+ fObject = nil;
+ return obj;
+ }
+
+private:
+ T fObject = nil;
+};
+
+template <typename T> inline bool operator==(const sk_cfp<T>& a,
+ const sk_cfp<T>& b) {
+ return a.get() == b.get();
+}
+template <typename T> inline bool operator==(const sk_cfp<T>& a,
+ std::nullptr_t) {
+ return !a;
+}
+template <typename T> inline bool operator==(std::nullptr_t,
+ const sk_cfp<T>& b) {
+ return !b;
+}
+
+template <typename T> inline bool operator!=(const sk_cfp<T>& a,
+ const sk_cfp<T>& b) {
+ return a.get() != b.get();
+}
+template <typename T> inline bool operator!=(const sk_cfp<T>& a,
+ std::nullptr_t) {
+ return static_cast<bool>(a);
+}
+template <typename T> inline bool operator!=(std::nullptr_t,
+ const sk_cfp<T>& b) {
+ return static_cast<bool>(b);
+}
+
+/*
+ * Returns a sk_cfp wrapping the provided object AND calls retain on it (if not null).
+ *
+ * This is different than the semantics of the constructor for sk_cfp, which just wraps the
+ * object, effectively "adopting" it.
+ */
+template <typename T> sk_cfp<T> sk_ret_cfp(T obj) {
+ return sk_cfp<T>(SkCFSafeRetain(obj));
+}
+
+// For Flutter.
+// TODO: migrate them away from this and remove
+template <typename T> using sk_cf_obj = sk_cfp<T>;
+
+#endif // __APPLE__
+#endif // SkCFObject_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontConfigInterface.h b/src/deps/skia/include/ports/SkFontConfigInterface.h
new file mode 100644
index 000000000..65fd61259
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontConfigInterface.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontConfigInterface_DEFINED
+#define SkFontConfigInterface_DEFINED
+
+#include "include/core/SkFontStyle.h"
+#include "include/core/SkRefCnt.h"
+#include "include/core/SkStream.h"
+#include "include/core/SkTypeface.h"
+
+class SkFontMgr;
+
+/**
+ * \class SkFontConfigInterface
+ *
+ * A simple interface for remotable font management.
+ * The global instance can be found with RefGlobal().
+ */
+class SK_API SkFontConfigInterface : public SkRefCnt {
+public:
+
+ /**
+ * 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 sk_sp<SkFontConfigInterface> RefGlobal();
+
+ /**
+ * Replace the current global instance with the specified one.
+ */
+ static void SetGlobal(sk_sp<SkFontConfigInterface> fc);
+
+ /**
+ * This should be treated as private to the impl of SkFontConfigInterface.
+ * Callers should not change or expect any particular values. It is meant
+ * to be a union of possible storage types to aid the impl.
+ */
+ struct FontIdentity {
+ FontIdentity() : fID(0), fTTCIndex(0) {}
+
+ bool operator==(const FontIdentity& other) const {
+ return fID == other.fID &&
+ fTTCIndex == other.fTTCIndex &&
+ fString == other.fString;
+ }
+ bool operator!=(const FontIdentity& other) const {
+ return !(*this == other);
+ }
+
+ uint32_t fID;
+ int32_t fTTCIndex;
+ SkString fString;
+ SkFontStyle fStyle;
+
+ // If buffer is NULL, just return the number of bytes that would have
+ // been written. Will pad contents to a multiple of 4.
+ size_t writeToMemory(void* buffer = nullptr) const;
+
+ // Recreate from a flattened buffer, returning the number of bytes read.
+ size_t readFromMemory(const void* buffer, size_t length);
+ };
+
+ /**
+ * Given a familyName and style, find the best match.
+ *
+ * If a match is found, return true and set its outFontIdentifier.
+ * If outFamilyName is not null, assign the found familyName to it
+ * (which may differ from the requested familyName).
+ * If outStyle is not null, assign the found style to it
+ * (which may differ from the requested style).
+ *
+ * If a match is not found, return false, and ignore all out parameters.
+ */
+ virtual bool matchFamilyName(const char familyName[],
+ SkFontStyle requested,
+ FontIdentity* outFontIdentifier,
+ SkString* outFamilyName,
+ SkFontStyle* outStyle) = 0;
+
+ /**
+ * Given a FontRef, open a stream to access its data, or return null
+ * if the FontRef's data is not available. The caller is responsible for
+ * deleting the stream when it is done accessing the data.
+ */
+ virtual SkStreamAsset* openStream(const FontIdentity&) = 0;
+
+ /**
+ * Return an SkTypeface for the given FontIdentity.
+ *
+ * The default implementation simply returns a new typeface built using data obtained from
+ * openStream(), but derived classes may implement more complex caching schemes.
+ */
+ virtual sk_sp<SkTypeface> makeTypeface(const FontIdentity& identity) {
+ return SkTypeface::MakeFromStream(std::unique_ptr<SkStreamAsset>(this->openStream(identity)),
+ identity.fTTCIndex);
+
+ }
+
+ /**
+ * Return a singleton instance of a direct subclass that calls into
+ * libfontconfig. This does not affect the refcnt of the returned instance.
+ */
+ static SkFontConfigInterface* GetSingletonDirectInterface();
+
+ using INHERITED = SkRefCnt;
+};
+
+#endif
diff --git a/src/deps/skia/include/ports/SkFontMgr_FontConfigInterface.h b/src/deps/skia/include/ports/SkFontMgr_FontConfigInterface.h
new file mode 100644
index 000000000..05771257d
--- /dev/null
+++ b/src/deps/skia/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 "include/core/SkRefCnt.h"
+#include "include/core/SkTypes.h"
+
+class SkFontMgr;
+class SkFontConfigInterface;
+
+/** Creates a SkFontMgr which wraps a SkFontConfigInterface. */
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci);
+
+#endif // #ifndef SkFontMgr_FontConfigInterface_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontMgr_android.h b/src/deps/skia/include/ports/SkFontMgr_android.h
new file mode 100644
index 000000000..d68f3ba03
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_android.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_android_DEFINED
+#define SkFontMgr_android_DEFINED
+
+#include "include/core/SkRefCnt.h"
+
+class SkFontMgr;
+
+struct SkFontMgr_Android_CustomFonts {
+ /** When specifying custom fonts, indicates how to use system fonts. */
+ enum SystemFontUse {
+ kOnlyCustom, /** Use only custom fonts. NDK compliant. */
+ kPreferCustom, /** Use custom fonts before system fonts. */
+ kPreferSystem /** Use system fonts before custom fonts. */
+ };
+ /** Whether or not to use system fonts. */
+ SystemFontUse fSystemFontUse;
+
+ /** Base path to resolve relative font file names. If a directory, should end with '/'. */
+ const char* fBasePath;
+
+ /** Optional custom configuration file to use. */
+ const char* fFontsXml;
+
+ /** Optional custom configuration file for fonts which provide fallback.
+ * In the new style (version > 21) fontsXml format is used, this should be NULL.
+ */
+ const char* fFallbackFontsXml;
+
+ /** Optional custom flag. If set to true the SkFontMgr will acquire all requisite
+ * system IO resources on initialization.
+ */
+ bool fIsolated;
+};
+
+/** Create a font manager for Android. If 'custom' is NULL, use only system fonts. */
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom);
+
+#endif // SkFontMgr_android_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontMgr_directory.h b/src/deps/skia/include/ports/SkFontMgr_directory.h
new file mode 100644
index 000000000..b1a60fb4d
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_directory.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_directory_DEFINED
+#define SkFontMgr_directory_DEFINED
+
+#include "include/core/SkRefCnt.h"
+#include "include/core/SkTypes.h"
+
+class SkFontMgr;
+
+/** Create a custom font manager which scans a given directory for font files.
+ * This font manager uses FreeType for rendering.
+ */
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Directory(const char* dir);
+
+#endif // SkFontMgr_directory_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontMgr_empty.h b/src/deps/skia/include/ports/SkFontMgr_empty.h
new file mode 100644
index 000000000..e5756421d
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_empty.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_empty_DEFINED
+#define SkFontMgr_empty_DEFINED
+
+#include "include/core/SkRefCnt.h"
+#include "include/core/SkTypes.h"
+
+class SkFontMgr;
+
+/** Create a custom font manager that contains no built-in fonts.
+ * This font manager uses FreeType for rendering.
+ */
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Empty();
+
+#endif // SkFontMgr_empty_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontMgr_fontconfig.h b/src/deps/skia/include/ports/SkFontMgr_fontconfig.h
new file mode 100644
index 000000000..4b2bb2d29
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_fontconfig.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_fontconfig_DEFINED
+#define SkFontMgr_fontconfig_DEFINED
+
+#include "include/core/SkRefCnt.h"
+#include <fontconfig/fontconfig.h>
+
+class SkFontMgr;
+
+/** Create a font manager around a FontConfig instance.
+ * If 'fc' is NULL, will use a new default config.
+ * Takes ownership of 'fc' and will call FcConfigDestroy on it.
+ */
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
+
+#endif // #ifndef SkFontMgr_fontconfig_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontMgr_fuchsia.h b/src/deps/skia/include/ports/SkFontMgr_fuchsia.h
new file mode 100644
index 000000000..d20530af7
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_fuchsia.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_fuchsia_DEFINED
+#define SkFontMgr_fuchsia_DEFINED
+
+#include <fuchsia/fonts/cpp/fidl.h>
+
+#include "include/core/SkRefCnt.h"
+
+class SkFontMgr;
+
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider);
+
+#endif // SkFontMgr_fuchsia_DEFINED
diff --git a/src/deps/skia/include/ports/SkFontMgr_indirect.h b/src/deps/skia/include/ports/SkFontMgr_indirect.h
new file mode 100644
index 000000000..73210bc9a
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_indirect.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_indirect_DEFINED
+#define SkFontMgr_indirect_DEFINED
+
+#include "include/core/SkFontMgr.h"
+#include "include/core/SkRefCnt.h"
+#include "include/core/SkTypeface.h"
+#include "include/core/SkTypes.h"
+#include "include/ports/SkRemotableFontMgr.h"
+#include "include/private/SkMutex.h"
+#include "include/private/SkOnce.h"
+#include "include/private/SkTArray.h"
+
+class SkData;
+class SkFontStyle;
+class SkStreamAsset;
+class SkString;
+
+class SK_API SkFontMgr_Indirect : public SkFontMgr {
+public:
+ // TODO: The SkFontMgr is only used for createFromStream/File/Data.
+ // In the future these calls should be broken out into their own interface
+ // with a name like SkFontRenderer.
+ SkFontMgr_Indirect(sk_sp<SkFontMgr> impl, sk_sp<SkRemotableFontMgr> proxy)
+ : fImpl(std::move(impl)), fProxy(std::move(proxy))
+ { }
+
+protected:
+ int onCountFamilies() const override;
+ void onGetFamilyName(int index, SkString* familyName) const override;
+ SkFontStyleSet* onCreateStyleSet(int index) const override;
+
+ SkFontStyleSet* onMatchFamily(const char familyName[]) const override;
+
+ SkTypeface* onMatchFamilyStyle(const char familyName[],
+ const SkFontStyle& fontStyle) const override;
+
+ SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
+ const SkFontStyle&,
+ const char* bcp47[],
+ int bcp47Count,
+ SkUnichar character) const override;
+
+ sk_sp<SkTypeface> onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset>, int ttcIndex) const override;
+ sk_sp<SkTypeface> onMakeFromStreamArgs(std::unique_ptr<SkStreamAsset> stream,
+ const SkFontArguments& args) const override;
+ sk_sp<SkTypeface> onMakeFromFile(const char path[], int ttcIndex) const override;
+ sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData>, int ttcIndex) const override;
+ sk_sp<SkTypeface> onLegacyMakeTypeface(const char familyName[], SkFontStyle) const override;
+
+private:
+ SkTypeface* createTypefaceFromFontId(const SkFontIdentity& fontId) const;
+
+ sk_sp<SkFontMgr> fImpl;
+ sk_sp<SkRemotableFontMgr> fProxy;
+
+ struct DataEntry {
+ uint32_t fDataId; // key1
+ uint32_t fTtcIndex; // key2
+ SkTypeface* fTypeface; // value: weak ref to typeface
+
+ DataEntry() = default;
+
+ DataEntry(DataEntry&& that) { *this = std::move(that); }
+ DataEntry& operator=(DataEntry&& that) {
+ if (this != &that) {
+ fDataId = that.fDataId;
+ fTtcIndex = that.fTtcIndex;
+ fTypeface = that.fTypeface;
+
+ SkDEBUGCODE(that.fDataId = SkFontIdentity::kInvalidDataId;)
+ SkDEBUGCODE(that.fTtcIndex = 0xbbadbeef;)
+ that.fTypeface = nullptr;
+ }
+ return *this;
+ }
+
+ ~DataEntry() {
+ if (fTypeface) {
+ fTypeface->weak_unref();
+ }
+ }
+ };
+ /**
+ * This cache is essentially { dataId: { ttcIndex: typeface } }
+ * For data caching we want a mapping from data id to weak references to
+ * typefaces with that data id. By storing the index next to the typeface,
+ * this data cache also acts as a typeface cache.
+ */
+ mutable SkTArray<DataEntry> fDataCache;
+ mutable SkMutex fDataCacheMutex;
+
+ friend class SkStyleSet_Indirect;
+};
+
+#endif
diff --git a/src/deps/skia/include/ports/SkFontMgr_mac_ct.h b/src/deps/skia/include/ports/SkFontMgr_mac_ct.h
new file mode 100644
index 000000000..45cba65b5
--- /dev/null
+++ b/src/deps/skia/include/ports/SkFontMgr_mac_ct.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkFontMgr_mac_ct_DEFINED
+#define SkFontMgr_mac_ct_DEFINED
+
+#include "include/core/SkRefCnt.h"
+#include "include/core/SkTypes.h"
+
+#ifdef SK_BUILD_FOR_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
+
+#ifdef SK_BUILD_FOR_IOS
+#include <CoreText/CoreText.h>
+#endif
+
+class SkFontMgr;
+
+/** Create a font manager for CoreText. If the collection is nullptr the system default will be used. */
+SK_API extern sk_sp<SkFontMgr> SkFontMgr_New_CoreText(CTFontCollectionRef);
+
+#endif // SkFontMgr_mac_ct_DEFINED
diff --git a/src/deps/skia/include/ports/SkImageGeneratorCG.h b/src/deps/skia/include/ports/SkImageGeneratorCG.h
new file mode 100644
index 000000000..93592cde4
--- /dev/null
+++ b/src/deps/skia/include/ports/SkImageGeneratorCG.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.
+ */
+
+#include "include/core/SkTypes.h"
+#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+
+#include "include/core/SkData.h"
+#include "include/core/SkImageGenerator.h"
+
+#include <memory>
+
+namespace SkImageGeneratorCG {
+SK_API std::unique_ptr<SkImageGenerator> MakeFromEncodedCG(sk_sp<SkData>);
+} // namespace SkImageGeneratorCG
+
+#endif //defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
diff --git a/src/deps/skia/include/ports/SkImageGeneratorNDK.h b/src/deps/skia/include/ports/SkImageGeneratorNDK.h
new file mode 100644
index 000000000..739a586f0
--- /dev/null
+++ b/src/deps/skia/include/ports/SkImageGeneratorNDK.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkImageGeneratorNDK_DEFINED
+#define SkImageGeneratorNDK_DEFINED
+
+#include "include/core/SkTypes.h"
+#ifdef SK_ENABLE_NDK_IMAGES
+
+#include "include/core/SkData.h"
+#include "include/core/SkImageGenerator.h"
+
+#include <memory>
+
+namespace SkImageGeneratorNDK {
+/**
+ * Create a generator that uses the Android NDK's APIs for decoding images.
+ *
+ * Only supported on devices where __ANDROID_API__ >= 30.
+ *
+ * As with SkCodec, the SkColorSpace passed to getPixels() determines the
+ * type of color space transformations to apply. A null SkColorSpace means to
+ * apply none.
+ *
+ * A note on scaling: Calling getPixels() on the resulting SkImageGenerator
+ * with dimensions that do not match getInfo() requests a scale. For WebP
+ * files, dimensions smaller than those of getInfo are supported. For Jpeg
+ * files, dimensions of 1/2, 1/4, and 1/8 are supported. TODO: Provide an
+ * API like SkCodecImageGenerator::getScaledDimensions() to report which
+ * dimensions are supported?
+ */
+SK_API std::unique_ptr<SkImageGenerator> MakeFromEncodedNDK(sk_sp<SkData>);
+}
+
+#endif // SK_ENABLE_NDK_IMAGES
+#endif // SkImageGeneratorNDK_DEFINED
diff --git a/src/deps/skia/include/ports/SkImageGeneratorWIC.h b/src/deps/skia/include/ports/SkImageGeneratorWIC.h
new file mode 100644
index 000000000..eb57a2095
--- /dev/null
+++ b/src/deps/skia/include/ports/SkImageGeneratorWIC.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "include/core/SkTypes.h"
+
+#if defined(SK_BUILD_FOR_WIN)
+
+#include "include/core/SkData.h"
+#include "include/core/SkImageGenerator.h"
+
+#include <memory>
+
+/*
+ * Any Windows program that uses COM must initialize the COM library by calling
+ * the CoInitializeEx function. In addition, each thread that uses a COM
+ * interface must make a separate call to this function.
+ *
+ * For every successful call to CoInitializeEx, the thread must call
+ * CoUninitialize before it exits.
+ *
+ * SkImageGeneratorWIC requires the COM library and leaves it to the client to
+ * initialize COM for their application.
+ *
+ * For more information on initializing COM, please see:
+ * https://msdn.microsoft.com/en-us/library/windows/desktop/ff485844.aspx
+ */
+namespace SkImageGeneratorWIC {
+SK_API std::unique_ptr<SkImageGenerator> MakeFromEncodedWIC(sk_sp<SkData>);
+}
+
+#endif // SK_BUILD_FOR_WIN
diff --git a/src/deps/skia/include/ports/SkRemotableFontMgr.h b/src/deps/skia/include/ports/SkRemotableFontMgr.h
new file mode 100644
index 000000000..8017b77cd
--- /dev/null
+++ b/src/deps/skia/include/ports/SkRemotableFontMgr.h
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkRemotableFontMgr_DEFINED
+#define SkRemotableFontMgr_DEFINED
+
+#include "include/core/SkFontStyle.h"
+#include "include/core/SkRefCnt.h"
+#include "include/core/SkTypes.h"
+#include "include/private/SkTemplates.h"
+
+class SkDataTable;
+class SkStreamAsset;
+
+struct SK_API SkFontIdentity {
+ static const uint32_t kInvalidDataId = 0xFFFFFFFF;
+
+ // Note that fDataId is a data identifier, not a font identifier.
+ // (fDataID, fTtcIndex) can be seen as a font identifier.
+ uint32_t fDataId;
+ uint32_t fTtcIndex;
+
+ // On Linux/FontConfig there is also the ability to specify preferences for rendering
+ // antialias, embedded bitmaps, autohint, hinting, hintstyle, lcd rendering
+ // may all be set or set to no-preference
+ // (No-preference is resolved against globals set by the platform)
+ // Since they may be selected against, these are really 'extensions' to SkFontStyle.
+ // SkFontStyle should pick these up.
+ SkFontStyle fFontStyle;
+};
+
+class SK_API SkRemotableFontIdentitySet : public SkRefCnt {
+public:
+ SkRemotableFontIdentitySet(int count, SkFontIdentity** data);
+
+ int count() const { return fCount; }
+ const SkFontIdentity& at(int index) const { return fData[index]; }
+
+ static SkRemotableFontIdentitySet* NewEmpty();
+
+private:
+ SkRemotableFontIdentitySet() : fCount(0), fData() { }
+
+ friend SkRemotableFontIdentitySet* sk_remotable_font_identity_set_new();
+
+ int fCount;
+ SkAutoTArray<SkFontIdentity> fData;
+
+ using INHERITED = SkRefCnt;
+};
+
+class SK_API SkRemotableFontMgr : public SkRefCnt {
+public:
+ /**
+ * Returns all of the fonts with the given familyIndex.
+ * Returns NULL if the index is out of bounds.
+ * Returns empty if there are no fonts at the given index.
+ *
+ * The caller must unref() the returned object.
+ */
+ virtual SkRemotableFontIdentitySet* getIndex(int familyIndex) const = 0;
+
+ /**
+ * Returns the closest match to the given style in the given index.
+ * If there are no available fonts at the given index, the return value's
+ * data id will be kInvalidDataId.
+ */
+ virtual SkFontIdentity matchIndexStyle(int familyIndex, const SkFontStyle&) const = 0;
+
+ /**
+ * Returns all the fonts on the system with the given name.
+ * If the given name is NULL, will return the default font family.
+ * Never returns NULL; will return an empty set if the name is not found.
+ *
+ * It is possible that this will return fonts not accessible from
+ * getIndex(int) or matchIndexStyle(int, SkFontStyle) due to
+ * hidden or auto-activated fonts.
+ *
+ * The matching may be done in a system dependent way. The name may be
+ * matched case-insensitive, there may be system aliases which resolve,
+ * and names outside the current locale may be considered. However, this
+ * should only return fonts which are somehow associated with the requested
+ * name.
+ *
+ * The caller must unref() the returned object.
+ */
+ virtual SkRemotableFontIdentitySet* matchName(const char familyName[]) const = 0;
+
+ /**
+ * Returns the closest matching font to the specified name and style.
+ * If there are no available fonts which match the name, the return value's
+ * data id will be kInvalidDataId.
+ * If the given name is NULL, the match will be against any default fonts.
+ *
+ * It is possible that this will return a font identity not accessible from
+ * methods returning sets due to hidden or auto-activated fonts.
+ *
+ * The matching may be done in a system dependent way. The name may be
+ * matched case-insensitive, there may be system aliases which resolve,
+ * and names outside the current locale may be considered. However, this
+ * should only return a font which is somehow associated with the requested
+ * name.
+ *
+ * The caller must unref() the returned object.
+ */
+ virtual SkFontIdentity matchNameStyle(const char familyName[], const SkFontStyle&) const = 0;
+
+ /**
+ * Use the system fall-back to find a font for the given character.
+ * If no font can be found for the character, the return value's data id
+ * will be kInvalidDataId.
+ * If the name is NULL, the match will start against any default fonts.
+ * If the bpc47 is NULL, a default locale will be assumed.
+ *
+ * Note that bpc47 is a combination of ISO 639, 15924, and 3166-1 codes,
+ * so it is fine to just pass a ISO 639 here.
+ */
+ virtual SkFontIdentity matchNameStyleCharacter(const char familyName[], const SkFontStyle&,
+ const char* bcp47[], int bcp47Count,
+ SkUnichar character) const=0;
+
+ /**
+ * Returns the data for the given data id.
+ * Will return NULL if the data id is invalid.
+ * Note that this is a data id, not a font id.
+ *
+ * The caller must unref() the returned object.
+ */
+ virtual SkStreamAsset* getData(int dataId) const = 0;
+
+private:
+ using INHERITED = SkRefCnt;
+};
+
+#endif
diff --git a/src/deps/skia/include/ports/SkTypeface_mac.h b/src/deps/skia/include/ports/SkTypeface_mac.h
new file mode 100644
index 000000000..ec68e0549
--- /dev/null
+++ b/src/deps/skia/include/ports/SkTypeface_mac.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkTypeface_mac_DEFINED
+#define SkTypeface_mac_DEFINED
+
+#include "include/core/SkTypeface.h"
+
+#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#ifdef SK_BUILD_FOR_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
+
+#ifdef SK_BUILD_FOR_IOS
+#include <CoreText/CoreText.h>
+#endif
+
+/**
+ * Like the other Typeface make methods, this returns a new reference to the
+ * corresponding typeface for the specified CTFontRef.
+ */
+SK_API extern sk_sp<SkTypeface> SkMakeTypefaceFromCTFont(CTFontRef);
+
+/**
+ * Returns the platform-specific CTFontRef handle for a
+ * given SkTypeface. Note that the returned CTFontRef gets
+ * released when the source SkTypeface is destroyed.
+ *
+ * This method is deprecated. It may only be used by Blink Mac
+ * legacy code in special cases related to text-shaping
+ * with AAT fonts, clipboard handling and font fallback.
+ * See https://code.google.com/p/skia/issues/detail?id=3408
+ */
+SK_API extern CTFontRef SkTypeface_GetCTFontRef(const SkTypeface* face);
+
+#endif // defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+#endif // SkTypeface_mac_DEFINED
diff --git a/src/deps/skia/include/ports/SkTypeface_win.h b/src/deps/skia/include/ports/SkTypeface_win.h
new file mode 100644
index 000000000..f659adf0e
--- /dev/null
+++ b/src/deps/skia/include/ports/SkTypeface_win.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkTypeface_win_DEFINED
+#define SkTypeface_win_DEFINED
+
+#include "include/core/SkTypeface.h"
+#include "include/core/SkTypes.h"
+
+#ifdef SK_BUILD_FOR_WIN
+
+#ifdef UNICODE
+typedef struct tagLOGFONTW LOGFONTW;
+typedef LOGFONTW LOGFONT;
+#else
+typedef struct tagLOGFONTA LOGFONTA;
+typedef LOGFONTA LOGFONT;
+#endif // UNICODE
+
+/**
+ * Like the other Typeface create methods, this returns a new reference to the
+ * corresponding typeface for the specified logfont. The caller is responsible
+ * for calling unref() when it is finished.
+ */
+SK_API SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT&);
+
+/**
+ * Copy the LOGFONT associated with this typeface into the lf parameter. Note
+ * that the lfHeight will need to be set afterwards, since the typeface does
+ * not track this (the paint does).
+ * typeface may be NULL, in which case we return the logfont for the default font.
+ */
+SK_API void SkLOGFONTFromTypeface(const SkTypeface* typeface, LOGFONT* lf);
+
+/**
+ * Set an optional callback to ensure that the data behind a LOGFONT is loaded.
+ * This will get called if Skia tries to access the data but hits a failure.
+ * Normally this is null, and is only required if the font data needs to be
+ * remotely (re)loaded.
+ */
+SK_API void SkTypeface_SetEnsureLOGFONTAccessibleProc(void (*)(const LOGFONT&));
+
+// Experimental!
+//
+class SkFontMgr;
+class SkRemotableFontMgr;
+struct IDWriteFactory;
+struct IDWriteFontCollection;
+struct IDWriteFontFallback;
+
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_GDI();
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory = NULL,
+ IDWriteFontCollection* collection = NULL);
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
+ IDWriteFontCollection* collection,
+ IDWriteFontFallback* fallback);
+
+/**
+ * Creates an SkFontMgr which renders using DirectWrite and obtains its data
+ * from the SkRemotableFontMgr.
+ *
+ * If DirectWrite could not be initialized, will return NULL.
+ */
+SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontMgr>);
+
+/**
+ * Creates an SkRemotableFontMgr backed by DirectWrite using the default
+ * system font collection in the current locale.
+ *
+ * If DirectWrite could not be initialized, will return NULL.
+ */
+SK_API sk_sp<SkRemotableFontMgr> SkRemotableFontMgr_New_DirectWrite();
+
+#endif // SK_BUILD_FOR_WIN
+#endif // SkTypeface_win_DEFINED