diff options
author | 2017-05-24 21:15:46 +0000 | |
---|---|---|
committer | 2017-05-24 21:15:57 +0000 | |
commit | d93e11ceb427ff433d219081b74d10b8757d0b03 (patch) | |
tree | a893280c0cef7dacada35555281ce8951cad4552 /src/core/SkBlitter_PM4f.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/SkBlitter_PM4f.cpp')
-rw-r--r-- | src/core/SkBlitter_PM4f.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/core/SkBlitter_PM4f.cpp b/src/core/SkBlitter_PM4f.cpp index f83e0c214e..61105ce2db 100644 --- a/src/core/SkBlitter_PM4f.cpp +++ b/src/core/SkBlitter_PM4f.cpp @@ -139,7 +139,7 @@ public: template <typename State> class SkState_Shader_Blitter : public SkShaderBlitter { public: SkState_Shader_Blitter(const SkPixmap& device, const SkPaint& paint, - const SkShaderBase::Context::BlitState& bstate) + const SkShader::Context::BlitState& bstate) : INHERITED(device, paint, bstate.fCtx) , fState(device.info(), paint, bstate.fCtx) , fBState(bstate) @@ -309,10 +309,10 @@ public: } protected: - State fState; - SkShaderBase::Context::BlitState fBState; - SkShaderBase::Context::BlitBW fBlitBW; - SkShaderBase::Context::BlitAA fBlitAA; + State fState; + SkShader::Context::BlitState fBState; + SkShader::Context::BlitBW fBlitBW; + SkShader::Context::BlitAA fBlitAA; typedef SkShaderBlitter INHERITED; }; @@ -320,14 +320,13 @@ protected: /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// -static bool is_opaque(const SkPaint& paint, const SkShaderBase::Context* shaderContext) { - return shaderContext ? SkToBool(shaderContext->getFlags() & SkShaderBase::kOpaqueAlpha_Flag) +static bool is_opaque(const SkPaint& paint, const SkShader::Context* shaderContext) { + return shaderContext ? SkToBool(shaderContext->getFlags() & SkShader::kOpaqueAlpha_Flag) : 0xFF == paint.getAlpha(); } struct State4f { - State4f(const SkImageInfo& info, const SkPaint& paint, - const SkShaderBase::Context* shaderContext) { + State4f(const SkImageInfo& info, const SkPaint& paint, const SkShader::Context* shaderContext) { fMode = paint.getBlendMode(); if (shaderContext) { fBuffer.reset(info.width()); @@ -337,11 +336,12 @@ struct State4f { fFlags = 0; } - SkPM4f fPM4f; - SkAutoTMalloc<SkPM4f> fBuffer; - uint32_t fFlags; - SkBlendMode fMode; - SkShaderBase::Context::BlitState fBState; + SkPM4f fPM4f; + SkAutoTMalloc<SkPM4f> fBuffer; + uint32_t fFlags; + SkBlendMode fMode; + + SkShader::Context::BlitState fBState; }; struct State32 : State4f { @@ -350,8 +350,7 @@ struct State32 : State4f { SkXfermode::D32Proc fProc1; SkXfermode::D32Proc fProcN; - State32(const SkImageInfo& info, const SkPaint& paint, - const SkShaderBase::Context* shaderContext) + State32(const SkImageInfo& info, const SkPaint& paint, const SkShader::Context* shaderContext) : State4f(info, paint, shaderContext) { if (is_opaque(paint, shaderContext)) { @@ -383,8 +382,7 @@ struct StateF16 : State4f { SkXfermode::F16Proc fProc1; SkXfermode::F16Proc fProcN; - StateF16(const SkImageInfo& info, const SkPaint& paint, - const SkShaderBase::Context* shaderContext) + StateF16(const SkImageInfo& info, const SkPaint& paint, const SkShader::Context* shaderContext) : State4f(info, paint, shaderContext) { if (is_opaque(paint, shaderContext)) { @@ -406,12 +404,12 @@ struct StateF16 : State4f { }; template <typename State> SkBlitter* create(const SkPixmap& device, const SkPaint& paint, - SkShaderBase::Context* shaderContext, + SkShader::Context* shaderContext, SkArenaAlloc* alloc) { SkASSERT(alloc != nullptr); if (shaderContext) { - SkShaderBase::Context::BlitState bstate; + SkShader::Context::BlitState bstate; sk_bzero(&bstate, sizeof(bstate)); bstate.fCtx = shaderContext; bstate.fMode = paint.getBlendMode(); @@ -428,13 +426,13 @@ template <typename State> SkBlitter* create(const SkPixmap& device, const SkPain } SkBlitter* SkBlitter_ARGB32_Create(const SkPixmap& device, const SkPaint& paint, - SkShaderBase::Context* shaderContext, + SkShader::Context* shaderContext, SkArenaAlloc* alloc) { return create<State32>(device, paint, shaderContext, alloc); } SkBlitter* SkBlitter_F16_Create(const SkPixmap& device, const SkPaint& paint, - SkShaderBase::Context* shaderContext, + SkShader::Context* shaderContext, SkArenaAlloc* alloc) { return create<StateF16>(device, paint, shaderContext, alloc); } |