From ac68302e1cde8b931073929311fd6654a3253fc7 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 1 Oct 2013 15:36:52 -0700 Subject: [PATCH] only clear FB when asked for the opaque layer a layer need to be considered NOT opaque if it has a plane-alpha. Bug: 10846930 Change-Id: Ibd8981b63ede4560c7096bacc4cff46a7eb2a8bb --- services/surfaceflinger/SurfaceFlinger.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 4f139feda..b0ce52fcc 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1597,9 +1597,10 @@ void SurfaceFlinger::doComposeSurfaces(const sp& 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