OSDN Git Service

Update the layer's alpha value upon composition of the layer
authorDigish Pandya <digishp@codeaurora.org>
Mon, 4 Nov 2013 01:00:25 +0000 (06:30 +0530)
committerDigish Pandya <digishp@codeaurora.org>
Tue, 5 Nov 2013 03:52:37 +0000 (09:22 +0530)
Fixes: This patch makes sure that the layer's alpha value is
up-to-date and does not reflect the previous view's alpha value.
it fixes the square block on marquee fading edge when text view
is applied transparency.

Change-Id: I110649db72a75fecc02ba56c201a05773f80328c

libs/hwui/OpenGLRenderer.cpp

index 7735819..722cc63 100644 (file)
@@ -1000,7 +1000,13 @@ void OpenGLRenderer::composeLayer(sp<Snapshot> current, sp<Snapshot> previous) {
         }
     } else if (!rect.isEmpty()) {
         dirtyLayer(rect.left, rect.top, rect.right, rect.bottom);
+
+        save(0);
+        // the layer contains screen buffer content that shouldn't be alpha modulated
+        // (and any necessary alpha modulation was handled drawing into the layer)
+        mSnapshot->alpha = 1.0f;
         composeLayerRect(layer, rect, true);
+        restore();
     }
 
     dirtyClip();