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

Unified Diff: src/effects/SkDashPathEffect.cpp

Issue 770703002: Bump min picture version. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO Created 6 years, 1 month 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 | « src/effects/SkBitmapSource.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/effects/SkBitmapSource.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698