Commit Graph

8 Commits

Author SHA1 Message Date
Kevin Matocha 9485805b6a move to displayio_area_union and away from _expand 2021-03-25 11:21:39 -05:00
Jeff Epler 3b506f0fa5 displayio: area: add displayio_area_canon
This routine will be used to simplify code that deals with ranges
of bitmap coordinates.
2021-03-18 09:06:00 -05:00
Jeff Epler f40c0c13ad displayio: area: add displayo_area_copy_coords, displayio_area_empty
.. and simplify the implmentation of displayio_area_union

This _slightly_ changes the behavior of displayio_area_union:

Formerly, if one of the areas was empty, its coordinates were still
used in the min/max calculations.

Now, if one of the areas is empty, the result gets the other area's coords

In particular, taking the union of the empty area with coords (0,0,0,0)
with the non-empty area (x1,y1,x2,y2) would give the area (0,0,x2,y2)
before, and (x1,y1,x2,y2) after the change.
2021-03-18 09:05:07 -05:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Dan Halbert d1184e7e94 Be cognizant of null transform for .transpose_xy 2021-03-04 14:40:50 -05:00
Scott Shawcroft eb21fc3e31
Add partial display update support.
Different operations to the display tree have different costs. Be
aware of these costs when optimizing your code.
* Changing tiles indices in a TileGrid will update an area
covering them all.
* Changing a palette will refresh every object that references it.
* Moving a TileGrid will update both where it was and where it moved to.
* Adding something to a Group will refresh each individual area it
covers.
* Removing things from a Group will refresh one area that covers all
previous locations. (Not separate areas like add.)
* Setting a new top level Group will refresh the entire display.

Only TileGrid moves are optimized for overlap. All other overlaps
cause sending of duplicate pixels.

This also adds flip_x, flip_y and transpose_xy to TileGrid. They
change the direction of the pixels but not the location.

Fixes #1169. Fixes #1705. Fixes #1923.
2019-06-12 11:32:39 -07:00
Scott Shawcroft 7a117f52ed
Make point 2 in areas exclusive and simplify full_coverage. 2019-05-22 15:00:47 -07:00
Scott Shawcroft 3fad7de8db
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.
2019-05-21 17:41:06 -07:00