Fix missing case in gdispStreamStop().

Add support for controllers that need flushing.
Add both automatic and manual flushing (via the gdispFlush() method)
This commit is contained in:
inmarket 2013-10-21 13:34:55 +10:00
parent 51f4435cd1
commit 0b9db701a1
9 changed files with 194 additions and 148 deletions

View File

@ -19,6 +19,7 @@
#define GFX_USE_GMISC TRUE
/* Features for the GDISP sub-system. */
#define GDISP_NEED_AUTOFLUSH FALSE
#define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_CLIP FALSE
#define GDISP_NEED_TEXT FALSE

View File

@ -106,6 +106,9 @@ int main(void) {
}
gdispStreamStop();
// Force a display update if the controller supports it
gdispFlush();
// Calculate the new frame size (note this is a drawing optimisation only)
minx = ballx - radius; miny = bally - radius;
maxx = minx + ballcx; maxy = miny + ballcy;

View File

@ -457,6 +457,15 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
return TRUE;
}
#if GDISP_HARDWARE_FLUSH
LLDSPEC void gdisp_lld_flush(GDisplay *g) {
winPriv * priv;
priv = g->priv;
UpdateWindow(priv->hwnd);
}
#endif
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
winPriv * priv;

View File

@ -22,6 +22,10 @@
/* Driver hardware support. */
/*===========================================================================*/
// Calling gdispGFlush() is optional for this driver but can be used by the
// application to force a display update. eg after streaming.
#define GDISP_HARDWARE_FLUSH TRUE
#define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_FILLS TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE

View File

@ -34,6 +34,7 @@
#define GFX_USE_GMISC FALSE
/* Features for the GDISP subsystem */
#define GDISP_NEED_AUTOFLUSH FALSE
#define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_CLIP TRUE
#define GDISP_NEED_TEXT TRUE

View File

