dont flush screen when hiding software cursor
we can avoid some flickering when removing the software cursor from the shadow framebuffer by avoiding the flushscreenimage() call. once the cursor is redrawn, we flush the combined rect of its old and new position in one go.
This commit is contained in:
parent
e4af9bc392
commit
1ffcdbab88
|
@ -42,7 +42,6 @@ swcursorhide(void)
|
||||||
return;
|
return;
|
||||||
swvisible = 0;
|
swvisible = 0;
|
||||||
memimagedraw(gscreen, swrect, swback, ZP, memopaque, ZP, S);
|
memimagedraw(gscreen, swrect, swback, ZP, memopaque, ZP, S);
|
||||||
flushmemscreen(swrect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -57,16 +56,20 @@ swcursoravoid(Rectangle r)
|
||||||
void
|
void
|
||||||
swcursordraw(Point p)
|
swcursordraw(Point p)
|
||||||
{
|
{
|
||||||
|
Rectangle flushr;
|
||||||
|
|
||||||
if(swvisible)
|
if(swvisible)
|
||||||
return;
|
return;
|
||||||
if(swback == nil || swimg1 == nil || swmask1 == nil || gscreen == nil)
|
if(swback == nil || swimg1 == nil || swmask1 == nil || gscreen == nil)
|
||||||
return;
|
return;
|
||||||
assert(!canqlock(&drawlock));
|
assert(!canqlock(&drawlock));
|
||||||
swvispt = addpt(swoffset, p);
|
swvispt = addpt(swoffset, p);
|
||||||
|
flushr = swrect;
|
||||||
swrect = rectaddpt(Rect(0,0,16,16), swvispt);
|
swrect = rectaddpt(Rect(0,0,16,16), swvispt);
|
||||||
|
combinerect(&flushr, swrect);
|
||||||
memimagedraw(swback, swback->r, gscreen, swvispt, memopaque, ZP, S);
|
memimagedraw(swback, swback->r, gscreen, swvispt, memopaque, ZP, S);
|
||||||
memimagedraw(gscreen, swrect, swimg1, ZP, swmask1, ZP, SoverD);
|
memimagedraw(gscreen, swrect, swimg1, ZP, swmask1, ZP, SoverD);
|
||||||
flushmemscreen(swrect);
|
flushmemscreen(flushr);
|
||||||
swvisible = 1;
|
swvisible = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue