aboutsummaryrefslogtreecommitdiffstats
path: root/include/gdisp/lld/emulation.c
diff options
context:
space:
mode:
Diffstat (limited to 'include/gdisp/lld/emulation.c')
-rw-r--r--include/gdisp/lld/emulation.c137
1 files changed, 0 insertions, 137 deletions
diff --git a/include/gdisp/lld/emulation.c b/include/gdisp/lld/emulation.c
index 716a3988..cb0c9c4b 100644
--- a/include/gdisp/lld/emulation.c
+++ b/include/gdisp/lld/emulation.c
@@ -461,135 +461,6 @@ GDISPDriver GDISP;
}
#endif
-#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT
- #include "mcufont.h"
-#endif
-
-#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT
- static void gdisp_lld_draw_char_callback(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) {
- color_t color = *(color_t*)state;
- if (alpha == 255)
- {
- if (count == 1)
- gdisp_lld_draw_pixel(x, y, color);
- else
- gdisp_lld_fill_area(x, y, count, 1, color);
- }
-#if GDISP_NEED_ANTIALIAS
- else
- {
- while (count--)
- {
- color_t oldColor;
-
- oldColor = gdisp_lld_get_pixel_color(x, y);
- oldColor = gdispBlendColor(color, oldColor, alpha);
- gdisp_lld_draw_pixel(x, y, oldColor);
-
- x++;
- }
- }
-#endif
- }
-
- void gdisp_lld_draw_char(coord_t x, coord_t y, uint16_t c, font_t font, color_t color) {
- mf_render_character(font, x, y, c, gdisp_lld_draw_char_callback, &color);
- }
-#endif
-
-#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXTFILLS
- typedef struct {
- int16_t x0;
- int16_t y0;
- int16_t x1;
- int16_t y1;
- int16_t x;
- int16_t y;
- color_t fg;
- color_t bg;
- } gdisp_lld_fill_char_state_t;
-
- static void gdisp_lld_fill_char_callback(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) {
- gdisp_lld_fill_char_state_t *s = state;
-
- if (y > s->y && s->x != s->x0)
- {
- /* Fill background to the end of current line */
- gdisp_lld_fill_area(s->x, s->y, s->x1 - s->x, 1, s->bg);
- s->y++;
- s->x = s->x0;
- }
-
- if (y > s->y)
- {
- /* Fill background for given number of full lines */
- gdisp_lld_fill_area(s->x0, s->y, s->x1 - s->x0, y - s->y, s->bg);
- s->y = y;
- }
-
- if (x > s->x)
- {
- /* Fill background from previous X position */
- gdisp_lld_fill_area(s->x, s->y, x - s->x, 1, s->bg);
- s->x = x;
- }
-
- if (!count)
- return;
-
- if (y == s->y)
- {
- s->x += count;
-
- if (s->x == s->x1)
- {
- s->x = s->x0;
- s->y++;
- }
- }
-
- /* Draw the foreground */
- if (alpha == 255 || alpha == 0)
- {
- if (count == 1)
- gdisp_lld_draw_pixel(x, y, alpha ? s->fg : s->bg);
- else
- gdisp_lld_fill_area(x, y, count, 1, alpha ? s->fg : s->bg);
- }
-#if GDISP_NEED_ANTIALIAS
- else
- {
- while (count--)
- {
- color_t color;
- color = gdispBlendColor(s->fg, s->bg, alpha);
- gdisp_lld_draw_pixel(x, y, color);
-
- x++;
- }
- }
-#endif
- }
-
- void gdisp_lld_fill_char(coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor) {
- gdisp_lld_fill_char_state_t state;
-
- state.x0 = x;
- state.y0 = y;
- state.x1 = x + mf_character_width(font, c) + font->baseline_x;
- state.y1 = y + font->height;
- state.x = x;
- state.y = y;
- state.fg = color;
- state.bg = bgcolor;
-
- mf_render_character(font, x, y, c, gdisp_lld_fill_char_callback, &state);
-
- gdisp_lld_fill_char_callback(state.x0, state.y1, 0, 0, &state);
- }
-#endif
-
-
#if GDISP_NEED_CONTROL && !GDISP_HARDWARE_CONTROL
void gdisp_lld_control(unsigned what, void *value) {
(void)what;
@@ -657,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);