From 91050f2f199df64d80c4e17d08457a7ec9c6990e Mon Sep 17 00:00:00 2001 From: Diego Wilson Date: Mon, 29 Apr 2013 17:20:51 -0700 Subject: [PATCH] Bug 832383 - Don't render semitransparent color layers in HwcComposer2D. r=mwu The hardware composer does not support them. Also don't skip rendering fully transparent layers. The GPU compositor does not seem to ignore them completely. --- widget/gonk/HwcComposer2D.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/widget/gonk/HwcComposer2D.cpp b/widget/gonk/HwcComposer2D.cpp index 3d6dd71cbfbb..f13160299479 100644 --- a/widget/gonk/HwcComposer2D.cpp +++ b/widget/gonk/HwcComposer2D.cpp @@ -297,11 +297,7 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer, } float opacity = aLayer->GetEffectiveOpacity(); - if (opacity <= 0) { - LOGD("Layer is fully transparent so skip rendering"); - return true; - } - else if (opacity < 1) { + if (opacity < 1) { LOGD("Layer has planar semitransparency which is unsupported"); return false; } @@ -444,7 +440,11 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer, hwcLayer.visibleRegionScreen = region; } else { hwcLayer.flags |= HWC_COLOR_FILL; - ColorLayer* colorLayer = static_cast(layerGL->GetLayer()); + ColorLayer* colorLayer = aLayer->AsColorLayer(); + if (colorLayer->GetColor().a < 1.0) { + LOGD("Color layer has semitransparency which is unsupported"); + return false; + } hwcLayer.transform = colorLayer->GetColor().Packed(); }