summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-09-05 11:40:29 -0700
committerChet Haase <chet@google.com>2012-09-07 13:27:02 -0700
commitd15ebf25c595b855f6978d0600218e3ea5f31e92 (patch)
tree35154bd1ec18cf8299a0d737847291ab28a5c98b /libs/hwui/OpenGLRenderer.cpp
parent4db5d23deab9ea8de34cdb1c56af31e6e3cff79b (diff)
downloadframeworks_base-d15ebf25c595b855f6978d0600218e3ea5f31e92.zip
frameworks_base-d15ebf25c595b855f6978d0600218e3ea5f31e92.tar.gz
frameworks_base-d15ebf25c595b855f6978d0600218e3ea5f31e92.tar.bz2
Enable changing properties of layer paint
Previously, to draw a layered view with a changed Paint object for the drawLayer operation, you'd have to invalidate the parent view, to get the native DisplayList to pick up the new Paint properties. This change adds API and functionality so that the developer can call setLayerPaint(), which does the proper invalidation (lightweight, doesn't cause redrawing the view). Issue #6923810 Make it easy to efficiently animate a layer's Paint Change-Id: I7fea79788d50f6d9c86dd5e5b2a4490cb95142bb
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index b66c898..05c7809 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -2593,17 +2593,13 @@ status_t OpenGLRenderer::drawLayer(Layer* layer, float x, float y, SkPaint* pain
mCaches.activeTexture(0);
- int alpha;
- SkXfermode::Mode mode;
- getAlphaAndMode(paint, &alpha, &mode);
-
- layer->setAlpha(alpha, mode);
-
if (CC_LIKELY(!layer->region.isEmpty())) {
if (layer->region.isRect()) {
composeLayerRect(layer, layer->regionRect);
} else if (layer->mesh) {
- const float a = alpha / 255.0f;
+ const float a = layer->getAlpha() / 255.0f;
+ SkiaColorFilter *oldFilter = mColorFilter;
+ mColorFilter = layer->getColorFilter();
setupDraw();
setupDrawWithTexture();
@@ -2633,6 +2629,8 @@ status_t OpenGLRenderer::drawLayer(Layer* layer, float x, float y, SkPaint* pain
finishDrawTexture();
+ mColorFilter = oldFilter;
+
#if DEBUG_LAYERS_AS_REGIONS
drawRegionRects(layer->region);
#endif