]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/_display.py
Speed improvements by making larger buffer
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / _display.py
index d7d04cf2389dcf5ba1c3badbb42cd754c6851e1b..022103d35b4d6674685ce69296ad6131a0b6e9f7 100644 (file)
@@ -328,7 +328,6 @@ class Display:
     def _refresh_area(self, area) -> bool:
         """Loop through dirty areas and redraw that area."""
         # pylint: disable=too-many-locals
-        buffer_size = 128
 
         clipped = Area()
         # Clip the area to the display by overlapping the areas.
@@ -340,6 +339,9 @@ class Display:
         pixels_per_word = 32 // self._core.colorspace.depth
         pixels_per_buffer = clipped.size()
 
+        # We should have lots of memory
+        buffer_size = clipped.size() // pixels_per_word
+
         subrectangles = 1
         # for SH1107 and other boundary constrained controllers
         #      write one single row at a time