viewports add flag to disable updates

when drwing multiple areas of the screen with other gui elements
you might want to combine updates into a single screen redraw

Change-Id: Ie4130366fa13e25d3d14e937257d11547dd61134
This commit is contained in:
William Wilgus 2022-04-15 01:54:42 -04:00
parent b9c3ab2e04
commit d56d96031c
2 changed files with 14 additions and 3 deletions

View file

@ -178,7 +178,13 @@ struct viewport *LCDFN(get_viewport)(bool *is_default)
void LCDFN(update_viewport)(void)
{
struct viewport* vp = LCDFN(current_viewport);
if ((vp->flags & VP_FLAG_OWNER_UPDATE) == VP_FLAG_OWNER_UPDATE)
{
logf("%s ignored - owner update", __func__);
return;
}
int x, y;
if (vp->buffer->stride != LCDFN(framebuffer_default.stride))
{
@ -196,7 +202,11 @@ void LCDFN(update_viewport)(void)
void LCDFN(update_viewport_rect)(int x, int y, int width, int height)
{
struct viewport* vp = LCDFN(current_viewport);
if ((vp->flags & VP_FLAG_OWNER_UPDATE) == VP_FLAG_OWNER_UPDATE)
{
logf("%s ignored - owner update", __func__);
return;
}
/* handle the case of viewport with differing stride from main screen */
if (vp->buffer->stride != LCDFN(framebuffer_default.stride))
{

View file

@ -178,6 +178,7 @@ struct frame_buffer_t {
#define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
#define VP_FLAG_OWNER_UPDATE 0x2000 /* block update_vp functions */
#define VP_FLAG_VP_DIRTY 0x4000
#define VP_FLAG_CLEAR_FLAG 0x8000
#define VP_FLAG_VP_SET_CLEAN (VP_FLAG_CLEAR_FLAG | VP_FLAG_VP_DIRTY)