diff options
author | Mike Reed <reed@google.com> | 2017-12-08 13:20:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-08 18:50:41 +0000 |
commit | 8e74cbcd6526a7542b9f704b9e40b0c60d475849 (patch) | |
tree | 51645e15627bef1e33965c9b9626acf31dbf8610 /include/core | |
parent | eace8cd22a65b1a47efc100639851f77a50f69b3 (diff) |
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 <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkTextBlob.h | 6 |
1 files changed, 6 insertions, 0 deletions
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<SkTypeface> (*SkTypefaceResolverProc)(uint32_t id, void* ctx); @@ -71,6 +74,9 @@ public: static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size, SkTypefaceResolverProc, void* ctx); + sk_sp<SkData> serialize(const SkSerialProcs&) const; + static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size, const SkDeserialProcs&); + private: friend class SkNVRefCnt<SkTextBlob>; class RunRecord; |