forked from len0rd/rockbox
lcd: Move grayscale clear_viewport() to lcd-bitmap-common.c
All grayscale LCDs have the same clear_viewport() implementation. Change-Id: I087ac3be824c97a1f42857b4e2fedb0675d453fa
This commit is contained in:
parent
f737e5025d
commit
44b9785465
5 changed files with 28 additions and 109 deletions
|
@ -221,6 +221,34 @@ void LCDFN(fill_viewport)(void)
|
|||
LCDFN(fillrect)(0, 0, LCDFN(current_viewport)->width, LCDFN(current_viewport)->height);
|
||||
}
|
||||
|
||||
#if LCDM(DEPTH) < 8
|
||||
/*
|
||||
* clear the current viewport - grayscale displays
|
||||
*/
|
||||
void LCDFN(clear_viewport)(void)
|
||||
{
|
||||
struct viewport *vp = LCDFN(current_viewport);
|
||||
int oldmode;
|
||||
|
||||
if (vp == &default_vp && default_vp.buffer == &LCDFN(framebuffer_default))
|
||||
{
|
||||
LCDFN(clear_display)();
|
||||
}
|
||||
else
|
||||
{
|
||||
oldmode = vp->drawmode;
|
||||
vp->drawmode &= ~DRMODE_INVERSEVID;
|
||||
vp->drawmode |= DRMODE_SOLID;
|
||||
|
||||
LCDFN(fillrect)(0, 0, vp->width, vp->height);
|
||||
|
||||
vp->drawmode = oldmode;
|
||||
LCDFN(scroll_stop_viewport)(vp);
|
||||
}
|
||||
|
||||
vp->flags &= ~VP_FLAG_VP_SET_CLEAN;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*** Viewports ***/
|
||||
/* init_viewport Notes: When a viewport is initialized
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue