framebufferio: Don't call swapbuffers unnecessarily

This commit is contained in:
Jeff Epler 2020-07-31 14:35:00 -05:00
parent ffc488e748
commit 5a7b2a2038

View File

@ -219,13 +219,15 @@ STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) {
displayio_display_core_start_refresh(&self->core);
self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo);
const displayio_area_t* current_area = _get_refresh_areas(self);
if (current_area) {
while (current_area != NULL) {
_refresh_area(self, current_area);
current_area = current_area->next;
}
displayio_display_core_finish_refresh(&self->core);
self->framebuffer_protocol->swapbuffers(self->framebuffer);
}
displayio_display_core_finish_refresh(&self->core);
}
void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_framebufferdisplay_obj_t* self, int rotation){
bool transposed = (self->core.rotation == 90 || self->core.rotation == 270);