From 8e74cbcd6526a7542b9f704b9e40b0c60d475849 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Fri, 8 Dec 2017 13:20:01 -0500 Subject: Revert "Revert "use serialprocs for typefaces"" This reverts commit 1a104bce20adc47a343fa910899ca6c4f261be40. Change (from first version) is - only signal error in readbuffer for corrupt stream, not default fonts - change test to ensure a non-null typeface (i.e. MakeDefault()) Bug: skia: Change-Id: I325445b56b0a402e1b89a2439df06e92314c793f Reviewed-on: https://skia-review.googlesource.com/82687 Reviewed-by: Mike Reed Commit-Queue: Mike Reed --- include/core/SkTextBlob.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/core') diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h index a87c9a3d2e..228747a1c8 100644 --- a/include/core/SkTextBlob.h +++ b/include/core/SkTextBlob.h @@ -17,6 +17,9 @@ class SkReadBuffer; class SkWriteBuffer; +struct SkSerialProcs; +struct SkDeserialProcs; + typedef void (*SkTypefaceCatalogerProc)(SkTypeface*, void* ctx); typedef sk_sp (*SkTypefaceResolverProc)(uint32_t id, void* ctx); @@ -71,6 +74,9 @@ public: static sk_sp Deserialize(const void* data, size_t size, SkTypefaceResolverProc, void* ctx); + sk_sp serialize(const SkSerialProcs&) const; + static sk_sp Deserialize(const void* data, size_t size, const SkDeserialProcs&); + private: friend class SkNVRefCnt; class RunRecord; -- cgit v1.2.3