/* * draw.h - software rendering onto an ARGB8888 mb_buffer. * * Colours are straight-alpha 0xAARRGGBB; they are premultiplied on the way in * and overwrite the destination (the compositor blends the finished overlay * over the desktop). All primitives clip to the buffer. */ #ifndef MOUSEBOARD_DRAW_H #define MOUSEBOARD_DRAW_H #include "platform.h" void draw_fill(struct mb_buffer *b, int x, int y, int w, int h, uint32_t argb); void draw_rect(struct mb_buffer *b, int x, int y, int w, int h, int thick, uint32_t argb); void draw_hline(struct mb_buffer *b, int x, int y, int len, int thick, uint32_t argb); void draw_vline(struct mb_buffer *b, int x, int y, int len, int thick, uint32_t argb); /* Render text at scale (integer multiple of the 8x8 cell). Returns the pixel * width drawn. */ int draw_text(struct mb_buffer *b, int x, int y, const char *s, int scale, uint32_t fg); int text_width(const char *s, int scale); int text_height(int scale); #endif /* MOUSEBOARD_DRAW_H */