@ -395,6 +395,27 @@ void gdispSetDisplay(GDisplay *g);
/* Drawing Functions */
/**
* @brief Flush current drawing operations to the display
* @note Some low level drivers do not update the display until
* the display is flushed. For others it is optional but can
* help prevent tearing effects. For some it is ignored.
* Calling it at the end of a logic set of drawing operations
* in your application will ensure controller portability. If you
* know your controller does not need to be flushed there is no
* need to call it (which is in reality most controllers).
* @note Even for displays that require flushing, there is no need to
* call this function if GDISP_NEED_AUTOFLUSH is TRUE.
* Calling it again won't hurt though.
*
*
* @param[in] display The display number (0..n)
*
* @api
*/
void gdispGFlush(GDisplay *g);
#define gdispFlush() gdispGFlush(GDISP)
/**
* @brief Clear the display to the specified color.
*

View File

@ -34,6 +34,17 @@
* @name GDISP hardware accelerated support
* @{
*/
/**
* @brief The display hardware can benefit from being flushed.
* @details Can be set to TRUE, FALSE or HARDWARE_AUTODETECT
*
* @note HARDWARE_AUTODETECT is only meaningful when GDISP_TOTAL_CONTROLLERS > 1
* @note Some controllers ** require ** the application to flush
*/
#ifndef GDISP_HARDWARE_FLUSH
#define GDISP_HARDWARE_FLUSH HARDWARE_DEFAULT
#endif
/**
* @brief Hardware streaming writing is supported.
* @details Can be set to TRUE, FALSE or HARDWARE_AUTODETECT
@ -247,6 +258,18 @@ struct GDisplay {
*/
LLDSPEC bool_t gdisp_lld_init(GDisplay *g);
#if GDISP_HARDWARE_FLUSH || defined(__DOXYGEN__)
/**
* @brief Flush the current drawing operations to the display
* @pre GDISP_HARDWARE_FLUSH is TRUE
*
* @param[in] g The driver structure
*
* @note The parameter variables must not be altered by the driver.
*/
LLDSPEC void gdisp_lld_flush(GDisplay *g);
#endif
#if GDISP_HARDWARE_STREAM_WRITE || defined(__DOXYGEN__)
/**
* @brief Start a streamed write operation
@ -495,6 +518,7 @@ struct GDisplay {
void (*control)(GDisplay *g); // Uses p.x (=what) p.ptr (=value)
void *(*query)(GDisplay *g); // Uses p.x (=what);
void (*setclip)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy
void (*flush)(GDisplay *g); // Uses no parameters
} GDISPVMT;
#if defined(GDISP_DRIVER_VMT)
@ -503,6 +527,11 @@ struct GDisplay {
#endif
const GDISPVMT const GDISP_DRIVER_VMT[1] = {{
gdisp_lld_init,
#if GDISP_HARDWARE_FLUSH
gdisp_lld_flush,
#else
0,
#endif
#if GDISP_HARDWARE_STREAM_WRITE
gdisp_lld_write_start,
#if GDISP_HARDWARE_STREAM_POS
@ -571,6 +600,7 @@ struct GDisplay {
#else
#define gdisp_lld_init(g) g->vmt->init(g)
#define gdisp_lld_flush(g) g->vmt->flush(g)
#define gdisp_lld_write_start(g) g->vmt->writestart(g)
#define gdisp_lld_write_pos(g) g->vmt->writepos(g)
#define gdisp_lld_write_color(g) g->vmt->writecolor(g)
@ -591,34 +621,34 @@ struct GDisplay {
#endif // GDISP_TOTAL_CONTROLLERS > 1
/* Verify information for packed pixels and define a non-packed pixel macro */
#if !GDISP_PACKED_PIXELS
#define gdispPackPixels(buf,cx,x,y,c) { ((color_t *)(buf))[(y)*(cx)+(x)] = (c); }
#elif !GDISP_HARDWARE_BITFILLS
#error "GDISP: packed pixel formats are only supported for hardware accelerated drivers."
#elif GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB888 \
&& GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB444 \
&& GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB666 \
&& GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_CUSTOM
#error "GDISP: A packed pixel format has been specified for an unsupported pixel format."
#endif
/* Verify information for packed pixels and define a non-packed pixel macro */
#if !GDISP_PACKED_PIXELS
#define gdispPackPixels(buf,cx,x,y,c) { ((color_t *)(buf))[(y)*(cx)+(x)] = (c); }
#elif !GDISP_HARDWARE_BITFILLS
#error "GDISP: packed pixel formats are only supported for hardware accelerated drivers."
#elif GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB888 \
&& GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB444 \
&& GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB666 \
&& GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_CUSTOM
#error "GDISP: A packed pixel format has been specified for an unsupported pixel format."
#endif
/* Support routine for packed pixel formats */
#if !defined(gdispPackPixels) || defined(__DOXYGEN__)
/**
* @brief Pack a pixel into a pixel buffer.
* @note This function performs no buffer boundary checking
* regardless of whether GDISP_NEED_CLIP has been specified.
*
* @param[in] buf The buffer to put the pixel in
* @param[in] cx The width of a pixel line
* @param[in] x, y The location of the pixel to place
* @param[in] color The color to put into the buffer
*
* @api
*/
void gdispPackPixels(const pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color);
#endif
/* Support routine for packed pixel formats */
#if !defined(gdispPackPixels) || defined(__DOXYGEN__)
/**
* @brief Pack a pixel into a pixel buffer.
* @note This function performs no buffer boundary checking
* regardless of whether GDISP_NEED_CLIP has been specified.
*
* @param[in] buf The buffer to put the pixel in
* @param[in] cx The width of a pixel line
* @param[in] x, y The location of the pixel to place
* @param[in] color The color to put into the buffer
*
* @api
*/
void gdispPackPixels(const pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color);
#endif
#endif /* GFX_USE_GDISP */

View File

