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: Ia5f18afff4384a33b8ad2ca051be1a120aefa4d5
Acked-by: Kinjal Bhavsar <kbhavsar@codeaurora.org>
diff --git a/liboverlay/overlayRotator.cpp b/liboverlay/overlayRotator.cpp
index 306e28f..5bf7dbc 100644
--- a/liboverlay/overlayRotator.cpp
+++ b/liboverlay/overlayRotator.cpp
@@ -80,10 +80,13 @@
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();