add blit_line to DC.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@858 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong
2010-08-17 11:33:18 +00:00
parent 4a0c2aa831
commit cf6882f35b
8 changed files with 199 additions and 146 deletions

View File

@@ -155,8 +155,6 @@ static void rtgui_image_hdc_blit(struct rtgui_image* image, struct rtgui_dc* dc,
hdc = (struct rtgui_image_hdc*) image->data;
RT_ASSERT(hdc != RT_NULL);
if ((dc->type != RTGUI_DC_HW) && (dc->type != RTGUI_DC_CLIENT)) return;
/* the minimum rect */
if (image->w < rtgui_rect_width(*dst_rect)) w = image->w;
else w = rtgui_rect_width(*dst_rect);
@@ -172,7 +170,7 @@ static void rtgui_image_hdc_blit(struct rtgui_image* image, struct rtgui_dc* dc,
for (y = 0; y < h; y ++)
{
rtgui_dc_client_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
dc->engine->blit_line(dc, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y, ptr);
ptr += hdc->pitch;
}
}
@@ -191,7 +189,7 @@ static void rtgui_image_hdc_blit(struct rtgui_image* image, struct rtgui_dc* dc,
if (rtgui_filerw_read(hdc->filerw, ptr, 1, hdc->pitch) != hdc->pitch)
break; /* read data failed */
rtgui_dc_client_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
dc->engine->blit_line(dc, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y, ptr);
}
rtgui_free(ptr);
@@ -207,7 +205,7 @@ static void rtgui_image_hdcmm_blit(struct rtgui_image* image, struct rtgui_dc* d
RT_ASSERT(image != RT_NULL || dc != RT_NULL || dst_rect != RT_NULL);
/* this dc is not visible */
if (rtgui_dc_get_visible(dc) != RT_TRUE || ((dc->type != RTGUI_DC_HW) && (dc->type != RTGUI_DC_CLIENT))) return;
if (rtgui_dc_get_visible(dc) != RT_TRUE) return;
hdc = (struct rtgui_image_hdcmm*) image;
RT_ASSERT(hdc != RT_NULL);
@@ -224,7 +222,7 @@ static void rtgui_image_hdcmm_blit(struct rtgui_image* image, struct rtgui_dc* d
for (y = 0; y < h; y ++)
{
rtgui_dc_client_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
dc->engine->blit_line(dc, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y, ptr);
ptr += hdc->pitch;
}
}
@@ -234,4 +232,3 @@ void rtgui_image_hdc_init()
/* register hdc on image system */
rtgui_image_register_engine(&rtgui_image_hdc_engine);
}