mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
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:
parent
b9c3ab2e04
commit
d56d96031c
2 changed files with 14 additions and 3 deletions
|
@ -178,7 +178,13 @@ struct viewport *LCDFN(get_viewport)(bool *is_default)
|
||||||
|
|
||||||
void LCDFN(update_viewport)(void)
|
void LCDFN(update_viewport)(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct viewport* vp = LCDFN(current_viewport);
|
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;
|
int x, y;
|
||||||
if (vp->buffer->stride != LCDFN(framebuffer_default.stride))
|
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)
|
void LCDFN(update_viewport_rect)(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
struct viewport* vp = LCDFN(current_viewport);
|
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 */
|
/* handle the case of viewport with differing stride from main screen */
|
||||||
if (vp->buffer->stride != LCDFN(framebuffer_default.stride))
|
if (vp->buffer->stride != LCDFN(framebuffer_default.stride))
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,8 +178,9 @@ struct frame_buffer_t {
|
||||||
|
|
||||||
#define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
|
#define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
|
||||||
|
|
||||||
#define VP_FLAG_VP_DIRTY 0x4000
|
#define VP_FLAG_OWNER_UPDATE 0x2000 /* block update_vp functions */
|
||||||
#define VP_FLAG_CLEAR_FLAG 0x8000
|
#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)
|
#define VP_FLAG_VP_SET_CLEAN (VP_FLAG_CLEAR_FLAG | VP_FLAG_VP_DIRTY)
|
||||||
|
|
||||||
struct viewport {
|
struct viewport {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue