From 9d4f87e88cc7c1422a4816d23e9a15135853b7e8 Mon Sep 17 00:00:00 2001 From: Sravank Date: Wed, 20 Apr 2011 19:22:42 +0530 Subject: [PATCH] libOverlay : Set correct crop values for overlay with flip When front camera is in use, overlay is created with 90 degree rotation and vertical flip. This change considers 90 degree rotation with flip, and updates the crop rectangle accordingly. CRs-Fixed : 283348, 284193 Change-Id: Ia0d7830f12d607ae698b019396cd0e2bef168a6a --- liboverlay/overlayLib.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/liboverlay/overlayLib.cpp b/liboverlay/overlayLib.cpp index 00a5ccb..6064fab 100644 --- a/liboverlay/overlayLib.cpp +++ b/liboverlay/overlayLib.cpp @@ -1361,7 +1361,9 @@ bool OverlayDataChannel::setCrop(uint32_t x, uint32_t y, uint32_t w, uint32_t h) return false; } - if (ov.user_data[0] == MDP_ROT_90) { + if ((ov.user_data[0] == MDP_ROT_90) || + (ov.user_data[0] == (MDP_ROT_90 | MDP_FLIP_UD)) || + (ov.user_data[0] == (MDP_ROT_90 | MDP_FLIP_LR))){ if (ov.src.width < (y + h)) return false;