From 3a8d39980b9124fe899605cb5350f42d093b1a10 Mon Sep 17 00:00:00 2001 From: Andrew Hannam Date: Mon, 10 Sep 2012 15:54:22 +1000 Subject: Changes to Console, VMT, BitBlt, Clip & Drivers Console - Fix compile, add GDISP_NEED_CONSOLE for compilation VMT - Fix after directory structure changes BitBlt - Update API to allow a source bitmap position. Clip - Add clipping support into gdisp Arc - Allow hardware accelleration of Arc routines Nokia6610 - Fixes to BitBlt. --- include/console.h | 140 ++++++++++++++----------------------- include/gdisp.h | 28 ++++++-- include/gdisp_emulation.c | 175 ++++++++++++++++++++++++++++++++++++++++++---- include/gdisp_lld.h | 53 +++++++++++++- include/gdisp_lld_msgs.h | 28 ++++++++ 5 files changed, 317 insertions(+), 107 deletions(-) (limited to 'include') diff --git a/include/console.h b/include/console.h index edd8498e..7a2f25e9 100644 --- a/include/console.h +++ b/include/console.h @@ -1,87 +1,53 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef CONSOLE_H -#define CONSOLE_H - -#include "ch.h" -#include "hal.h" - -#include "gdisp.h" - -/** - * @brief Structure representing a GLCD driver. - */ -typedef struct GLCDConsole GLCDConsole; - -/** - * @brief @p GLCDConsole specific methods. - */ -#define _glcd_driver_methods \ - _base_asynchronous_channel_methods - -/** - * @extends BaseAsynchronousChannelVMT - * - * @brief @p GLCDConsole virtual methods table. - */ -struct GLCDConsoleVMT { - _glcd_driver_methods -}; - -/** - * @extends BaseAsynchronousChannel - * - * @brief GLCD Console class. - * @details This class extends @p BaseAsynchronousChannel by adding physical - * I/O queues. - */ -struct GLCDConsole { - /** @brief Virtual Methods Table.*/ - const struct GLCDConsoleVMT *vmt; - _base_asynchronous_channel_data - /* WARNING: Do not add any data to this struct above this comment, only below */ - /* font */ - font_t font; - /* lcd area to use */ - coord_t x0,y0; - /* current cursor position, in pixels */ - coord_t cx,cy; - /* console size in pixels */ - coord_t sx,sy; - /* foreground and background colour */ - pixel_t bkcolor, color; - /* font size in pixels */ - uint8_t fy; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -msg_t lcdConsoleInit(GLCDConsole *console, coord_t x0, coord_t y0, coord_t width, coord_t height, font_t font, pixel_t bkcolor, pixel_t color); -msg_t lcdConsolePut(GLCDConsole *console, char c); -msg_t lcdConsoleWrite(GLCDConsole *console, char *bp, size_t n); - -#ifdef __cplusplus -} -#endif - -#endif /* CONSOLE_H */ +/* + ChibiOS/RT - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef CONSOLE_H +#define CONSOLE_H + +#ifdef HAL_USE_GDISP + +#ifndef GDISP_NEED_CONSOLE + #define GDISP_NEED_CONSOLE FALSE +#endif + +#if GDISP_NEED_CONSOLE + +#include "gdisp.h" + +/** + * @brief Structure representing a GConsole driver. + */ +typedef struct GConsole GConsole; + +#ifdef __cplusplus +extern "C" { +#endif + +msg_t lcdConsoleInit(GConsole *console, coord_t x0, coord_t y0, coord_t width, coord_t height, font_t font, pixel_t bkcolor, pixel_t color); +msg_t lcdConsolePut(GConsole *console, char c); +msg_t lcdConsoleWrite(GConsole *console, const uint8_t *bp, size_t n); + +#ifdef __cplusplus +} +#endif + +#endif /* GDISP_NEED_CONSOLE */ +#endif /* HAL_USE_GDISP */ +#endif /* CONSOLE_H */ diff --git a/include/gdisp.h b/include/gdisp.h index 9e856aa9..ce864682 100644 --- a/include/gdisp.h +++ b/include/gdisp.h @@ -163,7 +163,12 @@ extern "C" { void gdispDrawPixel(coord_t x, coord_t y, color_t color); void gdispDrawLine(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color); void gdispFillArea(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); - void gdispBlitArea(coord_t x, coord_t y, coord_t cx, coord_t cy, const pixel_t *buffer); + void gdispBlitAreaEx(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer); + + /* Clipping Functions */ + #if GDISP_NEED_CLIP + void gdispSetClip(coord_t x, coord_t y, coord_t cx, coord_t cy); + #endif /* Circle Functions */ #if GDISP_NEED_CIRCLE @@ -177,6 +182,12 @@ extern "C" { void gdispFillEllipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color); #endif + /* Arc Functions */ + #if GDISP_NEED_ARC + void gdispDrawArc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color); + void gdispFillArc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color); + #endif + /* Basic Text Rendering Functions */ #if GDISP_NEED_TEXT void gdispDrawChar(coord_t x, coord_t y, char c, font_t font, color_t color); @@ -212,9 +223,12 @@ extern "C" { #define gdispDrawPixel(x, y, color) GDISP_LLD(drawpixel)(x, y, color) #define gdispDrawLine(x0, y0, x1, y1, color) GDISP_LLD(drawline)(x0, y0, x1, y1, color) #define gdispFillArea(x, y, cx, cy, color) GDISP_LLD(fillarea)(x, y, cx, cy, color) - #define gdispBlitArea(x, y, cx, cy, buffer) GDISP_LLD(blitarea)(x, y, cx, cy, buffer) + #define gdispBlitAreaEx(x, y, cx, cy, sx, sy, scx, buf) GDISP_LLD(blitareaex)(x, y, cx, cy, sx, sy, scx, buf) + #define gdispSetClip(x, y, cx, cy) GDISP_LLD(setclip)(x, y, cx, cy) #define gdispDrawCircle(x, y, radius, color) GDISP_LLD(drawcircle)(x, y, radius, color) #define gdispFillCircle(x, y, radius, color) GDISP_LLD(fillcircle)(x, y, radius, color) + #define gdispDrawArc(x, y, radius, sangle, eangle, color) GDISP_LLD(drawarc)(x, y, radius, sangle, eangle, color) + #define gdispFillArc(x, y, radius, sangle, eangle, color) GDISP_LLD(fillarc)(x, y, radius, sangle, eangle, color) #define gdispDrawEllipse(x, y, a, b, color) GDISP_LLD(drawellipse)(x, y, a, b, color) #define gdispFillEllipse(x, y, a, b, color) GDISP_LLD(fillellipse)(x, y, a, b, color) #define gdispDrawChar(x, y, c, font, color) GDISP_LLD(drawchar)(x, y, c, font, color) @@ -226,9 +240,11 @@ extern "C" { #endif +/* Now obsolete functions */ +#define gdispBlitArea(x, y, cx, cy, buffer) gdispBlitAreaEx(x, y, cx, cy, 0, 0, cx, buffer) + +/* Extra drawing functions */ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); -void gdispDrawArc(coord_t x, coord_t y, coord_t radius, uint16_t start, uint16_t end, color_t color); -void gdispFillArc(coord_t x, coord_t y, coord_t radius, uint16_t start, uint16_t end, color_t color); /* Extra Text Functions */ #if GDISP_NEED_TEXT @@ -258,6 +274,10 @@ void gdispFillArc(coord_t x, coord_t y, coord_t radius, uint16_t start, uint16_t #define gdispGetBacklight() ((coord_t)(unsigned)gdispQuery(GDISP_QUERY_BACKLIGHT)) #define gdispGetContrast() ((coord_t)(unsigned)gdispQuery(GDISP_QUERY_CONTRAST)) +/* More interesting macro's */ +#define gdispUnsetClip() gdispSetClip(0,0,gdispGetWidth(),gdispGetHeight()) + + #ifdef __cplusplus } #endif diff --git a/include/gdisp_emulation.c b/include/gdisp_emulation.c index cb3773a7..fc82e1b5 100644 --- a/include/gdisp_emulation.c +++ b/include/gdisp_emulation.c @@ -50,6 +50,10 @@ gdisp_powermode_t Powermode; coord_t Backlight; coord_t Contrast; + #if GDISP_NEED_CLIP || GDISP_NEED_VALIDATION + coord_t clipx0, clipy0; + coord_t clipx1, clipy1; /* not inclusive */ + #endif } GDISP; #endif @@ -159,33 +163,52 @@ #endif #if !GDISP_HARDWARE_BITFILLS - void GDISP_LLD(blitarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, const pixel_t *buffer) { + void GDISP_LLD(blitareaex)(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) { coord_t x0, x1, y1; x0 = x; x1 = x + cx; y1 = y + cy; - for(; y < y1; y++) - for(x = x0; x < x1; x++) + buffer += srcy*srccx+srcx; + srccx -= cx; + for(; y < y1; y++, buffer += srccx) + for(x=x0; x < x1; x++) GDISP_LLD(drawpixel)(x, y, *buffer++); } #endif +#if GDISP_NEED_CLIP && !GDISP_HARDWARE_CLIP + void GDISP_LLD(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy) { + #if GDISP_NEED_VALIDATION + if (x >= GDISP.Width || y >= GDISP.Height || cx < 0 || cy < 0) + return; + if (x < 0) x = 0; + if (y < 0) y = 0; + if (x+cx > GDISP.Width) cx = GDISP.Width - x; + if (y+cy > GDISP.Height) cy = GDISP.Height - y; + #endif + GDISP.clipx0 = x; + GDISP.clipy0 = y; + GDISP.clipx1 = x+cx; + GDISP.clipy1 = y+cy; + } +#endif + #if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLES void GDISP_LLD(drawcircle)(coord_t x, coord_t y, coord_t radius, color_t color) { - int16_t a, b, P; + coord_t a, b, P; a = 0; b = radius; P = 1 - radius; do { - GDISP_LLD(drawpixel)(a+x, b+y, color); - GDISP_LLD(drawpixel)(b+x, a+y, color); - GDISP_LLD(drawpixel)(x-a, b+y, color); - GDISP_LLD(drawpixel)(x-b, a+y, color); - GDISP_LLD(drawpixel)(b+x, y-a, color); - GDISP_LLD(drawpixel)(a+x, y-b, color); + GDISP_LLD(drawpixel)(x+a, y+b, color); + GDISP_LLD(drawpixel)(x+b, y+a, color); + GDISP_LLD(drawpixel)(x-a, y+b, color); + GDISP_LLD(drawpixel)(x-b, y+a, color); + GDISP_LLD(drawpixel)(x+b, y-a, color); + GDISP_LLD(drawpixel)(x+a, y-b, color); GDISP_LLD(drawpixel)(x-a, y-b, color); GDISP_LLD(drawpixel)(x-b, y-a, color); if (P < 0) @@ -198,7 +221,7 @@ #if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLEFILLS void GDISP_LLD(fillcircle)(coord_t x, coord_t y, coord_t radius, color_t color) { - int16_t a, b, P; + coord_t a, b, P; a = 0; b = radius; @@ -275,6 +298,115 @@ } #endif +#if GDISP_NEED_ARC && !GDISP_HARDWARE_ARCS + + #include + + /* + * @brief Internal helper function for gdispDrawArc() + * + * @note DO NOT USE DIRECTLY! + * + * @param[in] x, y The middle point of the arc + * @param[in] start The start angle of the arc + * @param[in] end The end angle of the arc + * @param[in] radius The radius of the arc + * @param[in] color The color in which the arc will be drawn + * + * @notapi + */ + static void _draw_arc(coord_t x, coord_t y, uint16_t start, uint16_t end, uint16_t radius, color_t color) { + if (start >= 0 && start <= 180) { + float x_maxI = x + radius*cos(start*M_PI/180); + float x_minI; + + if (end > 180) + x_minI = x - radius; + else + x_minI = x + radius*cos(end*M_PI/180); + + int a = 0; + int b = radius; + int P = 1 - radius; + + do { + if(x-a <= x_maxI && x-a >= x_minI) + GDISP_LLD(drawpixel)(x-a, y+b, color); + if(x+a <= x_maxI && x+a >= x_minI) + GDISP_LLD(drawpixel)(x+a, y+b, color); + if(x-b <= x_maxI && x-b >= x_minI) + GDISP_LLD(drawpixel)(x-b, y+a, color); + if(x+b <= x_maxI && x+b >= x_minI) + GDISP_LLD(drawpixel)(x+b, y+a, color); + + if (P < 0) { + P = P + 3 + 2*a; + a = a + 1; + } else { + P = P + 5 + 2*(a - b); + a = a + 1; + b = b - 1; + } + } while(a <= b); + } + + if (end > 180 && end <= 360) { + float x_maxII = x+radius*cos(end*M_PI/180); + float x_minII; + + if(start <= 180) + x_minII = x - radius; + else + x_minII = x+radius*cos(start*M_PI/180); + + int a = 0; + int b = radius; + int P = 1 - radius; + + do { + if(x-a <= x_maxII && x-a >= x_minII) + GDISP_LLD(drawpixel)(x-a, y-b, color); + if(x+a <= x_maxII && x+a >= x_minII) + GDISP_LLD(drawpixel)(x+a, y-b, color); + if(x-b <= x_maxII && x-b >= x_minII) + GDISP_LLD(drawpixel)(x-b, y-a, color); + if(x+b <= x_maxII && x+b >= x_minII) + GDISP_LLD(drawpixel)(x+b, y-a, color); + + if (P < 0) { + P = P + 3 + 2*a; + a = a + 1; + } else { + P = P + 5 + 2*(a - b); + a = a + 1; + b = b - 1; + } + } while (a <= b); + } + } + + void GDISP_LLD(drawarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) { + if(endangle < startangle) { + _draw_arc(x, y, startangle, 360, radius, color); + _draw_arc(x, y, 0, endangle, radius, color); + } else { + _draw_arc(x, y, startangle, endangle, radius, color); + } + } +#endif + +#if GDISP_NEED_ARC && !GDISP_HARDWARE_ARCFILLS + void GDISP_LLD(fillarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) { + (void)x; + (void)y; + (void)radius; + (void)startangle; + (void)endangle; + (void)color; +#warning "GDISP: FillArc Emulation Not Implemented Yet" + } +#endif + #if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT #include "gdisp_fonts.h" #endif @@ -352,7 +484,7 @@ #if GDISP_NEED_VALIDATION /* Check our buffer is big enough */ - if (height > sizeof(buf)/sizeof(buf[0])) return; + if ((unsigned)height > sizeof(buf)/sizeof(buf[0])) return; #endif ptr = _getCharData(font, c); @@ -374,7 +506,7 @@ } for(xs=0; xs < xscale; xs++) - GDISP_LLD(blitarea)(x+i+xs, y, 1, height, buf); + GDISP_LLD(blitareaex)(x+i+xs, y, 1, height, 0, 0, 1, buf); } } @@ -418,7 +550,7 @@ } /* [Patch by Badger] Write all in one stroke */ - GDISP_LLD(blitarea)(x, y, width, height, buf); + GDISP_LLD(blitareaex)(x, y, width, height, 0, 0, width, buf); } /* Method 4: Draw pixel by pixel */ @@ -492,11 +624,16 @@ void *GDISP_LLD(query)(unsigned what) { GDISP_LLD(fillarea)(msg->fillarea.x, msg->fillarea.y, msg->fillarea.cx, msg->fillarea.cy, msg->fillarea.color); break; case GDISP_LLD_MSG_BLITAREA: - GDISP_LLD(blitarea)(msg->blitarea.x, msg->blitarea.y, msg->blitarea.cx, msg->blitarea.cy, msg->blitarea.buffer); + GDISP_LLD(blitareaex)(msg->blitarea.x, msg->blitarea.y, msg->blitarea.cx, msg->blitarea.cy, msg->blitarea.srcx, msg->blitarea.srcy, msg->blitarea.srccx, msg->blitarea.buffer); break; case GDISP_LLD_MSG_DRAWLINE: GDISP_LLD(drawline)(msg->drawline.x0, msg->drawline.y0, msg->drawline.x1, msg->drawline.y1, msg->drawline.color); break; + #if GDISP_NEED_CLIP + case GDISP_LLD_MSG_SETCLIP: + GDISP_LLD(setclip)(msg->setclip.x, msg->setclip.y, msg->setclip.cx, msg->setclip.cy); + break; + #endif #if GDISP_NEED_CIRCLE case GDISP_LLD_MSG_DRAWCIRCLE: GDISP_LLD(drawcircle)(msg->drawcircle.x, msg->drawcircle.y, msg->drawcircle.radius, msg->drawcircle.color); @@ -513,6 +650,14 @@ void *GDISP_LLD(query)(unsigned what) { GDISP_LLD(fillellipse)(msg->fillellipse.x, msg->fillellipse.y, msg->fillellipse.a, msg->fillellipse.b, msg->fillellipse.color); break; #endif + #if GDISP_NEED_ARC + case GDISP_LLD_MSG_DRAWARC: + GDISP_LLD(drawcircle)(msg->drawarc.x, msg->drawarc.y, msg->drawarc.radius, msg->drawarc.startangle, msg->drawarc.endangle, msg->drawarc.color); + break; + case GDISP_LLD_MSG_FILLARC: + GDISP_LLD(fillcircle)(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(drawchar)(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color); diff --git a/include/gdisp_lld.h b/include/gdisp_lld.h index 91485455..3e265b47 100644 --- a/include/gdisp_lld.h +++ b/include/gdisp_lld.h @@ -69,6 +69,14 @@ #define GDISP_NEED_ELLIPSE TRUE #endif + /** + * @brief Are arc functions needed. + * @details Defaults to FALSE + */ + #ifndef GDISP_NEED_ARC + #define GDISP_NEED_ARC FALSE + #endif + /** * @brief Are text functions needed. * @details Defaults to TRUE @@ -93,6 +101,14 @@ #define GDISP_NEED_PIXELREAD FALSE #endif + /** + * @brief Are clipping functions needed. + * @details Defaults to TRUE + */ + #ifndef GDISP_NEED_CLIP + #define GDISP_NEED_CLIP FALSE + #endif + /** * @brief Control some aspect of the drivers operation. * @details Defaults to FALSE @@ -253,6 +269,22 @@ #define GDISP_HARDWARE_ELLIPSEFILLS FALSE #endif + /** + * @brief Hardware accelerated arc's. + * @details If set to @p FALSE software emulation is used. + */ + #ifndef GDISP_HARDWARE_ARCS + #define GDISP_HARDWARE_ARCS FALSE + #endif + + /** + * @brief Hardware accelerated filled arcs. + * @details If set to @p FALSE software emulation is used. + */ + #ifndef GDISP_HARDWARE_ARCFILLS + #define GDISP_HARDWARE_ARCFILLS FALSE + #endif + /** * @brief Hardware accelerated text drawing. * @details If set to @p FALSE software emulation is used. @@ -300,6 +332,14 @@ #ifndef GDISP_HARDWARE_QUERY #define GDISP_HARDWARE_QUERY FALSE #endif + + /** + * @brief The driver supports a clipping in hardware. + * @details If set to @p FALSE there is no support for non-standard queries. + */ + #ifndef GDISP_HARDWARE_CLIP + #define GDISP_HARDWARE_CLIP FALSE + #endif /** @} */ /** @@ -543,7 +583,7 @@ extern "C" { extern void GDISP_LLD_VMT(clear)(color_t color); extern void GDISP_LLD_VMT(drawpixel)(coord_t x, coord_t y, color_t color); extern void GDISP_LLD_VMT(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); - extern void GDISP_LLD_VMT(blitarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, const pixel_t *buffer); + extern void GDISP_LLD_VMT(blitareaex)(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer); extern void GDISP_LLD_VMT(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color); /* Circular Drawing Functions */ @@ -557,6 +597,12 @@ extern "C" { extern void GDISP_LLD_VMT(fillellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color); #endif + /* Arc Drawing Functions */ + #if GDISP_NEED_ARC + extern void GDISP_LLD_VMT(drawarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color); + extern void GDISP_LLD_VMT(fillarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color); + #endif + /* Text Rendering Functions */ #if GDISP_NEED_TEXT extern void GDISP_LLD_VMT(drawchar)(coord_t x, coord_t y, char c, font_t font, color_t color); @@ -583,6 +629,11 @@ extern "C" { extern void *GDISP_LLD_VMT(query)(unsigned what); #endif + /* Clipping Functions */ + #if GDISP_NEED_CLIP + extern void GDISP_LLD_VMT(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy); + #endif + /* Messaging API */ #if GDISP_NEED_MSGAPI #include "gdisp_lld_msgs.h" diff --git a/include/gdisp_lld_msgs.h b/include/gdisp_lld_msgs.h index 28a6707e..ff9d4084 100644 --- a/include/gdisp_lld_msgs.h +++ b/include/gdisp_lld_msgs.h @@ -39,6 +39,9 @@ typedef enum gdisp_msgaction { GDISP_LLD_MSG_FILLAREA, GDISP_LLD_MSG_BLITAREA, GDISP_LLD_MSG_DRAWLINE, + #if GDISP_NEED_CLIP + GDISP_LLD_MSG_SETCLIP, + #endif #if GDISP_NEED_CIRCLE GDISP_LLD_MSG_DRAWCIRCLE, GDISP_LLD_MSG_FILLCIRCLE, @@ -47,6 +50,10 @@ typedef enum gdisp_msgaction { GDISP_LLD_MSG_DRAWELLIPSE, GDISP_LLD_MSG_FILLELLIPSE, #endif + #if GDISP_NEED_ARC + GDISP_LLD_MSG_DRAWARC, + GDISP_LLD_MSG_FILLARC, + #endif #if GDISP_NEED_TEXT GDISP_LLD_MSG_DRAWCHAR, GDISP_LLD_MSG_FILLCHAR, @@ -89,8 +96,15 @@ typedef union gdisp_lld_msg { gdisp_msgaction_t action; // GDISP_LLD_MSG_BLITAREA coord_t x, y; coord_t cx, cy; + coord_t srcx, srcy; + coord_t srccx; const pixel_t *buffer; } blitarea; + struct gdisp_lld_msg_setclip { + gdisp_msgaction_t action; // GDISP_LLD_MSG_SETCLIP + coord_t x, y; + coord_t cx, cy; + } setclip; struct gdisp_lld_msg_drawline { gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWLINE coord_t x0, y0; @@ -121,6 +135,20 @@ typedef union gdisp_lld_msg { coord_t a, b; color_t color; } fillellipse; + struct gdisp_lld_msg_drawarc { + gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWARC + coord_t x, y; + coord_t radius; + coord_t startangle, endangle; + color_t color; + } drawcircle; + struct gdisp_lld_msg_fillarc { + gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLARC + coord_t x, y; + coord_t radius; + coord_t startangle, endangle; + color_t color; + } fillcircle; struct gdisp_lld_msg_drawchar { gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWCHAR coord_t x, y; -- cgit v1.2.3