diff options
Diffstat (limited to 'include/gdisp/lld')
-rw-r--r-- | include/gdisp/lld/emulation.c | 187 | ||||
-rw-r--r-- | include/gdisp/lld/gdisp_lld.h | 40 | ||||
-rw-r--r-- | include/gdisp/lld/gdisp_lld_msgs.h | 21 |
3 files changed, 2 insertions, 246 deletions
diff --git a/include/gdisp/lld/emulation.c b/include/gdisp/lld/emulation.c index c897a92d..cb0c9c4b 100644 --- a/include/gdisp/lld/emulation.c +++ b/include/gdisp/lld/emulation.c @@ -461,185 +461,6 @@ GDISPDriver GDISP; } #endif -#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT - #include "gdisp/fonts.h" -#endif - -#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT - void gdisp_lld_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color) { - const fontcolumn_t *ptr; - fontcolumn_t column; - coord_t width, height, xscale, yscale; - coord_t i, j, xs, ys; - - /* Check we actually have something to print */ - width = _getCharWidth(font, c); - if (!width) return; - - xscale = font->xscale; - yscale = font->yscale; - height = font->height * yscale; - width *= xscale; - - ptr = _getCharData(font, c); - - /* Loop through the data and display. The font data is LSBit first, down the column */ - for(i=0; i < width; i+=xscale) { - /* Get the font bitmap data for the column */ - column = *ptr++; - - /* Draw each pixel */ - for(j=0; j < height; j+=yscale, column >>= 1) { - if (column & 0x01) { - for(xs=0; xs < xscale; xs++) - for(ys=0; ys < yscale; ys++) - gdisp_lld_draw_pixel(x+i+xs, y+j+ys, color); - } - } - } - } -#endif - -#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXTFILLS - void gdisp_lld_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) { - coord_t width, height; - coord_t xscale, yscale; - - /* Check we actually have something to print */ - width = _getCharWidth(font, c); - if (!width) return; - - xscale = font->xscale; - yscale = font->yscale; - height = font->height * yscale; - width *= xscale; - - /* Method 1: Use background fill and then draw the text */ - #if GDISP_HARDWARE_TEXT || GDISP_SOFTWARE_TEXTFILLDRAW - - /* Fill the area */ - gdisp_lld_fill_area(x, y, width, height, bgcolor); - - /* Draw the text */ - gdisp_lld_draw_char(x, y, c, font, color); - - /* Method 2: Create a single column bitmap and then blit it */ - #elif GDISP_HARDWARE_BITFILLS && GDISP_SOFTWARE_TEXTBLITCOLUMN - { - const fontcolumn_t *ptr; - fontcolumn_t column; - coord_t i, j, xs, ys; - - /* Working buffer for fast non-transparent text rendering [patch by Badger] - This needs to be larger than the largest character we can print. - Assume the max is double sized by one column. - */ - static pixel_t buf[sizeof(fontcolumn_t)*8*2]; - - #if GDISP_NEED_VALIDATION - /* Check our buffer is big enough */ - if ((unsigned)height > sizeof(buf)/sizeof(buf[0])) return; - #endif - - ptr = _getCharData(font, c); - - /* Loop through the data and display. The font data is LSBit first, down the column */ - for(i = 0; i < width; i+=xscale) { - /* Get the font bitmap data for the column */ - column = *ptr++; - - /* Draw each pixel */ - for(j = 0; j < height; j+=yscale, column >>= 1) { - if (column & 0x01) { - for(ys=0; ys < yscale; ys++) - gdispPackPixels(buf, 1, j+ys, 0, color); - } else { - for(ys=0; ys < yscale; ys++) - gdispPackPixels(buf, 1, j+ys, 0, bgcolor); - } - } - - for(xs=0; xs < xscale; xs++) - gdisp_lld_blit_area_ex(x+i+xs, y, 1, height, 0, 0, 1, buf); - } - } - - /* Method 3: Create a character bitmap and then blit it */ - #elif GDISP_HARDWARE_BITFILLS - { - const fontcolumn_t *ptr; - fontcolumn_t column; - coord_t i, j, xs, ys; - - /* Working buffer for fast non-transparent text rendering [patch by Badger] - This needs to be larger than the largest character we can print. - Assume the max is double sized. - */ - static pixel_t buf[20*(sizeof(fontcolumn_t)*8)*2]; - - #if GDISP_NEED_VALIDATION - /* Check our buffer is big enough */ - if ((unsigned)(width * height) > sizeof(buf)/sizeof(buf[0])) return; - #endif - - ptr = _getCharData(font, c); - - /* Loop through the data and display. The font data is LSBit first, down the column */ - for(i = 0; i < width; i+=xscale) { - /* Get the font bitmap data for the column */ - column = *ptr++; - - /* Draw each pixel */ - for(j = 0; j < height; j+=yscale, column >>= 1) { - if (column & 0x01) { - for(xs=0; xs < xscale; xs++) - for(ys=0; ys < yscale; ys++) - gdispPackPixels(buf, width, i+xs, j+ys, color); - } else { - for(xs=0; xs < xscale; xs++) - for(ys=0; ys < yscale; ys++) - gdispPackPixels(buf, width, i+xs, j+ys, bgcolor); - } - } - } - - /* [Patch by Badger] Write all in one stroke */ - gdisp_lld_blit_area_ex(x, y, width, height, 0, 0, width, buf); - } - - /* Method 4: Draw pixel by pixel */ - #else - { - const fontcolumn_t *ptr; - fontcolumn_t column; - coord_t i, j, xs, ys; - - ptr = _getCharData(font, c); - - /* Loop through the data and display. The font data is LSBit first, down the column */ - for(i = 0; i < width; i+=xscale) { - /* Get the font bitmap data for the column */ - column = *ptr++; - - /* Draw each pixel */ - for(j = 0; j < height; j+=yscale, column >>= 1) { - if (column & 0x01) { - for(xs=0; xs < xscale; xs++) - for(ys=0; ys < yscale; ys++) - gdisp_lld_draw_pixel(x+i+xs, y+j+ys, color); - } else { - for(xs=0; xs < xscale; xs++) - for(ys=0; ys < yscale; ys++) - gdisp_lld_draw_pixel(x+i+xs, y+j+ys, bgcolor); - } - } - } - } - #endif - } -#endif - - #if GDISP_NEED_CONTROL && !GDISP_HARDWARE_CONTROL void gdisp_lld_control(unsigned what, void *value) { (void)what; @@ -707,14 +528,6 @@ void *gdisp_lld_query(unsigned what) { gdisp_lld_fill_circle(msg->fillarc.x, msg->fillarc.y, msg->fillarc.radius, msg->fillarc.startangle, msg->fillarc.endangle, msg->fillarc.color); break; #endif - #if GDISP_NEED_TEXT - case GDISP_LLD_MSG_DRAWCHAR: - gdisp_lld_draw_char(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color); - break; - case GDISP_LLD_MSG_FILLCHAR: - gdisp_lld_fill_char(msg->fillchar.x, msg->fillchar.y, msg->fillchar.c, msg->fillchar.font, msg->fillchar.color, msg->fillchar.bgcolor); - break; - #endif #if GDISP_NEED_PIXELREAD case GDISP_LLD_MSG_GETPIXELCOLOR: msg->getpixelcolor.result = gdisp_lld_get_pixel_color(msg->getpixelcolor.x, msg->getpixelcolor.y); diff --git a/include/gdisp/lld/gdisp_lld.h b/include/gdisp/lld/gdisp_lld.h index afd166ae..98c7569c 100644 --- a/include/gdisp/lld/gdisp_lld.h +++ b/include/gdisp/lld/gdisp_lld.h @@ -107,22 +107,6 @@ #endif /** - * @brief Hardware accelerated text drawing. - * @details If set to @p FALSE software emulation is used. - */ - #ifndef GDISP_HARDWARE_TEXT - #define GDISP_HARDWARE_TEXT FALSE - #endif - - /** - * @brief Hardware accelerated text drawing with a filled background. - * @details If set to @p FALSE software emulation is used. - */ - #ifndef GDISP_HARDWARE_TEXTFILLS - #define GDISP_HARDWARE_TEXTFILLS FALSE - #endif - - /** * @brief Hardware accelerated scrolling. * @details If set to @p FALSE there is no support for scrolling. */ @@ -167,26 +151,6 @@ * @name GDISP software algorithm choices * @{ */ - /** - * @brief For filled text drawing, use a background fill and then draw - * the text instead of using a blit or direct pixel drawing. - * @details If set to @p TRUE background fill and then text draw is used. - * @note This is ignored if hardware accelerated text is supported. - */ - #ifndef GDISP_SOFTWARE_TEXTFILLDRAW - #define GDISP_SOFTWARE_TEXTFILLDRAW FALSE - #endif - - /** - * @brief For filled text drawing, when using a bitmap blit - * use a column by column buffer rather than a full character - * buffer to save memory at a small performance cost. - * @details If set to @p TRUE background fill one character column at a time. - * @note This is ignored if software text using blit is not being used. - */ - #ifndef GDISP_SOFTWARE_TEXTBLITCOLUMN - #define GDISP_SOFTWARE_TEXTBLITCOLUMN FALSE - #endif /** @} */ /** @@ -281,8 +245,8 @@ extern "C" { /* Text Rendering Functions */ #if GDISP_NEED_TEXT - extern void gdisp_lld_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color); - extern void gdisp_lld_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor); + extern void gdisp_lld_draw_char(coord_t x, coord_t y, uint16_t c, font_t font, color_t color); + extern void gdisp_lld_fill_char(coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor); #endif /* Pixel readback */ diff --git a/include/gdisp/lld/gdisp_lld_msgs.h b/include/gdisp/lld/gdisp_lld_msgs.h index f2e0e66e..2c199cbe 100644 --- a/include/gdisp/lld/gdisp_lld_msgs.h +++ b/include/gdisp/lld/gdisp_lld_msgs.h @@ -42,10 +42,6 @@ typedef enum gdisp_msgaction { GDISP_LLD_MSG_DRAWARC, GDISP_LLD_MSG_FILLARC, #endif - #if GDISP_NEED_TEXT - GDISP_LLD_MSG_DRAWCHAR, - GDISP_LLD_MSG_FILLCHAR, - #endif #if GDISP_NEED_PIXELREAD GDISP_LLD_MSG_GETPIXELCOLOR, #endif @@ -151,23 +147,6 @@ typedef union gdisp_lld_msg { coord_t startangle, endangle; color_t color; } fillarc; - struct gdisp_lld_msg_drawchar { - gfxQueueItem qi; - gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWCHAR - coord_t x, y; - char c; - font_t font; - color_t color; - } drawchar; - struct gdisp_lld_msg_fillchar { - gfxQueueItem qi; - gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLCHAR - coord_t x, y; - char c; - font_t font; - color_t color; - color_t bgcolor; - } fillchar; struct gdisp_lld_msg_getpixelcolor { gfxQueueItem qi; gdisp_msgaction_t action; // GDISP_LLD_MSG_GETPIXELCOLOR |