const int y_offset_main_bg_text_pos = 300;
const int x_offset_prog_bar_img_pos = 240;
const int y_offset_prog_bar_img_pos = 355;
-int rotate_angle = -1;
-int rollback_rotate_angle = 0;
+int rotate_step = 0;
+int rollback_step = 0;
int img_buf_width = 0;
int img_buf_height = 0;
void _copy_buffers_by_rotate(void *srcptr, int srcw, int srch, int srcstride,
void *dstptr, int dstw, int dsth, int dststride,
int sx, int sy, int sw, int sh,
- int dx, int dy, int dw, int dh, int rotate)
+ int dx, int dy, int dw, int dh, int rstep)
{
pixman_image_t *src_img = NULL, *dst_img = NULL;
pixman_op_t op;
struct pixman_f_transform ft;
double scale_x, scale_y;
- int rotate_step;
pixman_transform_t t;
pixman_f_transform_init_identity(&ft);
- rotate_step = (rotate + 360) / 90 % 4;
- if (rotate_step > 0) {
+ if (rstep > 0) {
int c = 0, s = 0, tx = 0, ty = 0;
- switch (rotate_step) {
+ switch (rstep) {
case 1:
c = 0, s = -1, tx = -dw;
break;
pixman_f_transform_rotate(&ft, NULL, c, s);
}
- if (rotate_step % 2 == 0) {
+ if (rstep % 2 == 0) {
scale_x = (double)sw / dw;
scale_y = (double)sh / dh;
} else {
_copy_buffers_by_rotate(surface_info_ori.planes[0].ptr, surface_info_ori.width, surface_info_ori.height, surface_info_ori.planes[0].stride,
fbi->buf[0], fbi->w, fbi->h, fbi->w * RGB32_PITCH,
0,0,surface_info_ori.width, surface_info_ori.height,
- 0,0,fbi->w, fbi->h, rotate_angle);
+ 0,0,fbi->w, fbi->h, rotate_step);
tbm_surface_unmap(tbm_surface_ori);
tbm_surface_destroy(tbm_surface_ori);
}
void _get_rotate(void)
{
char *rotate_state = getenv("ROTATE_STATE");
+ int rotate_angle = -1;
if(!rotate_state)
{
rotate_angle = ROTATE;
}
LOG("Print Rotate Angle value = %d\n", rotate_angle);
- rollback_rotate_angle = 360 - rotate_angle;
- int rotate_step = (rotate_angle + 360) / 90 % 4;
+ rotate_step = (rotate_angle + 360) / 90 % 4;
+ rollback_step = (4 - rotate_step) % 4;
+ LOG("rotate_step = %d, rollback_step = %d\n", rotate_step, rollback_step);
+
if (rotate_step % 2 == 0) {
img_buf_width = s_fbi.w;
img_buf_height = s_fbi.h;