aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-09-25 17:17:05 +1000
committerinmarket <andrewh@inmarket.com.au>2013-09-25 17:17:05 +1000
commit30154560b6f588c42032bce94152676c3756124e (patch)
tree226159e3fc4ca5a125e7ed0724d028d08762fbab
parentc5ceb31e730b31f003b3b61c1172670e6e549994 (diff)
downloaduGFX-30154560b6f588c42032bce94152676c3756124e.tar.gz
uGFX-30154560b6f588c42032bce94152676c3756124e.tar.bz2
uGFX-30154560b6f588c42032bce94152676c3756124e.zip
Rename a macro and fix some bugs
-rw-r--r--drivers/multiple/Win32/gdisp_lld.c6
-rw-r--r--include/gdisp/lld/gdisp_lld.h11
-rw-r--r--src/gdisp/gdisp.c65
3 files changed, 36 insertions, 46 deletions
diff --git a/drivers/multiple/Win32/gdisp_lld.c b/drivers/multiple/Win32/gdisp_lld.c
index 0f1a0b03..f55f3700 100644
--- a/drivers/multiple/Win32/gdisp_lld.c
+++ b/drivers/multiple/Win32/gdisp_lld.c
@@ -287,12 +287,6 @@ static DECLARE_THREAD_FUNCTION(WindowThread, param) {
/* Driver exported functions. */
/*===========================================================================*/
-/**
- * @brief Low level GDISP driver initialization.
- * @return TRUE if successful, FALSE on error.
- *
- * @notapi
- */
LLDSPEC bool_t gdisp_lld_init(GDISPDriver *g) {
RECT rect;
gfxThreadHandle hth;
diff --git a/include/gdisp/lld/gdisp_lld.h b/include/gdisp/lld/gdisp_lld.h
index 3698efb0..6efdb6bb 100644
--- a/include/gdisp/lld/gdisp_lld.h
+++ b/include/gdisp/lld/gdisp_lld.h
@@ -45,8 +45,8 @@
* @brief Hardware streaming requires an explicit end call.
* @details If set to @p FALSE if an explicit stream end call is not required.
*/
- #ifndef GDISP_HARDWARE_STREAM_END
- #define GDISP_HARDWARE_STREAM_END FALSE
+ #ifndef GDISP_HARDWARE_STREAM_STOP
+ #define GDISP_HARDWARE_STREAM_STOP FALSE
#endif
/**
@@ -143,6 +143,7 @@ typedef struct GDISPDriver {
uint16_t flags;
#define GDISP_FLG_INSTREAM 0x0001
+ #define GDISP_FLG_DRIVER 0x0002 // This flags and above are for use by the driver
// Multithread Mutex
#if GDISP_NEED_MULTITHREAD
@@ -241,10 +242,10 @@ typedef struct GDISPDriver {
LLDSPEC color_t gdisp_lld_stream_read(GDISPDriver *g);
#endif
- #if GDISP_HARDWARE_STREAM_END || defined(__DOXYGEN__)
+ #if GDISP_HARDWARE_STREAM_STOP || defined(__DOXYGEN__)
/**
* @brief End the current streaming operation
- * @pre GDISP_HARDWARE_STREAM and GDISP_HARDWARE_STREAM_END is TRUE
+ * @pre GDISP_HARDWARE_STREAM and GDISP_HARDWARE_STREAM_STOP is TRUE
*
* @param[in] g The driver structure
*
@@ -421,7 +422,7 @@ typedef struct GDISPDriver {
gdisp_lld_stream_start,
gdisp_lld_stream_color,
gdisp_lld_stream_read,
- #if GDISP_HARDWARE_STREAM_END
+ #if GDISP_HARDWARE_STREAM_STOP
gdisp_lld_stream_stop,
#else
0,
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 8ec2c998..2e423764 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -48,9 +48,9 @@ GDISPControl *GDISP = &GDISP_DRIVER_STRUCT.g;
#define MUTEX_EXIT()
#endif
-#if GDISP_HARDWARE_STREAM_END
+#if GDISP_HARDWARE_STREAM_STOP
#define STREAM_CLEAR() if ((GC->flags & GDISP_FLG_INSTREAM)) { \
- gdisp_lld_stream_end(GC); \
+ gdisp_lld_stream_stop(GC); \
GC->flags &= ~GDISP_FLG_INSTREAM; \
}
#else
@@ -84,11 +84,11 @@ GDISPControl *GDISP = &GDISP_DRIVER_STRUCT.g;
return;
#endif
- GC->cx = GC->cy = 1;
+ GC->p.cx = GC->p.cy = 1;
gdisp_lld_stream_start(GC);
gdisp_lld_stream_color(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
}
#endif
@@ -110,8 +110,8 @@ GDISPControl *GDISP = &GDISP_DRIVER_STRUCT.g;
gdisp_lld_stream_start(GC);
for(; area; area--)
gdisp_lld_stream_color(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
}
#else
@@ -170,8 +170,8 @@ static void hline_clip(void) {
GC->p.cx = GC->p.cy = 1;
gdisp_lld_stream_start(GC);
gdisp_lld_stream_color(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#endif
return;
@@ -186,10 +186,11 @@ static void hline_clip(void) {
#elif GDISP_HARDWARE_STREAM
// Next best is streaming
GC->p.cx = GC->p.x1 - GC->p.x;
+ GC->p.cy = 1;
gdisp_lld_stream_start(GC);
do { gdisp_lld_stream_color(GC); } while(GC->p.cx--);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#else
// Worst is drawing pixels
@@ -227,8 +228,8 @@ static void vline_clip(void) {
GC->p.cx = GC->p.cy = 1;
gdisp_lld_stream_start(GC);
gdisp_lld_stream_color(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#endif
return;
@@ -243,10 +244,11 @@ static void vline_clip(void) {
#elif GDISP_HARDWARE_STREAM
// Next best is streaming
GC->p.cy = GC->p.y1 - GC->p.y;
+ GC->p.cx = 1;
gdisp_lld_stream_start(GC);
do { gdisp_lld_stream_color(GC); } while(GC->p.cy--);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#else
// Worst is drawing pixels
@@ -398,7 +400,7 @@ void _gdispInit(void) {
void gdispStreamColor(color_t color) {
#if !GDISP_HARDWARE_STREAM && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
- coord_t sx1, sy1, sx2;
+ coord_t sx1, sy1;
#endif
// Don't touch the mutex as we should already own it
@@ -417,17 +419,14 @@ void _gdispInit(void) {
if (GC->p.cx >= GDISP_LINEBUF_SIZE) {
sx1 = GC->p.x1;
sy1 = GC->p.y1;
- //sx2 = GC->p.x2;
GC->p.x -= GC->p.cx;
GC->p.cy = 1;
GC->p.x1 = 0;
GC->p.y1 = 0;
- //GC->p.x2 = GC->p.cx;
GC->p.ptr = (void *)GC->linebuf;
gdisp_lld_blit_area(GC);
GC->p.x1 = sx1;
GC->p.y1 = sy1;
- //GC->p.x2 = sx2;
GC->p.x += GC->p.cx;
GC->p.cx = 0;
}
@@ -437,17 +436,14 @@ void _gdispInit(void) {
if (GC->p.cx) {
sx1 = GC->p.x1;
sy1 = GC->p.y1;
- //sx2 = GC->p.x2;
GC->p.x -= GC->p.cx;
GC->p.cy = 1;
GC->p.x1 = 0;
GC->p.y1 = 0;
- //GC->p.x2 = GC->p.cx;
GC->p.ptr = (void *)GC->linebuf;
gdisp_lld_blit_area(GC);
GC->p.x1 = sx1;
GC->p.y1 = sy1;
- //GC->p.x2 = sx2;
GC->p.cx = 0;
}
GC->p.x = GC->p.x1;
@@ -474,8 +470,8 @@ void _gdispInit(void) {
return;
#if GDISP_HARDWARE_STREAM
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#elif GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
if (GC->p.cx) {
@@ -483,7 +479,6 @@ void _gdispInit(void) {
GC->p.cy = 1;
GC->p.x1 = 0;
GC->p.y1 = 0;
- //GC->p.x2 = GC->p.cx;
GC->p.ptr = (void *)GC->linebuf;
gdisp_lld_blit_area(GC);
}
@@ -541,8 +536,8 @@ void gdispClear(color_t color) {
gdisp_lld_stream_start(GC);
for(; area; area--)
gdisp_lld_stream_color(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#else
// Worst is drawing pixels
@@ -607,8 +602,8 @@ void gdispBlitAreaEx(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx,
gdisp_lld_stream_color(GC);
}
}
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#else
// Worst is drawing pixels
@@ -1532,8 +1527,8 @@ void gdispBlitAreaEx(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx,
GC->p.cy = 1;
gdisp_lld_stream_start(GC);
c = gdisp_lld_stream_read(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#else
// Worst is "not possible"
@@ -1607,8 +1602,8 @@ void gdispBlitAreaEx(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx,
gdisp_lld_stream_start(GC);
for(j=0; j < fx; j++)
GC->linebuf[j] = gdisp_lld_stream_read(GC);
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#elif GDISP_HARDWARE_PIXELREAD
// Next best is single pixel reads
@@ -1645,8 +1640,8 @@ void gdispBlitAreaEx(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx,
GC->p.color = GC->linebuf[j];
gdisp_lld_stream_color(GC);
}
- #if GDISP_HARDWARE_STREAM_END
- gdisp_lld_stream_end(GC);
+ #if GDISP_HARDWARE_STREAM_STOP
+ gdisp_lld_stream_stop(GC);
#endif
#else
// Worst is drawing pixels