Use snapshot alpha for layers
Removes mMultipliedAlpha, using the snapshot alpha for all
non-overlapping display list alpha control.
Additionally, fixes opacity issues where children of
hasOverlappingRendering=false displaylists (both hw layer sublists and
other sublists with hasOverlappingRendering=false)
Change-Id: I6adc16da855835f9f518f8967628e5d0135c789b
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index e6c636c..abcff8d 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -72,7 +72,6 @@
struct DeferredDisplayState {
Rect mBounds; // local bounds, mapped with matrix to be in screen space coordinates, clipped.
- int mMultipliedAlpha; // -1 if invalid (because caching not set)
// the below are set and used by the OpenGLRenderer at record and deferred playback
Rect mClip;
@@ -226,7 +225,7 @@
virtual status_t drawDisplayList(DisplayList* displayList, Rect& dirty, int32_t replayFlags);
virtual void outputDisplayList(DisplayList* displayList);
- virtual status_t drawLayer(Layer* layer, float x, float y, SkPaint* paint);
+ virtual status_t drawLayer(Layer* layer, float x, float y);
virtual status_t drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint);
virtual status_t drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint);
virtual status_t drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop,
@@ -272,7 +271,7 @@
virtual void resetPaintFilter();
virtual void setupPaintFilter(int clearBits, int setBits);
- SkPaint* filterPaint(SkPaint* paint, bool alwaysCopy = false);
+ SkPaint* filterPaint(SkPaint* paint);
bool storeDisplayState(DeferredDisplayState& state, int stateDeferFlags);
void restoreDisplayState(const DeferredDisplayState& state, int stateDeferFlags);
@@ -292,11 +291,11 @@
}
/**
- * Sets the alpha on the current snapshot. This alpha value will be modulated
+ * Scales the alpha on the current snapshot. This alpha value will be modulated
* with other alpha values when drawing primitives.
*/
- void setAlpha(float alpha) {
- mSnapshot->alpha = alpha;
+ void scaleAlpha(float alpha) {
+ mSnapshot->alpha *= alpha;
}
/**