OSDN Git Service

only clear FB when asked for the opaque layer
authorMathias Agopian <mathias@google.com>
Tue, 1 Oct 2013 22:36:52 +0000 (15:36 -0700)
committerThe Android Automerger <android-build@google.com>
Wed, 2 Oct 2013 21:44:42 +0000 (14:44 -0700)
a layer need to be considered NOT opaque if it has a
plane-alpha.

Bug: 10846930
Change-Id: Ibd8981b63ede4560c7096bacc4cff46a7eb2a8bb

services/surfaceflinger/SurfaceFlinger.cpp

index b5b0f2c..e374548 100644 (file)
@@ -1597,9 +1597,10 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
             if (!clip.isEmpty()) {
                 switch (cur->getCompositionType()) {
                     case HWC_OVERLAY: {
+                        const Layer::State& state(layer->getDrawingState());
                         if ((cur->getHints() & HWC_HINT_CLEAR_FB)
                                 && i
-                                && layer->isOpaque()
+                                && layer->isOpaque() && (state.alpha == 0xFF)
                                 && hasGlesComposition) {
                             // never clear the very first layer since we're
                             // guaranteed the FB is already cleared