From 8904b7a6485aeaf633f28a1c5f7bea9b776f025a Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Mon, 20 Aug 2012 15:25:28 -0700 Subject: [PATCH] hwc/overlay: Add premultiplied alpha support. Add premultiplied alpha support to video and mdp comp features. Change-Id: Ieddaf82d5cc43c455bd1c10dbc82b0fc016903ea --- libhwcomposer/hwc_mdpcomp.cpp | 11 +++++++---- libhwcomposer/hwc_video.cpp | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index 3c4bd1a..8bb6257 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -294,12 +294,15 @@ int MDPComp::prepare(hwc_context_t *ctx, hwc_layer_t *layer, ovutils::Whf info(hnd->width, hnd->height, hnd->format, hnd->size); ovutils::eMdpFlags mdpFlags = mdp_info.isVG ? ovutils::OV_MDP_PIPE_SHARE : ovutils::OV_MDP_FLAGS_NONE; - ovutils::eIsFg isFG = mdp_info.isFG ? ovutils::IS_FG_SET - : ovutils::IS_FG_OFF; ovutils::setMdpFlags(mdpFlags, ovutils::OV_MDP_BACKEND_COMPOSITION); - if (layer->blending == HWC_BLENDING_PREMULT) { - ovutils::setMdpFlags(mdpFlags, ovutils::OV_MDP_BLEND_FG_PREMULT); + ovutils::eIsFg isFG = mdp_info.isFG ? ovutils::IS_FG_SET + : ovutils::IS_FG_OFF; + + if(layer->blending == HWC_BLENDING_PREMULT) { + ovutils::setMdpFlags(mdpFlags, + ovutils::OV_MDP_BLEND_FG_PREMULT); } + ovutils::PipeArgs parg(mdpFlags, info, zOrder, diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp index 2dcb0cf..78784cf 100644 --- a/libhwcomposer/hwc_video.cpp +++ b/libhwcomposer/hwc_video.cpp @@ -115,6 +115,10 @@ bool configPrimVid(hwc_context_t *ctx, hwc_layer_t *layer) { ovutils::setMdpFlags(mdpFlags, ovutils::OV_MDP_SECURE_OVERLAY_SESSION); } + if(layer->blending == HWC_BLENDING_PREMULT) { + ovutils::setMdpFlags(mdpFlags, + ovutils::OV_MDP_BLEND_FG_PREMULT); + } ovutils::eIsFg isFgFlag = ovutils::IS_FG_OFF; if (ctx->numHwLayers == 1) {