Implements an optional frame buffer on top of existing functionality. It works by redirecting all drawing functions to happen in memory, and allow users to explicitly send the buffer as a whole to the display when finished. This eliminates all visual artifacts resulting from updating graphics directly on the display memory.
Given that not all use cases have enough memory for a frame buffer, users can optionally use it with:
I'm closing this PR as it seems there's no interest in merging or reviewing it. I ended up writing a completely new graphics library, which solves this an many other problems: https://github.com/fornellas/eglib.
Implements an optional frame buffer on top of existing functionality. It works by redirecting all drawing functions to happen in memory, and allow users to explicitly send the buffer as a whole to the display when finished. This eliminates all visual artifacts resulting from updating graphics directly on the display memory.
Given that not all use cases have enough memory for a frame buffer, users can optionally use it with:
Data will be all pumped to the display only when
ucg_SendBuffer
is called.I tested this with a SSD1351 and the SDL examples, everything seems all right.
Implementation details:
ucg_InitBuffer
puts a newucg_dev_buffer
in place ofucg->device_cb
.ucg_dev_buffer
catches all drawing calls and draws them them in memory.ucg_SendBuffer
temporarily puts the original device callback and invokes it with the newUCG_MSG_SEND_BUFFER
command.UCG_MSG_SEND_BUFFER
has a default implementation atucg_dev_default_cb.c
which all displays can use.UCG_MSG_SEND_BUFFER
toucg_dev_ic_ssd1351.c
, which is able to send the buffer at bus speed.Closes #122.
PS: This PR is on top of #123, which should be reviewed / merged first.