diff options
author | Mike Reed <reed@google.com> | 2018-02-21 15:55:14 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-21 21:22:37 +0000 |
commit | 267ecccfed954079e9ec37182d6c9aafe3007525 (patch) | |
tree | 4a0fed781314707db9d75efc063330496652557e /include/core/SkPath.h | |
parent | 528b446889c7967d220d2a679912f698067ff072 (diff) |
change path serialization version to 4
New format should be much simpler:
- only store public data (e.g. points, verbs, filltype)
- deserialize just uses public APIs
Refactor reading code to manage different (older) versions, to make
it clear (hopefully) what we can delete when we can abandon version
3 support.
Bug: skia:
Change-Id: I30465f891cba3f044ae1cb2c13c04f04fdc9da78
Reviewed-on: https://skia-review.googlesource.com/109160
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core/SkPath.h')
-rw-r--r-- | include/core/SkPath.h | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 8e74a0b63e..f3d7953391 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -1617,28 +1617,6 @@ public: #endif private: - enum SerializationOffsets { - kType_SerializationShift = 28, // requires 4 bits - kDirection_SerializationShift = 26, // requires 2 bits, could be reused - ignored on read. - kIsVolatile_SerializationShift = 25, // requires 1 bit - // 1 free bit at 24 - kConvexity_SerializationShift = 16, // requires 8 bits, could be reused - ignored on read. - kFillType_SerializationShift = 8, // requires 8 bits - // low-8-bits are version - }; - - enum SerializationVersions { - // kPathPrivFirstDirection_Version = 1, - kPathPrivLastMoveToIndex_Version = 2, - kPathPrivTypeEnumVersion = 3, - kCurrent_Version = 3 - }; - - enum SerializationType { - kGeneral = 0, - kRRect = 1 - }; - sk_sp<SkPathRef> fPathRef; int fLastMoveToIndex; uint8_t fFillType; @@ -1658,8 +1636,10 @@ private: */ void copyFields(const SkPath& that); - size_t writeToMemoryAsRRect(int32_t packedHeader, void* buffer) const; - size_t readFromMemoryAsRRect(const void* buffer) const; + size_t writeToMemoryAsRRect(void* buffer) const; + size_t readAsRRect(const void*, size_t); + size_t readFromMemory_LE3(const void*, size_t); + size_t readFromMemory_EQ4(const void*, size_t); friend class Iter; friend class SkPathPriv; |