Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: src/core/SkPath.cpp

Issue 1702393002: add last move to serialized path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPath.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index dcc3e0202dc0cf8e0c1e88532b290f7a07930a63..719c0330dc8f8d5c2ea728b366839b8617483513 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1965,7 +1965,7 @@ size_t SkPath::writeToMemory(void* storage) const {
SkDEBUGCODE(this->validate();)
if (nullptr == storage) {
- const int byteCount = sizeof(int32_t) + fPathRef->writeSize();
+ const int byteCount = sizeof(int32_t) * 2 + fPathRef->writeSize();
return SkAlign4(byteCount);
}
@@ -1978,6 +1978,7 @@ size_t SkPath::writeToMemory(void* storage) const {
kCurrent_Version;
buffer.write32(packed);
+ buffer.write32(fLastMoveToIndex);
fPathRef->writeToBuffer(&buffer);
@@ -1994,6 +1995,9 @@ size_t SkPath::readFromMemory(const void* storage, size_t length) {
}
unsigned version = packed & 0xFF;
+ if (version >= kPathPrivLastMoveToIndex_Version && !buffer.readS32(&fLastMoveToIndex)) {
+ return 0;
+ }
fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF;
fFillType = (packed >> kFillType_SerializationShift) & 0xFF;
« no previous file with comments | « include/core/SkPath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698