diff options
Diffstat (limited to 'apps/plugins/lib/grey_draw.c')
-rw-r--r-- | apps/plugins/lib/grey_draw.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c index ccb8deae7b..683793129e 100644 --- a/apps/plugins/lib/grey_draw.c +++ b/apps/plugins/lib/grey_draw.c | |||
@@ -634,18 +634,15 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, | |||
634 | if (y + height > _grey_info.height) | 634 | if (y + height > _grey_info.height) |
635 | height = _grey_info.height - y; | 635 | height = _grey_info.height - y; |
636 | 636 | ||
637 | src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */ | 637 | src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */ |
638 | 638 | ||
639 | do | 639 | do |
640 | { | 640 | { |
641 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 641 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
642 | int idx = _GREY_MULUQ(_grey_info.width, y) + x; | 642 | int idx = _GREY_MULUQ(_grey_info.width, y) + x; |
643 | #else | 643 | #else |
644 | #if LCD_DEPTH == 1 | 644 | int idx = _GREY_MULUQ(_grey_info.width, y & ~_GREY_BMASK) |
645 | int idx = _GREY_MULUQ(_grey_info.width, y & ~7) + (x << 3) + (~y & 7); | 645 | + (x << _GREY_BSHIFT) + (~y & _GREY_BMASK); |
646 | #elif LCD_DEPTH == 2 | ||
647 | int idx = _GREY_MULUQ(_grey_info.width, y & ~3) + (x << 2) + (~y & 3); | ||
648 | #endif | ||
649 | #endif /* LCD_PIXELFORMAT */ | 646 | #endif /* LCD_PIXELFORMAT */ |
650 | unsigned char *dst_row = _grey_info.values + idx; | 647 | unsigned char *dst_row = _grey_info.values + idx; |
651 | const unsigned char *src_row = src; | 648 | const unsigned char *src_row = src; |
@@ -654,7 +651,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, | |||
654 | do | 651 | do |
655 | { | 652 | { |
656 | *dst_row = _grey_info.gvalue[*src_row++]; | 653 | *dst_row = _grey_info.gvalue[*src_row++]; |
657 | dst_row += _GREY_X_ADVANCE; | 654 | dst_row += _GREY_BSIZE; |
658 | } | 655 | } |
659 | while (src_row < src_end); | 656 | while (src_row < src_end); |
660 | 657 | ||