@ -20,6 +20,20 @@
* @name GDISP Functionality to be included
* @{
*/
/**
* @brief Should drawing operations be automatically flushed.
* @details Defaults to FALSE
* @note If set to FALSE and the controller requires flushing
* then the application must manually call @p gdispGFlush().
* Setting this to TRUE causes GDISP to automatically flush
* after each drawing operation. Note this may be slow but enables
* an application to avoid having to manually call the flush routine.
* @note Most controllers don't need flushing which is why this is set to
* FALSE by default.
*/
#ifndef GDISP_NEED_AUTOFLUSH
#define GDISP_NEED_AUTOFLUSH FALSE
#endif
/**
* @brief Should all operations be clipped to the screen and colors validated.
* @details Defaults to TRUE.

View File

@ -94,6 +94,27 @@ GDisplay *GDISP = GDisplayArray;
}
#endif
#if GDISP_NEED_AUTOFLUSH && GDISP_HARDWARE_FLUSH == HARDWARE_AUTODETECT
#define autoflush_stopdone(g) if (g->vmt->flush) gdisp_lld_flush(g)
#elif GDISP_NEED_AUTOFLUSH && GDISP_HARDWARE_FLUSH
#define autoflush_stopdone(g) gdisp_lld_flush(g)
#else
#define autoflush_stopdone(g)
#endif
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
#define autoflush(g) \
{ \
if ((g->flags & GDISP_FLG_SCRSTREAM)) { \
gdisp_lld_write_stop(g); \
g->flags &= ~GDISP_FLG_SCRSTREAM; \
}
autoflush_stopdone(g);
}
#else
#define autoflush(g) autoflush_stopdone(g)
#endif
// drawpixel(g)
// Parameters: x,y
// Alters: cx, cy (if using streaming)
@ -551,11 +572,18 @@ void _gdispInit(void) {
#if GDISP_STARTUP_LOGO_TIMEOUT > 0
StatupLogoDisplay(g);
#endif
#if !GDISP_NEED_AUTOFLUSH && GDISP_HARDWARE_FLUSH
gdispGFlush(g);
#endif
}
#if GDISP_STARTUP_LOGO_TIMEOUT > 0
gfxSleepMilliseconds(GDISP_STARTUP_LOGO_TIMEOUT);
for(g = GDisplayArray, i = 0; i < GDISP_TOTAL_DISPLAYS; g++, i++)
for(g = GDisplayArray, i = 0; i < GDISP_TOTAL_DISPLAYS; g++, i++) {
gdispGClear(g, GDISP_STARTUP_COLOR);
#if !GDISP_NEED_AUTOFLUSH && GDISP_HARDWARE_FLUSH
gdispGFlush(g);
#endif
}
#endif
}
@ -569,6 +597,21 @@ void gdispSetDisplay(GDisplay *g) {
if (g) GDISP = g;
}
void gdispGFlush(GDisplay *g) {
#if GDISP_HARDWARE_FLUSH
#if GDISP_HARDWARE_FLUSH == HARDWARE_AUTODETECT
if (g->vmt->flush)
#endif
{
MUTEX_ENTER(g);
gdisp_lld_flush(g);
MUTEX_EXIT(g);
}
#else
(void) g;
#endif
}
#if GDISP_NEED_STREAMING
void gdispGStreamStart(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy) {
MUTEX_ENTER(g);
@ -766,6 +809,7 @@ void gdispSetDisplay(GDisplay *g) {
#endif
{
gdisp_lld_write_stop(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -782,6 +826,7 @@ void gdispSetDisplay(GDisplay *g) {
g->p.ptr = (void *)g->linebuf;
gdisp_lld_blit_area(g);
}
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -799,10 +844,18 @@ void gdispSetDisplay(GDisplay *g) {
else
gdisp_lld_fill_area(g);
}
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
#endif
#if GDISP_HARDWARE_STREAM_WRITE != TRUE && (GDISP_LINEBUF_SIZE == 0 || GDISP_HARDWARE_BITFILLS != TRUE) && GDISP_HARDWARE_FILLS != TRUE
{
autoflush_stopdone(g);
MUTEX_EXIT(g);
}
#endif
}
#endif
@ -812,12 +865,7 @@ void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color) {
g->p.y = y;
g->p.color = color;
drawpixel_clip(g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -829,12 +877,7 @@ void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1,
g->p.y1 = y1;
g->p.color = color;
line_clip(g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -850,6 +893,7 @@ void gdispGClear(GDisplay *g, color_t color) {
{
g->p.color = color;
gdisp_lld_clear(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -866,6 +910,7 @@ void gdispGClear(GDisplay *g, color_t color) {
g->p.cy = g->g.Height;
g->p.color = color;
gdisp_lld_fill_area(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -895,6 +940,7 @@ void gdispGClear(GDisplay *g, color_t color) {
for(; area; area--)
gdisp_lld_write_color(g);
gdisp_lld_write_stop(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -911,6 +957,7 @@ void gdispGClear(GDisplay *g, color_t color) {
for(g->p.y = 0; g->p.y < g->g.Height; g->p.y++)
for(g->p.x = 0; g->p.x < g->g.Width; g->p.x++)
gdisp_lld_draw_pixel(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -927,6 +974,7 @@ void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
TEST_CLIP_AREA(g) {
fillarea(g);
}
autoflush_stopdone(g);
MUTEX_EXIT(g);
}
@ -963,6 +1011,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
g->p.x2 = srccx;
g->p.ptr = (void *)buffer;
gdisp_lld_blit_area(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -998,6 +1047,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
}
}
gdisp_lld_write_stop(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -1032,6 +1082,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
}
}
}
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -1056,6 +1107,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
gdisp_lld_draw_pixel(g);
}
}
autoflush_stopdone(g);
MUTEX_EXIT(g);
return;
}
@ -1136,12 +1188,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
g->p.x = x - a; g->p.y = y + b; drawpixel_clip(g);
g->p.x = x - a; g->p.y = y - b; drawpixel_clip(g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
#endif
@ -1177,12 +1224,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
g->p.y = y+a; g->p.x = x-b; g->p.x1 = x+b; hline_clip(g);
g->p.y = y-a; g->p.x = x-b; g->p.x1 = x+b; hline_clip(g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
#endif
@ -1221,12 +1263,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
}
} while(dy >= 0);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
#endif
@ -1263,12 +1300,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
}
} while(dy >= 0);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
#endif
@ -1336,12 +1368,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
if (full & 0x03) { g->p.x = x+a; g->p.y = y-b; drawpixel_clip(g); }
if (full & 0x30) { g->p.x = x-a; g->p.y = y+b; drawpixel_clip(g); }
if (full == 0xFF) {
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT;
return;
}
@ -1458,12 +1485,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
{ g->p.x = x-a; g->p.y = y+b; drawpixel_clip(g); }
}
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
#endif
@ -1961,12 +1983,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
break;
}
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2246,6 +2263,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
g->p.cy = abslines;
g->p.color = bgcolor;
fillarea(g);
autoflush_stopdone(g);
MUTEX_EXIT(g);
}
#endif
@ -2354,12 +2372,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
}
}
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2376,12 +2389,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
}
g->p.x=tx+p->x; g->p.y=ty+p->y; g->p.x1=tx+pntarray->x; g->p.y1=ty+pntarray->y; line_clip(g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2441,12 +2449,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
}
if (!cnt) {
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
return;
}
@ -2456,12 +2459,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
if (ymax == lpnt->y) {
for (lpnt = lpnt <= pntarray ? epnts : lpnt-1; lpnt->y == y; cnt--) {
if (!cnt) {
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
return;
}
@ -2472,12 +2470,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
} else {
for (rpnt = rpnt >= epnts ? pntarray : rpnt+1; rpnt->y == y; cnt--) {
if (!cnt) {
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
return;
}
@ -2561,12 +2554,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
g->t.clipy1 = y + font->height;
g->t.color = color;
mf_render_character(font, x, y, c, drawcharline, g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2586,12 +2574,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
fillarea(g);
mf_render_character(font, x, y, c, fillcharline, g);
}
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2605,12 +2588,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
g->t.color = color;
mf_render_aligned(font, x+font->baseline_x, y, MF_ALIGN_LEFT, str, 0, drawcharglyph, g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2631,12 +2609,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
mf_render_aligned(font, x+font->baseline_x, y, MF_ALIGN_LEFT, str, 0, fillcharglyph, g);
}
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2665,12 +2638,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
mf_render_aligned(font, x, y, justify, str, 0, drawcharglyph, g);
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}
@ -2709,12 +2677,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
mf_render_aligned(font, x, y, justify, str, 0, fillcharglyph, g);
}
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
if ((g->flags & GDISP_FLG_SCRSTREAM)) {
gdisp_lld_write_stop(g);
g->flags &= ~GDISP_FLG_SCRSTREAM;
}
#endif
autoflush(g);
MUTEX_EXIT(g);
}