From 6ec5b1553fedcd0366f50943d3bba97af0234d1c Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Mon, 7 Mar 2011 17:39:18 -0800 Subject: [PATCH] hardware/msm7k : Fix centering of low resolution clips Change-Id: I90825fd77376325fe9427d1a739be4bec13ff1e3 CRs-fixed: 269485 --- liboverlay/overlayLib.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/liboverlay/overlayLib.cpp b/liboverlay/overlayLib.cpp index 222adb5..0dad1d9 100644 --- a/liboverlay/overlayLib.cpp +++ b/liboverlay/overlayLib.cpp @@ -412,9 +412,11 @@ bool OverlayControlChannel::setPosition(int x, int y, uint32_t w, uint32_t h) { /* Scaling of upto a max of 8 times supported */ if(w >(ov.src_rect.w * HW_OVERLAY_MAGNIFICATION_LIMIT)){ w = HW_OVERLAY_MAGNIFICATION_LIMIT * ov.src_rect.w; + x = (mFBWidth - w) / 2; } if(h >(ov.src_rect.h * HW_OVERLAY_MAGNIFICATION_LIMIT)) { h = HW_OVERLAY_MAGNIFICATION_LIMIT * ov.src_rect.h; + y = (mFBHeight - h) / 2; } ov.dst_rect.x = x; ov.dst_rect.y = y;