diff options
author | 2014-12-01 06:56:38 -0800 | |
---|---|---|
committer | 2014-12-01 06:56:38 -0800 | |
commit | 88fd0fbcccea615f2d2cd61a121ac9e3185adfe4 (patch) | |
tree | f0b13b3d4de8d110ce75f9f03e6cc18fb9aef744 /src/effects/gradients | |
parent | bb25e44593ff9c318d9fe1dbb5cf30bc2b89eb76 (diff) |
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
Diffstat (limited to 'src/effects/gradients')
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 9 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 7 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient.cpp | 27 |
3 files changed, 8 insertions, 35 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index a84c6fda25..d7b51440b3 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -209,11 +209,6 @@ static uint32_t unpack_flags(uint32_t packed) { } SkGradientShaderBase::SkGradientShaderBase(SkReadBuffer& buffer) : INHERITED(buffer) { - if (buffer.isVersionLT(SkReadBuffer::kNoUnitMappers_Version)) { - // skip the old SkUnitMapper slot - buffer.skipFlattenable(); - } - int colorCount = fColorCount = buffer.getArrayCount(); if (colorCount > kColorStorageCount) { size_t allocSize = (sizeof(SkColor) + sizeof(SkScalar) + sizeof(Rec)) * colorCount; @@ -318,10 +313,6 @@ void SkGradientShaderBase::FlipGradientColors(SkColor* colorDst, Rec* recDst, memcpy(colorDst, colorsTemp.get(), count * sizeof(SkColor)); } -void SkGradientShaderBase::flipGradientColors() { - FlipGradientColors(fOrigColors, fRecs, fOrigColors, fRecs, fColorCount); -} - bool SkGradientShaderBase::isOpaque() const { return fColorsAreOpaque; } diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index 2ec78e727d..ecc5e34fbe 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -102,7 +102,7 @@ public: class DescriptorScope : public Descriptor { public: DescriptorScope() {} - + bool unflatten(SkReadBuffer&); // fColors and fPos always point into local memory, so they can be safely mutated @@ -250,11 +250,6 @@ protected: SkColor* colorSrc, Rec* recSrc, int count); - // V23_COMPATIBILITY_CODE - // Used for 2-pt conical gradients since we sort start/end cirlces by radius - // Assumes space has already been allocated for fOrigColors - void flipGradientColors(); - private: enum { kColorStorageCount = 4, // more than this many colors, and we'll use sk_malloc for the space diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp index bb3b9b3715..5410f6a9df 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp @@ -346,27 +346,14 @@ SkShader::GradientType SkTwoPointConicalGradient::asAGradient( #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING SkTwoPointConicalGradient::SkTwoPointConicalGradient( SkReadBuffer& buffer) - : INHERITED(buffer), - fCenter1(buffer.readPoint()), - fCenter2(buffer.readPoint()), - fRadius1(buffer.readScalar()), - fRadius2(buffer.readScalar()) { - if (buffer.isVersionLT(SkReadBuffer::kGradientFlippedFlag_Version)) { - // V23_COMPATIBILITY_CODE - // Sort gradient by radius size for old pictures - if (fRadius2 < fRadius1) { - SkTSwap(fCenter1, fCenter2); - SkTSwap(fRadius1, fRadius2); - this->flipGradientColors(); - fFlippedGrad = true; - } else { - fFlippedGrad = false; - } - } else { - fFlippedGrad = buffer.readBool(); - } + : INHERITED(buffer) + , fCenter1(buffer.readPoint()) + , fCenter2(buffer.readPoint()) + , fRadius1(buffer.readScalar()) + , fRadius2(buffer.readScalar()) + , fFlippedGrad(buffer.readBool()) { this->init(); -}; +} #endif SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) { |