aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-07-19 10:07:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-19 14:32:45 +0000
commit785586af7dc72c23d0ab30204ab2975a1451dc16 (patch)
tree73c0d824fd0e35baef10df90b9f55faba6ab08bb /include
parente70604ea8b5216621e50f7063edf7d56ee95498d (diff)
remove unused serialization in textblob
The SKTextBlob serialization code that is tested by Skia is unused by Chrome. The serialization code that is used by Chrome is untested by Skia. Remove the unused code; test the used code. The code path introduced nearly a year ago, likely for slimming paint, attempts to make text blobs smarter by allowing the reuse of typefaces. Maybe there needs to be a Chrome bug / feature request to use this? If if turns out there is no interest to do so, This CL aligns used interfaces with tests. R=reed@google.com,fmalita@google.com,bungeman@google.com Bug: skia:6818 Change-Id: I9b3ec0c326495322986ba26f20f901bcb208be73 Reviewed-on: https://skia-review.googlesource.com/141542 Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTextBlob.h22
1 files changed, 3 insertions, 19 deletions
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index 8dce082512..cf77a78ca5 100644
--- a/include/core/SkTextBlob.h
+++ b/include/core/SkTextBlob.h
@@ -17,9 +17,6 @@
struct SkSerialProcs;
struct SkDeserialProcs;
-typedef void (*SkTypefaceCatalogerProc)(SkTypeface*, void* ctx);
-typedef sk_sp<SkTypeface> (*SkTypefaceResolverProc)(uint32_t id, void* ctx);
-
/** \class SkTextBlob
SkTextBlob combines multiple text runs into an immutable, ref-counted structure.
@@ -46,28 +43,15 @@ public:
};
/**
- * Serialize the typeface into a data blob, storing type uniqueID of each referenced typeface.
- * During this process, each time a typeface is encountered, it is passed to the catalog,
- * allowing the caller to what typeface IDs will need to be resolved in Deserialize().
- */
- 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.
- */
- static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size,
- SkTypefaceResolverProc, void* ctx);
+ sk_sp<SkData> serialize(const SkSerialProcs& procs) const;
- sk_sp<SkData> serialize(const SkSerialProcs&) const;
- static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size, const SkDeserialProcs&);
+ static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size,
+ const SkDeserialProcs& procs);
private:
friend class SkNVRefCnt<SkTextBlob>;