diff options
author | Chris Craik <ccraik@google.com> | 2015-04-28 17:47:20 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-04-28 17:47:20 -0700 |
commit | 8df5ffa9ae0667d9e0241adf4675753156fcef84 (patch) | |
tree | 5b59aa1d6cd6733a28bd316afff67091d9856db7 /libs/hwui/OpenGLRenderer.cpp | |
parent | 340b198ccbd1a05e67d586c345139617d4b84ce0 (diff) | |
download | frameworks_base-8df5ffa9ae0667d9e0241adf4675753156fcef84.zip frameworks_base-8df5ffa9ae0667d9e0241adf4675753156fcef84.tar.gz frameworks_base-8df5ffa9ae0667d9e0241adf4675753156fcef84.tar.bz2 |
Remove concept of layer alpha override
bug:19412691
Change-Id: I9e150fe4a1b2c0cf140519a33c02fd4771ef1c50
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 30935d5..f735fb5 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -76,9 +76,6 @@ OpenGLRenderer::OpenGLRenderer(RenderState& renderState) , mLightRadius(FLT_MIN) , mAmbientShadowAlpha(0) , mSpotShadowAlpha(0) { - // *set* draw modifiers to be 0 - memset(&mDrawModifiers, 0, sizeof(mDrawModifiers)); - mDrawModifiers.mOverrideLayerAlpha = 1.0f; } OpenGLRenderer::~OpenGLRenderer() { @@ -1188,10 +1185,9 @@ bool OpenGLRenderer::storeDisplayState(DeferredDisplayState& state, int stateDef state.mClip.set(currentClip); } - // Transform, drawModifiers, and alpha always deferred, since they are used by state operations + // Transform and alpha always deferred, since they are used by state operations // (Note: saveLayer/restore use colorFilter and alpha, so we just save restore everything) state.mMatrix.load(*currentMatrix); - state.mDrawModifiers = mDrawModifiers; state.mAlpha = currentSnapshot()->alpha; // always store/restore, since it's just a pointer @@ -1202,7 +1198,6 @@ bool OpenGLRenderer::storeDisplayState(DeferredDisplayState& state, int stateDef void OpenGLRenderer::restoreDisplayState(const DeferredDisplayState& state, bool skipClipRestore) { setMatrix(state.mMatrix); writableSnapshot()->alpha = state.mAlpha; - mDrawModifiers = state.mDrawModifiers; writableSnapshot()->roundRectClipState = state.mRoundRectClipState; if (state.mClipValid && !skipClipRestore) { @@ -2541,21 +2536,11 @@ void OpenGLRenderer::drawColorRect(float left, float top, float right, float bot void OpenGLRenderer::getAlphaAndMode(const SkPaint* paint, int* alpha, SkXfermode::Mode* mode) const { getAlphaAndModeDirect(paint, alpha, mode); - if (mDrawModifiers.mOverrideLayerAlpha < 1.0f) { - // if drawing a layer, ignore the paint's alpha - *alpha = mDrawModifiers.mOverrideLayerAlpha * 255; - } *alpha *= currentSnapshot()->alpha; } float OpenGLRenderer::getLayerAlpha(const Layer* layer) const { - float alpha; - if (mDrawModifiers.mOverrideLayerAlpha < 1.0f) { - alpha = mDrawModifiers.mOverrideLayerAlpha; - } else { - alpha = layer->getAlpha() / 255.0f; - } - return alpha * currentSnapshot()->alpha; + return (layer->getAlpha() / 255.0f) * currentSnapshot()->alpha; } }; // namespace uirenderer |