aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkFlattenable.h2
-rw-r--r--include/core/SkTextBlob.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 05b8fba9a7..ed343c82ae 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -135,6 +135,8 @@ public:
// public ways to serialize / deserialize
//
sk_sp<SkData> serialize(const SkSerialProcs* = nullptr) const;
+ size_t serialize(void* memory, size_t memory_size,
+ const SkSerialProcs* = nullptr) const;
static sk_sp<SkFlattenable> Deserialize(Type, const void* data, size_t length,
const SkDeserialProcs* procs = nullptr);
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index 89c6697cc9..59151d3002 100644
--- a/include/core/SkTextBlob.h
+++ b/include/core/SkTextBlob.h
@@ -67,6 +67,12 @@ public:
sk_sp<SkData> serialize(SkTypefaceCatalogerProc, void* ctx) const;
/**
+ * Similar to serialize above, but writes directly into |memory|. Returns bytes written or 0u
+ * if serialization failed due to insufficient size.
+ */
+ size_t serialize(const SkSerialProcs& procs, void* memory, size_t memory_size) const;
+
+ /**
* Re-create a text blob previously serialized. Since the serialized form records the uniqueIDs
* of its typefaces, deserialization requires that the caller provide the corresponding
* SkTypefaces for those IDs.