diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-07-18 16:47:28 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-07-18 16:47:28 -0700 |
| commit | 4a6bdb6fe471b3024b2ca1d977ef02bfd94cc12a (patch) | |
| tree | d65165e20f7c190a3d8a3e1b377bacf877a790a1 /shared-module/displayio/Bitmap.h | |
| parent | d12e1a8d74ebb8d5d32ab0de47d3097e80c5d4fd (diff) | |
Track a dirty area for in-memory bitmaps
This fixes the bug that bitmap changes do not cause screen updates
and optimizes the refresh when the bitmap is simply shown on the
screen. If the bitmap is used in tiles, then changing it will
cause all TileGrids using it to do a full refresh.
Fixes #1981
Diffstat (limited to 'shared-module/displayio/Bitmap.h')
| -rw-r--r-- | shared-module/displayio/Bitmap.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/shared-module/displayio/Bitmap.h b/shared-module/displayio/Bitmap.h index 48ca9e2cf..f4bd7ce4d 100644 --- a/shared-module/displayio/Bitmap.h +++ b/shared-module/displayio/Bitmap.h @@ -31,6 +31,7 @@ #include <stdint.h> #include "py/obj.h" +#include "shared-module/displayio/area.h" typedef struct { mp_obj_base_t base; @@ -41,8 +42,12 @@ typedef struct { uint8_t bits_per_value; uint8_t x_shift; size_t x_mask; + displayio_area_t dirty_area; uint16_t bitmask; bool read_only; } displayio_bitmap_t; +void displayio_bitmap_finish_refresh(displayio_bitmap_t *self); +displayio_area_t* displayio_bitmap_get_refresh_areas(displayio_bitmap_t *self, displayio_area_t* tail); + #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_BITMAP_H |
