summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-11-08 11:48:38 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-11-08 11:48:38 +0100
commit1ffcdbab88aca698161b34096934e196370b3a21 (patch)
tree5792e165f337862348f445ab7dd35986fa859b85
parente4af9bc39296b6e1080e905151aa8f981770e49e (diff)
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.
-rw-r--r--sys/src/9/port/swcursor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/9/port/swcursor.c b/sys/src/9/port/swcursor.c
index 55ea014d0..75b658460 100644
--- a/sys/src/9/port/swcursor.c
+++ b/sys/src/9/port/swcursor.c
@@ -42,7 +42,6 @@ swcursorhide(void)
return;
swvisible = 0;
memimagedraw(gscreen, swrect, swback, ZP, memopaque, ZP, S);
- flushmemscreen(swrect);
}
void
@@ -57,16 +56,20 @@ swcursoravoid(Rectangle r)
void
swcursordraw(Point p)
{
+ Rectangle flushr;
+
if(swvisible)
return;
if(swback == nil || swimg1 == nil || swmask1 == nil || gscreen == nil)
return;
assert(!canqlock(&drawlock));
swvispt = addpt(swoffset, p);
+ flushr = swrect;
swrect = rectaddpt(Rect(0,0,16,16), swvispt);
+ combinerect(&flushr, swrect);
memimagedraw(swback, swback->r, gscreen, swvispt, memopaque, ZP, S);
memimagedraw(gscreen, swrect, swimg1, ZP, swmask1, ZP, SoverD);
- flushmemscreen(swrect);
+ flushmemscreen(flushr);
swvisible = 1;
}