diff options
Diffstat (limited to 'libs/hwui/DisplayListOp.h')
-rw-r--r-- | libs/hwui/DisplayListOp.h | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h index e4867220..ea3e7a8 100644 --- a/libs/hwui/DisplayListOp.h +++ b/libs/hwui/DisplayListOp.h @@ -208,9 +208,16 @@ protected: if (!state.mMatrix.isSimple()) return false; // check state/paint for transparency - if (state.mDrawModifiers.mShader || - state.mAlpha != 1.0f || - (mPaint && mPaint->getAlpha() != 0xFF)) return false; + if (mPaint) { + if (mPaint->getShader() && !mPaint->getShader()->isOpaque()) { + return false; + } + if (mPaint->getAlpha() != 0xFF) { + return false; + } + } + + if (state.mAlpha != 1.0f) return false; SkXfermode::Mode mode = OpenGLRenderer::getXfermodeDirect(mPaint); return (mode == SkXfermode::kSrcOver_Mode || @@ -592,37 +599,6 @@ private: const SkRegion* mRegion; }; -class ResetShaderOp : public StateOp { -public: - virtual void applyState(OpenGLRenderer& renderer, int saveCount) const { - renderer.resetShader(); - } - - virtual void output(int level, uint32_t logFlags) const { - OP_LOGS("ResetShader"); - } - - virtual const char* name() { return "ResetShader"; } -}; - -class SetupShaderOp : public StateOp { -public: - SetupShaderOp(SkiaShader* shader) - : mShader(shader) {} - virtual void applyState(OpenGLRenderer& renderer, int saveCount) const { - renderer.setupShader(mShader); - } - - virtual void output(int level, uint32_t logFlags) const { - OP_LOG("SetupShader, shader %p", mShader); - } - - virtual const char* name() { return "SetupShader"; } - -private: - SkiaShader* mShader; -}; - class ResetPaintFilterOp : public StateOp { public: virtual void applyState(OpenGLRenderer& renderer, int saveCount) const { |