From 3fad7de8db7f1f317ab6d00a00a82e406ec6fb33 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 16 May 2019 16:45:38 -0700 Subject: Rework the pixel computation to use areas This changes the displayio pixel computation from per-pixel to per-area. This is precursor work to updating portions of the screen (#1169). It should provide mild speedups because bounds checks are done once per area rather than once per pixel. Filling by area also allows TileGrid to maintain a row-associative fill pattern even when the display's refresh is orthogonal to it. --- shared-module/displayio/Group.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shared-module/displayio/Group.h') diff --git a/shared-module/displayio/Group.h b/shared-module/displayio/Group.h index 7826b9e66..f8fe9be04 100644 --- a/shared-module/displayio/Group.h +++ b/shared-module/displayio/Group.h @@ -31,6 +31,7 @@ #include #include "py/obj.h" +#include "shared-module/displayio/area.h" typedef struct { mp_obj_t native; @@ -49,7 +50,7 @@ typedef struct { } displayio_group_t; void displayio_group_construct(displayio_group_t* self, displayio_group_child_t* child_array, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y); -bool displayio_group_get_pixel(displayio_group_t *group, int16_t x, int16_t y, uint16_t *pixel); +bool displayio_group_get_area(displayio_group_t *group, displayio_buffer_transform_t* transform, displayio_area_t* area, uint32_t* mask, uint32_t *buffer); bool displayio_group_needs_refresh(displayio_group_t *self); void displayio_group_finish_refresh(displayio_group_t *self); -- cgit v1.2.3