From 2fe3ac1388aa14bafe25fb525f61bc77dd31fb21 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Sun, 17 Jan 2021 16:03:42 +0000 Subject: 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 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. -- cgit v0.10.2