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
This commit is contained in:
Mathias Agopian 2013-10-01 15:36:52 -07:00
parent b65f32ebe2
commit ac68302e1c

View File

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