From f90406e9e126abde623fcb5cf21f0152bda99d6b Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Fri, 25 Mar 2011 14:18:34 -0700 Subject: [PATCH] copybit_c2d: Use the framebuffer stride to calculate position Use the framebuffer stride instead of the framebuffer width when calculating the position for rotation. CRs-fixed: 280765 --- libcopybit/copybit_c2d.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index d3d757a..cf3df66 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2008 The Android Open Source Project - * Copyright (c) 2010, Code Aurora Forum. All rights reserved. + * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -538,7 +538,7 @@ static void set_rects(struct copybit_context_t *ctx, (ctx->trg_transform & C2D_TARGET_ROTATE_180)) { /* target rotation is 270 */ c2dObject->target_rect.x = (dst->t)<<16; - c2dObject->target_rect.y = (ctx->fb_width - (dst->r))<<16; + c2dObject->target_rect.y = (ALIGN(ctx->fb_width,32) - (dst->r))<<16; c2dObject->target_rect.height = ((dst->r) - (dst->l))<<16; c2dObject->target_rect.width = ((dst->b) - (dst->t))<<16; } else if(ctx->trg_transform & C2D_TARGET_ROTATE_90) { @@ -548,7 +548,7 @@ static void set_rects(struct copybit_context_t *ctx, c2dObject->target_rect.width = ((dst->b) - (dst->t))<<16; } else if(ctx->trg_transform & C2D_TARGET_ROTATE_180) { c2dObject->target_rect.y = (ctx->fb_height - dst->b)<<16; - c2dObject->target_rect.x = (ctx->fb_width - dst->r)<<16; + c2dObject->target_rect.x = (ALIGN(ctx->fb_width,32) - dst->r)<<16; c2dObject->target_rect.height = ((dst->b) - (dst->t))<<16; c2dObject->target_rect.width = ((dst->r) - (dst->l))<<16; } else {