diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-01-17 16:03:42 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-01-17 16:03:42 (GMT) |
| commit | 2fe3ac1388aa14bafe25fb525f61bc77dd31fb21 (patch) | |
| tree | ddc048f0a8ae3cd572582e9f1c6b75d6656fd871 | |
| parent | 5170b974913129bce381d3061d967767a064f2f0 (diff) | |
draw565: Optimize string drawing
Avoid needless bouncing the chip select when drawing glyphs. This
improved performance by around 15% for 24pt fonts.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
| -rw-r--r-- | wasp/draw565.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wasp/draw565.py b/wasp/draw565.py index 72cda5b..5f61a6c 100644 --- a/wasp/draw565.py +++ b/wasp/draw565.py @@ -91,9 +91,13 @@ def _draw_glyph(display, glyph, x, y, bgfg): bytes_per_row = (w + 7) // 8 display.set_window(x, y, w+1, h) + quick_write = display.quick_write + + display.quick_start() for row in range(h): _bitblit(buf, px[row*bytes_per_row:], bgfg, w) - display.write_data(buf) + quick_write(buf) + display.quick_end() class Draw565(object): """Drawing library for RGB565 displays. |
