Overlay: Switch the flip for MDP, on 90 rotated source

Camera client doesn't factor in the 90-rotated source when setting the flip
Switch the flips when the source is 90-rotated.

Change-Id: I16b81ca2c146f9b4c20908674f89d0a2e9808681
This commit is contained in:
Kinjal Bhavsar
2012-08-09 18:15:18 -07:00
committed by Nikez
parent 2a44da70d2
commit 384a5b2709
3 changed files with 13 additions and 5 deletions

View File

@@ -97,9 +97,12 @@ bool MdpCtrl::setPosition(const overlay::utils::Dim& d,
bool MdpCtrl::setTransform(const utils::eTransform& orient,
const bool& rotUsed) {
mOrientation = orient;
int rot = utils::getMdpOrient(orient);
setUserData(rot);
//getMdpOrient will switch the flips if the source is 90 rotated.
//Clients in Android dont factor in 90 rotation while deciding the flip.
mOrientation = static_cast<utils::eTransform>(rot);
//Rotator can be requested by client even if layer has 0 orientation.
mRotUsed = rotUsed;
return true;

View File

@@ -82,10 +82,13 @@ void MdpRot::setFlags(const utils::eMdpFlags& flags) {
void MdpRot::setTransform(const utils::eTransform& rot, const bool& rotUsed)
{
mOrientation = rot;
int r = utils::getMdpOrient(rot);
ALOGE_IF(DEBUG_OVERLAY, "%s: r=%d", __FUNCTION__, r);
setRotations(r);
//getMdpOrient will switch the flips if the source is 90 rotated.
//Clients in Android dont factor in 90 rotation while deciding the flip.
mOrientation = static_cast<utils::eTransform>(r);
ALOGE_IF(DEBUG_OVERLAY, "%s: r=%d", __FUNCTION__, r);
setDisable();
if(rotUsed) {
setEnable();

View File

@@ -640,10 +640,12 @@ inline int getMdpOrient(eTransform rotation) {
case OVERLAY_TRANSFORM_FLIP_V: return MDP_FLIP_UD;
case OVERLAY_TRANSFORM_FLIP_H: return MDP_FLIP_LR;
case OVERLAY_TRANSFORM_ROT_90: return MDP_ROT_90;
//getMdpOrient will switch the flips if the source is 90 rotated.
//Clients in Android dont factor in 90 rotation while deciding flip.
case OVERLAY_TRANSFORM_ROT_90_FLIP_V:
return MDP_ROT_90 | MDP_FLIP_UD;
case OVERLAY_TRANSFORM_ROT_90_FLIP_H:
return MDP_ROT_90 | MDP_FLIP_LR;
case OVERLAY_TRANSFORM_ROT_90_FLIP_H:
return MDP_ROT_90 | MDP_FLIP_UD;
case OVERLAY_TRANSFORM_ROT_180: return MDP_ROT_180;
case OVERLAY_TRANSFORM_ROT_270: return MDP_ROT_270;
default: