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/core/SkBitmapProcShader.cpp | |
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/core/SkBitmapProcShader.cpp')
-rw-r--r-- | src/core/SkBitmapProcShader.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index e52982354d..b7bd39c197 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -17,21 +17,21 @@ static bool only_scale_and_translate(const SkMatrix& matrix) { return (matrix.getType() & ~mask) == 0; } -class BitmapProcInfoContext : public SkShaderBase::Context { +class BitmapProcInfoContext : public SkShader::Context { public: // The info has been allocated elsewhere, but we are responsible for calling its destructor. - BitmapProcInfoContext(const SkShaderBase& shader, const SkShaderBase::ContextRec& rec, + BitmapProcInfoContext(const SkShader& shader, const SkShader::ContextRec& rec, SkBitmapProcInfo* info) : INHERITED(shader, rec) , fInfo(info) { fFlags = 0; if (fInfo->fPixmap.isOpaque() && (255 == this->getPaintAlpha())) { - fFlags |= SkShaderBase::kOpaqueAlpha_Flag; + fFlags |= SkShader::kOpaqueAlpha_Flag; } if (1 == fInfo->fPixmap.height() && only_scale_and_translate(this->getTotalInverse())) { - fFlags |= SkShaderBase::kConstInY32_Flag; + fFlags |= SkShader::kConstInY32_Flag; } } @@ -41,14 +41,14 @@ private: SkBitmapProcInfo* fInfo; uint32_t fFlags; - typedef SkShaderBase::Context INHERITED; + typedef SkShader::Context INHERITED; }; /////////////////////////////////////////////////////////////////////////////////////////////////// class BitmapProcShaderContext : public BitmapProcInfoContext { public: - BitmapProcShaderContext(const SkShaderBase& shader, const SkShaderBase::ContextRec& rec, + BitmapProcShaderContext(const SkShader& shader, const SkShader::ContextRec& rec, SkBitmapProcState* state) : INHERITED(shader, rec, state) , fState(state) @@ -104,7 +104,7 @@ private: class LinearPipelineContext : public BitmapProcInfoContext { public: - LinearPipelineContext(const SkShaderBase& shader, const SkShaderBase::ContextRec& rec, + LinearPipelineContext(const SkShader& shader, const SkShader::ContextRec& rec, SkBitmapProcInfo* info, SkArenaAlloc* alloc) : INHERITED(shader, rec, info), fAllocator{alloc} { @@ -183,12 +183,12 @@ private: /////////////////////////////////////////////////////////////////////////////////////////////////// -static bool choose_linear_pipeline(const SkShaderBase::ContextRec& rec, const SkImageInfo& srcInfo) { +static bool choose_linear_pipeline(const SkShader::ContextRec& rec, const SkImageInfo& srcInfo) { // If we get here, we can reasonably use either context, respect the caller's preference // bool needsPremul = srcInfo.alphaType() == kUnpremul_SkAlphaType; bool needsSwizzle = srcInfo.bytesPerPixel() == 4 && srcInfo.colorType() != kN32_SkColorType; - return SkShaderBase::ContextRec::kPM4f_DstType == rec.fPreferredDstType + return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType || needsPremul || needsSwizzle; } @@ -199,8 +199,8 @@ size_t SkBitmapProcLegacyShader::ContextSize(const ContextRec& rec, const SkImag return s; } -SkShaderBase::Context* SkBitmapProcLegacyShader::MakeContext( - const SkShaderBase& shader, TileMode tmx, TileMode tmy, +SkShader::Context* SkBitmapProcLegacyShader::MakeContext( + const SkShader& shader, TileMode tmx, TileMode tmy, const SkBitmapProvider& provider, const ContextRec& rec, SkArenaAlloc* alloc) { SkMatrix totalInverse; |