summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Diaz Prado <a0273371@ti.com>2012-09-21 18:05:11 -0500
committerJason Simmons <jsimmons@google.com>2012-10-22 16:05:54 -0700
commit42428ff2ee69e996b145a3b6c9d5791e0cef45e7 (patch)
tree1768a946c838e2e806d4b140eef28fd8b5046864
parent2e285518874217f7e04bd79cb5090c780c5c34ad (diff)
downloadomap4-aah-42428ff2ee69e996b145a3b6c9d5791e0cef45e7.tar.gz
hwc: rgz: Fix incorrect src rectangle calculation for scaled layers
When scaling a layer, the blit is programmed in a way where the src rectangle uses the whole cropping rectangle coordinates and dimensions. However if the layer has a transform, the width and the height need to be swapped not only in the geometry but also in the src rectangle to match the new dimensions. This patch adds the missing width and height swapping for the src rectangle if the transformation is 90 or 270 degrees. Change-Id: Ia9d822b6698210573fff662f2fcb129dfc048bf7 Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com> (cherry picked from commit a80084da8fb2c63a2e44ef9d4ce7598b7cad853f)
-rw-r--r--hwc/rgz_2d.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hwc/rgz_2d.c b/hwc/rgz_2d.c
index 60cc8a6..5c4d1a9 100644
--- a/hwc/rgz_2d.c
+++ b/hwc/rgz_2d.c
@@ -1231,13 +1231,16 @@ static void rgz_get_src_rect(hwc_layer_t* layer, blit_rect_t *subregion_rect, bl
* If the layer is scaled we use the whole cropping rectangle from the
* source and just move the clipping rectangle for the region we want to
* blit, this is done to prevent any artifacts when blitting subregions of
- * a scaled layer
+ * a scaled layer. If there is a transform, adjust the width and height
+ * accordingly to match the rotated buffer geometry.
*/
if (rgz_hwc_scaled(layer)) {
delta_top = 0;
delta_left = 0;
res_width = WIDTH(layer->sourceCrop);
res_height = HEIGHT(layer->sourceCrop);
+ if (layer->transform & HAL_TRANSFORM_ROT_90)
+ swap(res_width , res_height);
} else {
delta_top = subregion_rect->top - layer->displayFrame.top;
delta_left = subregion_rect->left - layer->displayFrame.left;