sync with RTGUI d24a1ff

fix rtgui/driver and bmp engine bugs.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2223 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
chaos.proton@gmail.com 2012-07-20 18:48:34 +00:00
parent 92a50c838d
commit 8c03104507
4 changed files with 11 additions and 12 deletions

View File

@ -1,8 +1,3 @@
/*
* Change Logs:
* Date Author Notes
* 2012-01-24 onelife fix a bug in framebuffer_draw_raw_hline
*/
#include <rtgui/rtgui_system.h>
#include <rtgui/driver.h>
@ -113,7 +108,7 @@ static void framebuffer_draw_raw_hline(rt_uint8_t *pixels, int x1, int x2, int y
rt_uint8_t *dst;
dst = GET_PIXEL(rtgui_graphic_get_device(), x1, y, rt_uint8_t);
rt_memcpy(dst, pixels, (x2 - x1 + 1) * (rtgui_graphic_get_device()->bits_per_pixel/8));
rt_memcpy(dst, pixels, (x2 - x1) * (rtgui_graphic_get_device()->bits_per_pixel/8));
}
const struct rtgui_graphic_driver_ops _framebuffer_rgb565_ops =

View File

@ -706,11 +706,13 @@ static void rtgui_image_bmp_blit(struct rtgui_image* image, struct rtgui_dc* dc,
blit_line = rtgui_blit_line_get(hw_bytePerPixel, bytePerPixel);
}
for (loadIndex = skipLength; loadIndex < readLength; loadIndex += bytePerPixel << bmp->scale)
for (loadIndex = skipLength;
loadIndex < readLength;
loadIndex += bytePerPixel << bmp->scale)
{
blit_line(temp, &wrkBuffer[loadIndex], bytePerPixel);
dc->engine->blit_line(dc,
dst_rect->x1 + x, dst_rect->x1 + x,
dst_rect->x1 + x, dst_rect->x1 + x + 1,
dst_rect->y1 + image->h - y,
temp);
x++;
@ -803,7 +805,7 @@ static void rtgui_image_bmp_blit(struct rtgui_image* image, struct rtgui_dc* dc,
blit_line(temp, ptr, bytePerPixel);
ptr += bytePerPixel;
dc->engine->blit_line(dc,
dst_rect->x1 + x, dst_rect->x1 + x,
dst_rect->x1 + x, dst_rect->x1 + x + 1,
dst_rect->y1 + y,
temp);
}

View File

@ -2,7 +2,6 @@
* Change Logs:
* Date Author Notes
* 2012-01-24 onelife add mono color support
* 2012-01-24 onelife fix a bug in _pixel_draw_raw_hline
*/
#include <rtgui/rtgui_system.h>
#include <rtgui/driver.h>
@ -140,7 +139,10 @@ static void _pixel_rgb888_draw_vline(rtgui_color_t *c, int x, int y1, int y2)
static void _pixel_draw_raw_hline(rt_uint8_t *pixels, int x1, int x2, int y)
{
gfx_device_ops->blit_line((char*)pixels, x1, x2, y);
if (x2 > x1)
gfx_device_ops->blit_line((char*)pixels, x1, y, (x2 - x1));
else
gfx_device_ops->blit_line((char*)pixels, x2, y, (x1 - x2));
}
/* pixel device */

View File

@ -5,6 +5,6 @@
typedef void (*rtgui_blit_line_func)(rt_uint8_t* dst, rt_uint8_t* src, int line);
rtgui_blit_line_func rtgui_blit_line_get(int dst_bpp, int src_bpp);
rtgui_blit_line_func rtgui_blit_line_get_inv(int dst_bpp, int src_bpp);
rtgui_blit_line_func rtgui_blit_line_get_inv(int dst_bpp, int src_bpp);
#endif