rename hardware dc to client dc.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@836 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong
2010-08-09 10:11:45 +00:00
parent 2e0297c527
commit 82239341b5
8 changed files with 557 additions and 32 deletions
+2 -2
View File
@@ -254,7 +254,7 @@ static void rtgui_dc_buffer_blit(struct rtgui_dc* self, struct rtgui_point* dc_p
if (dc_point == RT_NULL) dc_point = &rtgui_empty_point;
if (dest->type == RTGUI_DC_HW)
if ((dest->type == RTGUI_DC_HW) || (dest->type == RTGUI_DC_CLIENT))
{
rtgui_color_t* pixel;
rt_uint8_t *line_ptr;
@@ -305,7 +305,7 @@ static void rtgui_dc_buffer_blit(struct rtgui_dc* self, struct rtgui_point* dc_p
pixel += dc->width;
/* draw on hardware dc */
rtgui_dc_hw_draw_raw_hline(hw, line_ptr, rect->x1, rect->x1 + rect_width, index);
rtgui_dc_client_draw_raw_hline(hw, line_ptr, rect->x1, rect->x1 + rect_width, index);
}
/* release line buffer */
File diff suppressed because it is too large Load Diff
-22
View File
@@ -36,16 +36,6 @@ static void rtgui_dc_hw_get_rect(struct rtgui_dc* dc, rtgui_rect_t* rect);
#define dc_set_foreground(c) dc->gc.foreground = c
#define dc_set_background(c) dc->gc.background = c
struct rtgui_dc* rtgui_dc_begin_drawing(rtgui_widget_t* owner)
{
return rtgui_dc_hw_create(owner);
}
void rtgui_dc_end_drawing(struct rtgui_dc* dc)
{
rtgui_dc_hw_fini(dc);
}
const struct rtgui_dc_engine dc_hw_engine =
{
rtgui_dc_hw_draw_point,
@@ -64,17 +54,6 @@ const struct rtgui_dc_engine dc_hw_engine =
rtgui_dc_hw_fini,
};
void rtgui_dc_hw_init(rtgui_widget_t* owner)
{
struct rtgui_dc* dc;
RT_ASSERT(owner != RT_NULL);
dc = RTGUI_WIDGET_DC(owner);
dc->type = RTGUI_DC_HW;
dc->engine = &dc_hw_engine;
}
extern struct rt_mutex cursor_mutex;
extern void rtgui_mouse_show_cursor(void);
extern void rtgui_mouse_hide_cursor(void);
@@ -233,7 +212,6 @@ static void rtgui_dc_hw_draw_point(struct rtgui_dc* self, int x, int y)
owner = RTGUI_CONTAINER_OF(self, struct rtgui_widget, dc_type);
if (!RTGUI_WIDGET_IS_DC_VISIBLE(owner)) return;
x = x + owner->extent.x1;
y = y + owner->extent.y1;
+5 -5
View File
@@ -155,7 +155,7 @@ 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) return;
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;
@@ -172,7 +172,7 @@ static void rtgui_image_hdc_blit(struct rtgui_image* image, struct rtgui_dc* dc,
for (y = 0; y < h; y ++)
{
rtgui_dc_hw_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
rtgui_dc_client_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
ptr += hdc->pitch;
}
}
@@ -191,7 +191,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_hw_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
rtgui_dc_client_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
}
rtgui_free(ptr);
@@ -207,7 +207,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)) return;
if (rtgui_dc_get_visible(dc) != RT_TRUE || (dc->type != RTGUI_DC_HW) || (dc->type != RTGUI_DC_CLIENT)) return;
hdc = (struct rtgui_image_hdcmm*) image;
RT_ASSERT(hdc != RT_NULL);
@@ -224,7 +224,7 @@ static void rtgui_image_hdcmm_blit(struct rtgui_image* image, struct rtgui_dc* d
for (y = 0; y < h; y ++)
{
rtgui_dc_hw_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
rtgui_dc_client_draw_raw_hline(dc, ptr, dst_rect->x1, dst_rect->x1 + w, dst_rect->y1 + y);
ptr += hdc->pitch;
}
}
+1
View File
@@ -22,6 +22,7 @@
enum rtgui_dc_type
{
RTGUI_DC_HW,
RTGUI_DC_CLIENT,
RTGUI_DC_BUFFER,
RTGUI_DC_IMLIB2,
};
@@ -0,0 +1,30 @@
/*
* File : dc_buffer.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-04-10 Bernard first version
* 2010-06-14 Bernard embedded hardware dc to each widget
* 2010-08-09 Bernard rename hardware dc to client dc
*/
#ifndef __RTGUI_DC_CLIENT_H__
#define __RTGUI_DC_CLIENT_H__
#include <rtgui/dc.h>
/* create a hardware dc */
struct rtgui_dc* rtgui_dc_client_create(rtgui_widget_t* owner);
void rtgui_dc_client_init(rtgui_widget_t* owner);
/* draw a hline with raw pixel data */
void rtgui_dc_client_draw_raw_hline(struct rtgui_dc* dc, rt_uint8_t* raw_ptr, int x1, int x2, int y);
#endif
-1
View File
@@ -19,7 +19,6 @@
/* create a hardware dc */
struct rtgui_dc* rtgui_dc_hw_create(rtgui_widget_t* owner);
void rtgui_dc_hw_init(rtgui_widget_t* owner);
/* draw a hline with raw pixel data */
void rtgui_dc_hw_draw_raw_hline(struct rtgui_dc* dc, rt_uint8_t* raw_ptr, int x1, int x2, int y);
+2 -2
View File
@@ -13,7 +13,7 @@
* 2010-06-26 Bernard add user_data to widget structure
*/
#include <rtgui/dc_hw.h>
#include <rtgui/dc_client.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/window.h>
#include <rtgui/widgets/view.h>
@@ -63,7 +63,7 @@ static void _rtgui_widget_constructor(rtgui_widget_t *widget)
rtgui_region_init(&(widget->clip));
/* init hardware dc */
rtgui_dc_hw_init(widget);
rtgui_dc_client_init(widget);
}
/* Destroys the widget */