From c17c053935bed196ef4a295129a3f6a29baaa180 Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Wed, 1 Jun 2011 10:23:25 -0700 Subject: [PATCH] libhwcomposer: Disable alpha if layer blending is disabled If the layer blending has been disabled, disable copybit alpha so that copybit does not perform any blend operation. Change-Id: I9a83fad0f126adaf9540bc72d17e7dcb1c55cd0f CRs-fixed: 288527 --- libhwcomposer/hwcomposer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index 5eefc66..a504de9 100755 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -336,7 +336,8 @@ static int drawLayerUsingCopybit(hwc_composer_device_t *dev, hwc_layer_t *layer, copybit_device_t *copybit = hwcModule->copybitEngine; copybit->set_parameter(copybit, COPYBIT_TRANSFORM, layer->transform); - copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, layer->alpha); + copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, + (layer->blending == HWC_BLENDING_NONE) ? 0xFF : layer->alpha); copybit->set_parameter(copybit, COPYBIT_PREMULTIPLIED_ALPHA, (layer->blending == HWC_BLENDING_PREMULT)? COPYBIT_ENABLE : COPYBIT_DISABLE); int err = copybit->stretch(copybit, &dst, &src, &dstRect, &srcRect, ©bitRegion);