提交 8c031045 编写于 作者: C chaos.proton@gmail.com

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
上级 92a50c83
/*
* 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 =
......
......@@ -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);
}
......
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册