summaryrefslogtreecommitdiffstats
path: root/hwc
diff options
context:
space:
mode:
authorGustavo Diaz Prado <a0273371@ti.com>2012-09-21 18:05:11 -0500
committerDaniel Levin <dendy@ti.com>2012-11-28 21:16:25 +0200
commit1ced496e34e8c897eddb7b1f6198dce4bdef198b (patch)
treec69750b05a1799542a793113ec13cad7d1765135 /hwc
parent24121458095a9f7be6e724d013c5c9ff65f04d11 (diff)
downloadhardware_ti_omap4-1ced496e34e8c897eddb7b1f6198dce4bdef198b.zip
hardware_ti_omap4-1ced496e34e8c897eddb7b1f6198dce4bdef198b.tar.gz
hardware_ti_omap4-1ced496e34e8c897eddb7b1f6198dce4bdef198b.tar.bz2
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>
Diffstat (limited to 'hwc')
-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;