flatten/unflatten fSegmentMask

git-svn-id: http://skia.googlecode.com/svn/trunk@2300 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-09-21 18:40:27 +00:00
parent bc5cf51627
commit 98b11f1c21

View File

@ -1323,7 +1323,7 @@ void SkPath::flatten(SkWriter32& buffer) const {
buffer.write32(fPts.count());
buffer.write32(fVerbs.count());
buffer.write32(fFillType);
buffer.write32((fFillType << 8) | fSegmentMask);
buffer.writeMul4(fPts.begin(), sizeof(SkPoint) * fPts.count());
buffer.writePad(fVerbs.begin(), fVerbs.count());
}
@ -1331,7 +1331,9 @@ void SkPath::flatten(SkWriter32& buffer) const {
void SkPath::unflatten(SkReader32& buffer) {
fPts.setCount(buffer.readS32());
fVerbs.setCount(buffer.readS32());
fFillType = buffer.readS32();
uint32_t packed = buffer.readS32();
fFillType = packed >> 8;
fSegmentMask = packed & 0xFF;
buffer.read(fPts.begin(), sizeof(SkPoint) * fPts.count());
buffer.read(fVerbs.begin(), fVerbs.count());