From f94f1f4b8ce62855693b4b48356f7e8d229b3fa4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 2 Apr 2025 06:29:43 +1300 Subject: video: Add a function to draw a rectangle Provide a way to draw an unfilled box of a certain width. This is useful for grouping menu items together. Add a comment showing how to see the copy-framebuffer, for testing. Signed-off-by: Simon Glass --- include/video.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/video.h b/include/video.h index 0ec6b1ca289..9ea6b676463 100644 --- a/include/video.h +++ b/include/video.h @@ -249,7 +249,7 @@ int video_fill(struct udevice *dev, u32 colour); /** * video_fill_part() - Erase a region * - * Erase a rectangle of the display within the given bounds. + * Erase a rectangle on the display within the given bounds * * @dev: Device to update * @xstart: X start position in pixels from the left @@ -262,6 +262,23 @@ int video_fill(struct udevice *dev, u32 colour); int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, int yend, u32 colour); +/** + * video_draw_box() - Draw a box + * + * Draw a rectangle on the display within the given bounds + * + * @dev: Device to update + * @x0: X start position in pixels from the left + * @y0: Y start position in pixels from the top + * @x1: X end position in pixels from the left + * @y1: Y end position in pixels from the top + * @width: width in pixels + * @colour: Value to write + * Return: 0 if OK, -ENOSYS if the display depth is not supported + */ +int video_draw_box(struct udevice *dev, int x0, int y0, int x1, int y1, + int width, u32 colour); + /** * video_sync() - Sync a device's frame buffer with its hardware * -- cgit v1.2.3