Bump min picture version.
Chrome Stable is M39, which produces picture format v35:
https://chromium.googlesource.com/skia/+/chrome/m39/include/core/SkPicture.h
We don't need any code to deal with pictures older than v35.
(When M40 goes stable, we can step up to v37, the current latest version.)
BUG=skia:
Review URL: https://codereview.chromium.org/770703002
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp
index 412965e..f31d883 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -52,7 +52,7 @@
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 @@
, 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 @@
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