diff options
| author | Simon Glass <[email protected]> | 2025-04-02 06:29:43 +1300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-02 13:40:25 -0600 |
| commit | f94f1f4b8ce62855693b4b48356f7e8d229b3fa4 (patch) | |
| tree | f3a8400dd68f59b9a15fee6385d733a5747897df /include | |
| parent | cb32266d4aeca4a730c1f8b85c981a8793d768c4 (diff) | |
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 <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/video.h | 19 |
1 files changed, 18 insertions, 1 deletions
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 @@ -263,6 +263,23 @@ 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 * * @vid: Device to sync |
