diff options
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 4 | ||||
-rw-r--r-- | src/effects/gradients/SkLinearGradient.cpp | 6 | ||||
-rw-r--r-- | src/effects/gradients/SkLinearGradient.h | 3 | ||||
-rw-r--r-- | src/effects/gradients/SkRadialGradient.cpp | 4 | ||||
-rw-r--r-- | src/effects/gradients/SkRadialGradient.h | 3 | ||||
-rw-r--r-- | src/effects/gradients/SkSweepGradient.cpp | 4 | ||||
-rw-r--r-- | src/effects/gradients/SkSweepGradient.h | 3 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient.cpp | 4 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient.h | 4 |
9 files changed, 20 insertions, 15 deletions
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index a32d8ac2bb..ed7340ca3a 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -434,8 +434,8 @@ SkShader::Context* SkPerlinNoiseShader::onCreateContext(const ContextRec& rec, return new (storage) PerlinNoiseShaderContext(*this, rec); } -size_t SkPerlinNoiseShader::onContextSize(const ContextRec&) const { - return SkAlign16(sizeof(PerlinNoiseShaderContext)); +size_t SkPerlinNoiseShader::contextSize(const ContextRec&) const { + return sizeof(PerlinNoiseShaderContext); } SkPerlinNoiseShader::PerlinNoiseShaderContext::PerlinNoiseShaderContext( diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 40503c96f1..cc8875cf8e 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -88,10 +88,10 @@ void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { buffer.writePoint(fEnd); } -size_t SkLinearGradient::onContextSize(const ContextRec& rec) const { +size_t SkLinearGradient::contextSize(const ContextRec& rec) const { return use_4f_context(rec, fGradFlags) - ? SkAlign16(sizeof(LinearGradient4fContext)) - : SkAlign16(sizeof(LinearGradientContext)); + ? sizeof(LinearGradient4fContext) + : sizeof(LinearGradientContext); } SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void* storage) const { diff --git a/src/effects/gradients/SkLinearGradient.h b/src/effects/gradients/SkLinearGradient.h index f0ce49b8b3..33ddfc2f9e 100644 --- a/src/effects/gradients/SkLinearGradient.h +++ b/src/effects/gradients/SkLinearGradient.h @@ -33,6 +33,8 @@ public: SkLinearGradient(const SkPoint pts[2], const Descriptor&); + size_t contextSize(const ContextRec&) const override; + class LinearGradientContext : public SkGradientShaderBase::GradientShaderBaseContext { public: LinearGradientContext(const SkLinearGradient&, const ContextRec&); @@ -69,7 +71,6 @@ public: protected: SkLinearGradient(SkReadBuffer& buffer); void flatten(SkWriteBuffer& buffer) const override; - size_t onContextSize(const ContextRec&) const override; Context* onCreateContext(const ContextRec&, void* storage) const override; private: diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp index da4c6f2412..466ae045a5 100644 --- a/src/effects/gradients/SkRadialGradient.cpp +++ b/src/effects/gradients/SkRadialGradient.cpp @@ -40,8 +40,8 @@ SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, const , fRadius(radius) { } -size_t SkRadialGradient::onContextSize(const ContextRec&) const { - return SkAlign16(sizeof(RadialGradientContext)); +size_t SkRadialGradient::contextSize(const ContextRec&) const { + return sizeof(RadialGradientContext); } SkShader::Context* SkRadialGradient::onCreateContext(const ContextRec& rec, void* storage) const { diff --git a/src/effects/gradients/SkRadialGradient.h b/src/effects/gradients/SkRadialGradient.h index 428d7fae79..9d98f18304 100644 --- a/src/effects/gradients/SkRadialGradient.h +++ b/src/effects/gradients/SkRadialGradient.h @@ -15,6 +15,8 @@ class SkRadialGradient : public SkGradientShaderBase { public: SkRadialGradient(const SkPoint& center, SkScalar radius, const Descriptor&); + size_t contextSize(const ContextRec&) const override; + class RadialGradientContext : public SkGradientShaderBase::GradientShaderBaseContext { public: RadialGradientContext(const SkRadialGradient&, const ContextRec&); @@ -39,7 +41,6 @@ public: protected: SkRadialGradient(SkReadBuffer& buffer); void flatten(SkWriteBuffer& buffer) const override; - size_t onContextSize(const ContextRec&) const override; Context* onCreateContext(const ContextRec&, void* storage) const override; private: diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp index 12d55e8b49..de80c79ae0 100644 --- a/src/effects/gradients/SkSweepGradient.cpp +++ b/src/effects/gradients/SkSweepGradient.cpp @@ -45,8 +45,8 @@ void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { buffer.writePoint(fCenter); } -size_t SkSweepGradient::onContextSize(const ContextRec&) const { - return SkAlign16(sizeof(SweepGradientContext)); +size_t SkSweepGradient::contextSize(const ContextRec&) const { + return sizeof(SweepGradientContext); } SkShader::Context* SkSweepGradient::onCreateContext(const ContextRec& rec, void* storage) const { diff --git a/src/effects/gradients/SkSweepGradient.h b/src/effects/gradients/SkSweepGradient.h index f458cea8ce..ec6df45c64 100644 --- a/src/effects/gradients/SkSweepGradient.h +++ b/src/effects/gradients/SkSweepGradient.h @@ -15,6 +15,8 @@ class SkSweepGradient : public SkGradientShaderBase { public: SkSweepGradient(SkScalar cx, SkScalar cy, const Descriptor&); + size_t contextSize(const ContextRec&) const override; + class SweepGradientContext : public SkGradientShaderBase::GradientShaderBaseContext { public: SweepGradientContext(const SkSweepGradient& shader, const ContextRec&); @@ -39,7 +41,6 @@ public: protected: void flatten(SkWriteBuffer& buffer) const override; - size_t onContextSize(const ContextRec&) const override; Context* onCreateContext(const ContextRec&, void* storage) const override; private: diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp index f4b6b0c8b0..2209306fe3 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp @@ -211,8 +211,8 @@ bool SkTwoPointConicalGradient::isOpaque() const { return false; } -size_t SkTwoPointConicalGradient::onContextSize(const ContextRec&) const { - return SkAlign16(sizeof(TwoPointConicalGradientContext)); +size_t SkTwoPointConicalGradient::contextSize(const ContextRec&) const { + return sizeof(TwoPointConicalGradientContext); } SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec& rec, diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h index 5783c39bd4..954b09698e 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.h +++ b/src/effects/gradients/SkTwoPointConicalGradient.h @@ -45,6 +45,9 @@ public: const SkPoint& end, SkScalar endRadius, bool flippedGrad, const Descriptor&); + + size_t contextSize(const ContextRec&) const override; + class TwoPointConicalGradientContext : public SkGradientShaderBase::GradientShaderBaseContext { public: TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const ContextRec&); @@ -79,7 +82,6 @@ public: protected: SkTwoPointConicalGradient(SkReadBuffer& buffer); void flatten(SkWriteBuffer& buffer) const override; - size_t onContextSize(const ContextRec&) const override; Context* onCreateContext(const ContextRec&, void* storage) const override; private: |