summaryrefslogtreecommitdiff
path: root/sys/src/libdraw
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-03-08 16:45:29 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-03-08 16:45:29 +0100
commit9dc9c6c5ef8bba195778f7701142af602e457665 (patch)
tree2719ce460d5b4d2bb9d3e27eb54c80dc4b2c2df4 /sys/src/libdraw
parentbf6ba56817e6bb083d5c411b1660f696144d5ac6 (diff)
rio, libdraw: experimental removal of redundant flushimage() calls for roundtrip latency reduction
- remove redundant flushimage() calls before readmouse() - remove flushimage() calls for allocimage(),freeimage() and originwindow() this is experimental. it will break allocimage() error handling unless the caller does explicit flushimage() calls, tho the gains in usability over high latency connections is huge. in most cases, programs will just terminate when encountering these errors.
Diffstat (limited to 'sys/src/libdraw')
-rw-r--r--sys/src/libdraw/alloc.c8
-rw-r--r--sys/src/libdraw/window.c3
2 files changed, 0 insertions, 11 deletions
diff --git a/sys/src/libdraw/alloc.c b/sys/src/libdraw/alloc.c
index 90289a6aa..28caaac02 100644
--- a/sys/src/libdraw/alloc.c
+++ b/sys/src/libdraw/alloc.c
@@ -47,8 +47,6 @@ _allocimage(Image *ai, Display *d, Rectangle r, ulong chan, int repl, ulong col,
return nil;
}
- /* flush pending data so we don't get error allocating the image */
- flushimage(d, 0);
a = bufimage(d, 1+4+4+1+4+1+4*4+4*4+4);
if(a == nil)
goto Error;
@@ -74,8 +72,6 @@ _allocimage(Image *ai, Display *d, Rectangle r, ulong chan, int repl, ulong col,
BPLONG(a+39, clipr.max.x);
BPLONG(a+43, clipr.max.y);
BPLONG(a+47, col);
- if(flushimage(d, 0) < 0)
- goto Error;
if(ai != nil)
i = ai;
@@ -207,7 +203,6 @@ _freeimage1(Image *i)
if(i == nil || i->display == nil)
return 0;
d = i->display;
- flushimage(d, 0);
if(i->screen != nil){
w = d->windows;
if(w == i)
@@ -226,9 +221,6 @@ _freeimage1(Image *i)
return -1;
a[0] = 'f';
BPLONG(a+1, i->id);
- if(flushimage(d, i->screen!=nil) < 0)
- return -1;
-
return 0;
}
diff --git a/sys/src/libdraw/window.c b/sys/src/libdraw/window.c
index b4dc7fad9..2b6702e72 100644
--- a/sys/src/libdraw/window.c
+++ b/sys/src/libdraw/window.c
@@ -201,7 +201,6 @@ originwindow(Image *w, Point log, Point scr)
uchar *b;
Point delta;
- flushimage(w->display, 0);
b = bufimage(w->display, 1+4+2*4+2*4);
if(b == nil)
return 0;
@@ -211,8 +210,6 @@ originwindow(Image *w, Point log, Point scr)
BPLONG(b+9, log.y);
BPLONG(b+13, scr.x);
BPLONG(b+17, scr.y);
- if(flushimage(w->display, 1) < 0)
- return -1;
delta = subpt(log, w->r.min);
w->r = rectaddpt(w->r, delta);
w->clipr = rectaddpt(w->clipr, delta);