summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-bitmap-common.c22
-rw-r--r--firmware/export/lcd-remote.h2
-rw-r--r--firmware/export/lcd.h2
3 files changed, 26 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index 2ce11e3398..d242096138 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -81,6 +81,28 @@ static void lcd_gradient_rect(int x1, int x2, int y, unsigned h,
}
#endif
+/*
+ * draws the borders of the viewport, or of current_vp if vp == NULL
+ **/
+void LCDFN(draw_viewport)(const struct viewport *vp)
+{
+ if (vp == NULL)
+ LCDFN(drawrect)(0, 0, current_vp->width, current_vp->height);
+ else
+ LCDFN(drawrect)(vp->x, vp->y, vp->width, vp->height);
+}
+
+/*
+ * fills the rectangle formed by vp or by current_vp if vp == NULL
+ **/
+void LCDFN(fill_viewport)(const struct viewport *vp)
+{
+ if (vp == NULL)
+ LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height);
+ else
+ LCDFN(fillrect)(vp->x, vp->y, vp->width, vp->height);
+}
+
/* put a string at a given pixel position, skipping first ofs pixel columns */
static void LCDFN(putsxyofs)(int x, int y, int ofs, const unsigned char *str)
{
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 93b2968033..894d35ca11 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -178,6 +178,8 @@ extern void lcd_remote_hline(int x1, int x2, int y);
extern void lcd_remote_vline(int x, int y1, int y2);
extern void lcd_remote_drawrect(int x, int y, int width, int height);
extern void lcd_remote_fillrect(int x, int y, int width, int height);
+extern void lcd_remote_draw_viewport(const struct viewport *vp);
+extern void lcd_remote_fill_viewport(const struct viewport *vp);
extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x,
int src_y, int stride, int x, int y,
int width, int height);
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 54a2f3c511..6dab8f4cad 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -507,6 +507,8 @@ extern void lcd_hline(int x1, int x2, int y);
extern void lcd_vline(int x, int y1, int y2);
extern void lcd_drawrect(int x, int y, int width, int height);
extern void lcd_fillrect(int x, int y, int width, int height);
+extern void lcd_draw_viewport(const struct viewport *vp);
+extern void lcd_fill_viewport(const struct viewport *vp);
extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
int stride, int x, int y, int width, int height);
extern void lcd_bitmap(const fb_data *src, int x, int y, int width,