aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-18 15:06:20 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-18 15:06:20 +0000
commit97d677d5b989cee9b9534999ad7b4e9f95aeb578 (patch)
treee747c5ef362e0d7d3892ec1d2eebb65273c84757
parentfd87a130974e309740907c853ca0a67a27baea53 (diff)
flicker test
-rw-r--r--Sgraph.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Sgraph.c b/Sgraph.c
index 39a8a63..bd4699b 100644
--- a/Sgraph.c
+++ b/Sgraph.c
@@ -177,7 +177,7 @@ Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr)
XtCreateWindow(w, InputOutput, CopyFromParent, *mask, attr);
sw->sgraph.backBuf = XdbeAllocateBackBufferName(XtDisplay(w),
- XtWindow(w), XdbeUndefined);
+ XtWindow(w), XdbeBackground);
Resize(w);
}
@@ -244,6 +244,10 @@ Redisplay(Widget w, XEvent *event, Region r)
0, 0, width, height);
*/
+ XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC,
+ 0, height / 2, 2 * width, height / 2);
+ XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC,
+ 0, height / 2 + height, 2 * width, height / 2 + height);
for (x = 0; x < sw->sgraph.size; x++) {
yl = sw->sgraph.leftData[x] / (2 * height) + height / 2;
yr = sw->sgraph.rightData[x] / (2 * height) + height / 2;
@@ -254,8 +258,12 @@ Redisplay(Widget w, XEvent *event, Region r)
sw->sgraph.foreGC, x, yr);
}
+ /* flicker test */
+ XFillRectangle(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC,
+ width / 2, 2 * height, width, 3 * height);
+
swap.swap_window = XtWindow(sw);
- swap.swap_action = XdbeUntouched;
+ swap.swap_action = XdbeBackground;
XdbeSwapBuffers(XtDisplay(sw), &swap, 1);
}