Index: src/effects/SkDashPathEffect.cpp |
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp |
index 412965e88356edb7da257046e3fea10995d9fda2..f31d883c8ec3d11f39f495ba86c7c36a688a0fa3 100644 |
--- a/src/effects/SkDashPathEffect.cpp |
+++ b/src/effects/SkDashPathEffect.cpp |
@@ -52,7 +52,7 @@ static void outset_for_stroke(SkRect* rect, const SkStrokeRec& rec) { |
rect->outset(radius, radius); |
} |
-// Attempt to trim the line to minimally cover the cull rect (currently |
+// Attempt to trim the line to minimally cover the cull rect (currently |
// only works for horizontal and vertical lines). |
// Return true if processing should continue; false otherwise. |
static bool cull_line(SkPoint* pts, const SkStrokeRec& rec, |
@@ -377,16 +377,7 @@ SkDashPathEffect::SkDashPathEffect(SkReadBuffer& buffer) |
, fInitialDashLength(0) |
, fInitialDashIndex(0) |
, fIntervalLength(0) { |
- bool useOldPic = buffer.isVersionLT(SkReadBuffer::kDashWritesPhaseIntervals_Version); |
- if (useOldPic) { |
- fInitialDashIndex = buffer.readInt(); |
- fInitialDashLength = buffer.readScalar(); |
- fIntervalLength = buffer.readScalar(); |
- buffer.readBool(); // Dummy for old ScalarToFit field |
- } else { |
- fPhase = buffer.readScalar(); |
- } |
- |
+ fPhase = buffer.readScalar(); |
fCount = buffer.getArrayCount(); |
size_t allocSize = sizeof(SkScalar) * fCount; |
if (buffer.validateAvailable(allocSize)) { |
@@ -396,20 +387,10 @@ SkDashPathEffect::SkDashPathEffect(SkReadBuffer& buffer) |
fIntervals = NULL; |
} |
- if (useOldPic) { |
- fPhase = 0; |
- if (fInitialDashLength != -1) { // Signal for bad dash interval |
- for (int i = 0; i < fInitialDashIndex; ++i) { |
- fPhase += fIntervals[i]; |
- } |
- fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength; |
- } |
- } else { |
- // set the internal data members, fPhase should have been between 0 and intervalLength |
- // when written to buffer so no need to adjust it |
- SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount, |
- &fInitialDashLength, &fInitialDashIndex, &fIntervalLength); |
- } |
+ // set the internal data members, fPhase should have been between 0 and intervalLength |
+ // when written to buffer so no need to adjust it |
+ SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount, |
+ &fInitialDashLength, &fInitialDashIndex, &fIntervalLength); |
} |
#endif |