diff options
author | Florin Malita <fmalita@chromium.org> | 2017-05-24 21:15:46 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-24 21:15:57 +0000 |
commit | d93e11ceb427ff433d219081b74d10b8757d0b03 (patch) | |
tree | a893280c0cef7dacada35555281ce8951cad4552 /src/effects | |
parent | ffce079f4e0ca4ccb7f24aa647eee1de5feb6e02 (diff) |
Revert "SkShaderBase"
This reverts commit 58a756435ca3700d9766a4580bb0771a9774f603.
Reason for revert: g3, Android borkage.
Original change's description:
> SkShaderBase
>
> Introduce a private base class (SkShaderBase), to hide
> implementation details from the public interface (SkShader).
>
> Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176
> Reviewed-on: https://skia-review.googlesource.com/17241
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
>
TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I32b012ee466dd006c074593f211f43ed602f1078
Reviewed-on: https://skia-review.googlesource.com/17845
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkGaussianEdgeShader.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkGaussianEdgeShader.h | 2 | ||||
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 14 | ||||
-rw-r--r-- | src/effects/gradients/Sk4fGradientBase.h | 6 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 2 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 10 | ||||
-rw-r--r-- | src/effects/gradients/SkLinearGradient.cpp | 8 | ||||
-rw-r--r-- | src/effects/gradients/SkRadialGradient.cpp | 4 | ||||
-rw-r--r-- | src/effects/gradients/SkSweepGradient.cpp | 4 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient.cpp | 2 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp | 10 |
11 files changed, 33 insertions, 33 deletions
diff --git a/src/effects/SkGaussianEdgeShader.cpp b/src/effects/SkGaussianEdgeShader.cpp index c710b949d3..7bbbb79117 100644 --- a/src/effects/SkGaussianEdgeShader.cpp +++ b/src/effects/SkGaussianEdgeShader.cpp @@ -21,7 +21,7 @@ class SkArenaAlloc; When not using implicit distance, then b in the input color represents the input to the blur function. */ -class SkGaussianEdgeShaderImpl : public SkShaderBase { +class SkGaussianEdgeShaderImpl : public SkShader { public: SkGaussianEdgeShaderImpl() {} @@ -42,7 +42,7 @@ protected: private: friend class SkGaussianEdgeShader; - typedef SkShaderBase INHERITED; + typedef SkShader INHERITED; }; //////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/SkGaussianEdgeShader.h b/src/effects/SkGaussianEdgeShader.h index f0554dd0a7..ef54ece56e 100644 --- a/src/effects/SkGaussianEdgeShader.h +++ b/src/effects/SkGaussianEdgeShader.h @@ -8,7 +8,7 @@ #ifndef SkGaussianEdgeShader_DEFINED #define SkGaussianEdgeShader_DEFINED -#include "SkShaderBase.h" +#include "SkShader.h" class SK_API SkGaussianEdgeShader { public: diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 87f8967242..f2877cf472 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -10,7 +10,7 @@ #include "SkArenaAlloc.h" #include "SkColorFilter.h" #include "SkReadBuffer.h" -#include "SkShaderBase.h" +#include "SkShader.h" #include "SkString.h" #include "SkUnPreMultiply.h" #include "SkWriteBuffer.h" @@ -50,7 +50,7 @@ inline SkScalar smoothCurve(SkScalar t) { return t * t * (3 - 2 * t); } -class SkPerlinNoiseShaderImpl final : public SkShaderBase { +class SkPerlinNoiseShaderImpl final : public SkShader { public: /** * About the noise types : the difference between the 2 is just minor tweaks to the algorithm, @@ -87,7 +87,7 @@ protected: Context* onMakeContext(const ContextRec&, SkArenaAlloc* storage) const override; private: - class PerlinNoiseShaderContext final : public Context { + class PerlinNoiseShaderContext final : public SkShader::Context { public: PerlinNoiseShaderContext(const SkPerlinNoiseShaderImpl& shader, const ContextRec&); ~PerlinNoiseShaderContext() override; @@ -105,7 +105,7 @@ private: SkMatrix fMatrix; PaintingData* fPaintingData; - typedef Context INHERITED; + typedef SkShader::Context INHERITED; }; const Type fType; @@ -118,7 +118,7 @@ private: friend class ::SkPerlinNoiseShader; - typedef SkShaderBase INHERITED; + typedef SkShader INHERITED; }; } // end namespace @@ -503,7 +503,7 @@ SkPMColor SkPerlinNoiseShaderImpl::PerlinNoiseShaderContext::shade( return SkPreMultiplyARGB(rgba[3], rgba[0], rgba[1], rgba[2]); } -SkShaderBase::Context* SkPerlinNoiseShaderImpl::onMakeContext( +SkShader::Context* SkPerlinNoiseShaderImpl::onMakeContext( const ContextRec& rec, SkArenaAlloc* alloc) const { return alloc->make<PerlinNoiseShaderContext>(*this, rec); } @@ -658,7 +658,7 @@ sk_sp<GrFragmentProcessor> GrPerlinNoiseEffect::TestCreate(GrProcessorTestData* stitchTiles ? &tileSize : nullptr)); GrTest::TestAsFPArgs asFPArgs(d); - return as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + return shader->asFragmentProcessor(asFPArgs.args()); } #endif diff --git a/src/effects/gradients/Sk4fGradientBase.h b/src/effects/gradients/Sk4fGradientBase.h index a660d6bde5..9209a90637 100644 --- a/src/effects/gradients/Sk4fGradientBase.h +++ b/src/effects/gradients/Sk4fGradientBase.h @@ -14,7 +14,7 @@ #include "SkMatrix.h" #include "SkNx.h" #include "SkPM4f.h" -#include "SkShaderBase.h" +#include "SkShader.h" #include "SkTArray.h" struct Sk4fGradientInterval { @@ -53,7 +53,7 @@ private: }; class SkGradientShaderBase:: -GradientShaderBase4fContext : public Context { +GradientShaderBase4fContext : public SkShader::Context { public: GradientShaderBase4fContext(const SkGradientShaderBase&, const ContextRec&); @@ -77,7 +77,7 @@ protected: bool fColorsArePremul; private: - using INHERITED = Context; + using INHERITED = SkShader::Context; void addMirrorIntervals(const SkGradientShaderBase&, const Sk4f& componentScale, bool reverse); diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 137da84d0c..5a4a31c58f 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -582,7 +582,7 @@ SkGradientShaderBase::GradientShaderBaseContext::GradientShaderBaseContext( fDstToIndex.setConcat(shader.fPtsToUnit, inverse); fDstToIndexProc = fDstToIndex.getMapXYProc(); - fDstToIndexClass = (uint8_t)SkShaderBase::Context::ComputeMatrixClass(fDstToIndex); + fDstToIndexClass = (uint8_t)SkShader::Context::ComputeMatrixClass(fDstToIndex); // now convert our colors in to PMColors unsigned paintAlpha = this->getPaintAlpha(); diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index 7a66edaffc..8c188de39b 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -20,7 +20,7 @@ #include "SkPM4fPriv.h" #include "SkRasterPipeline.h" #include "SkReadBuffer.h" -#include "SkShaderBase.h" +#include "SkShader.h" #include "SkUtils.h" #include "SkWriteBuffer.h" @@ -79,7 +79,7 @@ static const TileProc gTileProcs[] = { /////////////////////////////////////////////////////////////////////////////// -class SkGradientShaderBase : public SkShaderBase { +class SkGradientShaderBase : public SkShader { public: struct Descriptor { Descriptor() { @@ -156,7 +156,7 @@ public: U8CPU alpha, uint32_t gradFlags, bool dither); }; - class GradientShaderBaseContext : public Context { + class GradientShaderBaseContext : public SkShader::Context { public: GradientShaderBaseContext(const SkGradientShaderBase& shader, const ContextRec&); @@ -174,7 +174,7 @@ public: sk_sp<GradientShaderCache> fCache; private: - typedef Context INHERITED; + typedef SkShader::Context INHERITED; }; bool isOpaque() const override; @@ -283,7 +283,7 @@ private: void initCommon(); - typedef SkShaderBase INHERITED; + typedef SkShader INHERITED; }; diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 17c4fd36a4..bd46452fb2 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -39,11 +39,11 @@ static SkMatrix pts_to_unit_matrix(const SkPoint pts[2]) { return matrix; } -static bool use_4f_context(const SkShaderBase::ContextRec& rec, uint32_t flags) { +static bool use_4f_context(const SkShader::ContextRec& rec, uint32_t flags) { #ifdef FORCE_4F_CONTEXT return true; #else - return rec.fPreferredDstType == SkShaderBase::ContextRec::kPM4f_DstType + return rec.fPreferredDstType == SkShader::ContextRec::kPM4f_DstType || SkToBool(flags & SkLinearGradient::kForce4fContext_PrivateFlag); #endif } @@ -75,7 +75,7 @@ void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { buffer.writePoint(fEnd); } -SkShaderBase::Context* SkLinearGradient::onMakeContext( +SkShader::Context* SkLinearGradient::onMakeContext( const ContextRec& rec, SkArenaAlloc* alloc) const { return use_4f_context(rec, fGradFlags) @@ -436,7 +436,7 @@ sk_sp<GrFragmentProcessor> GrLinearGradient::TestCreate(GrProcessorTestData* d) SkGradientShader::MakeLinear(points, params.fColors, params.fStops, params.fColorCount, params.fTileMode); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp index d49b3dd8e1..339c5ff473 100644 --- a/src/effects/gradients/SkRadialGradient.cpp +++ b/src/effects/gradients/SkRadialGradient.cpp @@ -40,7 +40,7 @@ SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, const , fRadius(radius) { } -SkShaderBase::Context* SkRadialGradient::onMakeContext( +SkShader::Context* SkRadialGradient::onMakeContext( const ContextRec& rec, SkArenaAlloc* alloc) const { return CheckedMakeContext<RadialGradientContext>(alloc, *this, rec); @@ -318,7 +318,7 @@ sk_sp<GrFragmentProcessor> GrRadialGradient::TestCreate(GrProcessorTestData* d) params.fTileMode); } while (!shader); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp index 1e583c2ee0..66913c6b20 100644 --- a/src/effects/gradients/SkSweepGradient.cpp +++ b/src/effects/gradients/SkSweepGradient.cpp @@ -52,7 +52,7 @@ void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { buffer.writePoint(fCenter); } -SkShaderBase::Context* SkSweepGradient::onMakeContext( +SkShader::Context* SkSweepGradient::onMakeContext( const ContextRec& rec, SkArenaAlloc* alloc) const { return CheckedMakeContext<SweepGradientContext>(alloc, *this, rec); @@ -210,7 +210,7 @@ sk_sp<GrFragmentProcessor> GrSweepGradient::TestCreate(GrProcessorTestData* d) { SkGradientShader::MakeSweep(center.fX, center.fY, params.fColors, params.fStops, params.fColorCount); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp index 4549527d51..ced299ee23 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp @@ -210,7 +210,7 @@ bool SkTwoPointConicalGradient::isOpaque() const { return false; } -SkShaderBase::Context* SkTwoPointConicalGradient::onMakeContext( +SkShader::Context* SkTwoPointConicalGradient::onMakeContext( const ContextRec& rec, SkArenaAlloc* alloc) const { return CheckedMakeContext<TwoPointConicalGradientContext>(alloc, *this, rec); } diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp index 8402199362..fedb445904 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp @@ -207,7 +207,7 @@ sk_sp<GrFragmentProcessor> Edge2PtConicalEffect::TestCreate(GrProcessorTestData* params.fColors, params.fStops, params.fColorCount, params.fTileMode); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } @@ -486,7 +486,7 @@ sk_sp<GrFragmentProcessor> FocalOutside2PtConicalEffect::TestCreate(GrProcessorT params.fColors, params.fStops, params.fColorCount, params.fTileMode); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } @@ -690,7 +690,7 @@ sk_sp<GrFragmentProcessor> FocalInside2PtConicalEffect::TestCreate(GrProcessorTe params.fColors, params.fStops, params.fColorCount, params.fTileMode); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } @@ -936,7 +936,7 @@ sk_sp<GrFragmentProcessor> CircleInside2PtConicalEffect::TestCreate(GrProcessorT params.fColors, params.fStops, params.fColorCount, params.fTileMode); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } @@ -1170,7 +1170,7 @@ sk_sp<GrFragmentProcessor> CircleOutside2PtConicalEffect::TestCreate(GrProcessor params.fColors, params.fStops, params.fColorCount, params.fTileMode); GrTest::TestAsFPArgs asFPArgs(d); - sk_sp<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); + sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args()); GrAlwaysAssert(fp); return fp; } |