libcopybit: Enable premultiplied alpha support

Premultiplied alpha is now supported on MDP3.x.
Enable it from userspace.
Also make flags as int since values are exceeding 255(uint8_t).

CRs-fixed: 347803
(cherry picked from commit 3dcbcb1f8672067f85e2f53e6321c27df6d6fbe6)

Change-Id: I865379b368726e95cab7aa669fbf27d5207240c5
This commit is contained in:
Prabhanjan Kandula 2012-04-03 12:27:51 +05:30 committed by Andrew Sutherland
parent 906031e60f
commit 0c3b559c20

View File

@ -59,7 +59,7 @@ struct copybit_context_t {
struct copybit_device_t device;
int mFD;
uint8_t mAlpha;
uint8_t mFlags;
int mFlags;
};
/**
@ -307,6 +307,13 @@ static int set_parameter_copybit(
ctx->mFlags &= ~MDP_BLUR;
}
break;
case COPYBIT_PREMULTIPLIED_ALPHA:
if(value == COPYBIT_ENABLE) {
ctx->mFlags |= MDP_BLEND_FG_PREMULT;
} else if (value == COPYBIT_DISABLE) {
ctx->mFlags &= ~MDP_BLEND_FG_PREMULT;
}
break;
case COPYBIT_TRANSFORM:
ctx->mFlags &= ~0x7;
ctx->mFlags |= value & 0x7;