SkDashPathEffect refuses to flatten itself if it thinks it's a no-op. This
messes with the assumption that flattening a non-NULL effect and then
unflattening from those bytes produces a non-NULL effect. I'd rather make that
assumption always be true than save a few bytes for rare nonsense path effects.
BUG=348821
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/
189643002
git-svn-id: http://skia.googlecode.com/svn/trunk@13701
2bbb7eff-a529-9590-31e7-
b0007b416f81
}
SkFlattenable::Factory SkDashPathEffect::getFactory() const {
- return fInitialDashLength < 0 ? NULL : CreateProc;
+ return CreateProc;
}
void SkDashPathEffect::flatten(SkWriteBuffer& buffer) const {
- SkASSERT(fInitialDashLength >= 0);
-
this->INHERITED::flatten(buffer);
buffer.writeInt(fInitialDashIndex);
buffer.writeScalar(fInitialDashLength);