Skip to content

Commit 58e5a92

Browse files
committed
Incorporate PR #3 and similar changes to raw H/V lines.
1 parent a9392d7 commit 58e5a92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Arduino_GigaDisplay_GFX.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ uint16_t GigaDisplay_GFX::getRawPixel(int16_t x, int16_t y) {
102102

103103
void GigaDisplay_GFX::fillScreen(uint16_t color) {
104104
if (hasBuffer()) {
105+
startWrite(); // PR #3
105106
uint8_t hi = color >> 8, lo = color & 0xFF;
106107
if (hi == lo) {
107108
memset(buffer, lo, WIDTH * HEIGHT * 2);
@@ -110,6 +111,7 @@ void GigaDisplay_GFX::fillScreen(uint16_t color) {
110111
for (i = 0; i < pixels; i++)
111112
buffer[i] = color;
112113
}
114+
endWrite(); // PR #3
113115
}
114116
}
115117

@@ -215,19 +217,23 @@ void GigaDisplay_GFX::drawFastHLine(int16_t x, int16_t y, int16_t w,
215217

216218
void GigaDisplay_GFX::drawFastRawVLine(int16_t x, int16_t y, int16_t h,
217219
uint16_t color) {
220+
startWrite();
218221
// x & y already in raw (rotation 0) coordinates, no need to transform.
219222
uint16_t *buffer_ptr = buffer + y * WIDTH + x;
220223
for (int16_t i = 0; i < h; i++) {
221224
(*buffer_ptr) = color;
222225
buffer_ptr += WIDTH;
223226
}
227+
endWrite();
224228
}
225229

226230
void GigaDisplay_GFX::drawFastRawHLine(int16_t x, int16_t y, int16_t w,
227231
uint16_t color) {
232+
startWrite();
228233
// x & y already in raw (rotation 0) coordinates, no need to transform.
229234
uint32_t buffer_index = y * WIDTH + x;
230235
for (uint32_t i = buffer_index; i < buffer_index + w; i++) {
231236
buffer[i] = color;
232237
}
238+
endWrite();
233239
}

0 commit comments

Comments
 (0)