Index: src/ports/SkFontMgr_custom_embedded_factory.cpp |
diff --git a/src/ports/SkFontMgr_custom_embedded_factory.cpp b/src/ports/SkFontMgr_custom_embedded_factory.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6ea6a2d2af22cbdeaa51a6de58e8d70d00997c42 |
--- /dev/null |
+++ b/src/ports/SkFontMgr_custom_embedded_factory.cpp |
@@ -0,0 +1,17 @@ |
+/* |
+ * Copyright 2015 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#include "SkFontMgr.h" |
+ |
+struct SkEmbeddedResource { const uint8_t* data; size_t size; }; |
+struct SkEmbeddedResourceHeader { const SkEmbeddedResource* entries; int count; }; |
reed1
2015/06/15 20:05:00
How does this work, with struct definitions in a .
bungeman-skia
2015/06/15 20:39:39
It works the same way any function forward definit
|
+SkFontMgr* SkFontMgr_New_Custom_Embedded(const SkEmbeddedResourceHeader* header); |
+ |
+extern "C" const SkEmbeddedResourceHeader SK_EMBEDDED_FONTS; |
+SkFontMgr* SkFontMgr::Factory() { |
+ return SkFontMgr_New_Custom_Embedded(&SK_EMBEDDED_FONTS); |
+} |