libcopybit : Fix calculation of copybit source rect for blit
- Fix the copybit source rect calculation for 180 and 270 degrees rotation. Calculate blit rects based on the source crop. CRs-fixed: 337366 (cherry picked from commit 06aa97757bd7023234d3852801e05e077aaa1d2f) Change-Id: Iba2e230acd84271fc5649e06918824752aa90670
This commit is contained in:
parent
917a203129
commit
2e18b6b9b2
@ -189,17 +189,17 @@ static void set_rects(struct copybit_context_t *dev,
|
||||
|
||||
if (dev->mFlags & COPYBIT_TRANSFORM_FLIP_V) {
|
||||
if (dev->mFlags & COPYBIT_TRANSFORM_ROT_90) {
|
||||
e->src_rect.x = e->src.width - (e->src_rect.x + e->src_rect.w) - horiz_padding;
|
||||
e->src_rect.x = (src->l + src->r) - (e->src_rect.x + e->src_rect.w);
|
||||
}else{
|
||||
e->src_rect.y = e->src.height - (e->src_rect.y + e->src_rect.h) - vert_padding;
|
||||
e->src_rect.y = (src->t + src->b) - (e->src_rect.y + e->src_rect.h);
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->mFlags & COPYBIT_TRANSFORM_FLIP_H) {
|
||||
if (dev->mFlags & COPYBIT_TRANSFORM_ROT_90) {
|
||||
e->src_rect.y = e->src.height - (e->src_rect.y + e->src_rect.h) - vert_padding;
|
||||
e->src_rect.y = (src->t + src->b) - (e->src_rect.y + e->src_rect.h);
|
||||
}else{
|
||||
e->src_rect.x = e->src.width - (e->src_rect.x + e->src_rect.w) - horiz_padding;
|
||||
e->src_rect.x = (src->l + src->r) - (e->src_rect.x + e->src_rect.w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user