From 58e5a923db68485fc211a04800f9a9e15429029c Mon Sep 17 00:00:00 2001 From: gilesp1729 Date: Wed, 22 May 2024 15:54:04 +1000 Subject: [PATCH] Incorporate PR #3 and similar changes to raw H/V lines. --- src/Arduino_GigaDisplay_GFX.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Arduino_GigaDisplay_GFX.cpp b/src/Arduino_GigaDisplay_GFX.cpp index 4a7fc48..0225b20 100644 --- a/src/Arduino_GigaDisplay_GFX.cpp +++ b/src/Arduino_GigaDisplay_GFX.cpp @@ -102,6 +102,7 @@ uint16_t GigaDisplay_GFX::getRawPixel(int16_t x, int16_t y) { void GigaDisplay_GFX::fillScreen(uint16_t color) { if (hasBuffer()) { + startWrite(); // PR #3 uint8_t hi = color >> 8, lo = color & 0xFF; if (hi == lo) { memset(buffer, lo, WIDTH * HEIGHT * 2); @@ -110,6 +111,7 @@ void GigaDisplay_GFX::fillScreen(uint16_t color) { for (i = 0; i < pixels; i++) buffer[i] = color; } + endWrite(); // PR #3 } } @@ -215,19 +217,23 @@ void GigaDisplay_GFX::drawFastHLine(int16_t x, int16_t y, int16_t w, void GigaDisplay_GFX::drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color) { + startWrite(); // x & y already in raw (rotation 0) coordinates, no need to transform. uint16_t *buffer_ptr = buffer + y * WIDTH + x; for (int16_t i = 0; i < h; i++) { (*buffer_ptr) = color; buffer_ptr += WIDTH; } + endWrite(); } void GigaDisplay_GFX::drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color) { + startWrite(); // x & y already in raw (rotation 0) coordinates, no need to transform. uint32_t buffer_index = y * WIDTH + x; for (uint32_t i = buffer_index; i < buffer_index + w; i++) { buffer[i] = color; } + endWrite(); }