summaryrefslogtreecommitdiffstats
path: root/hacks/rd-bomb.c
diff options
context:
space:
mode:
authorSimon Rettberg2020-12-02 08:35:55 +0100
committerSimon Rettberg2020-12-02 08:35:55 +0100
commite5319b91d163384ee22db077b2d37688d65646c9 (patch)
tree04acbf822516634814098b38a9878ffc1a55529d /hacks/rd-bomb.c
parentdriver/timers.c: fix flush_events() (diff)
parent5.44 (diff)
downloadxscreensaver-e5319b91d163384ee22db077b2d37688d65646c9.tar.gz
xscreensaver-e5319b91d163384ee22db077b2d37688d65646c9.tar.xz
xscreensaver-e5319b91d163384ee22db077b2d37688d65646c9.zip
Merge branch 'master' into openslx
Diffstat (limited to 'hacks/rd-bomb.c')
-rw-r--r--hacks/rd-bomb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hacks/rd-bomb.c b/hacks/rd-bomb.c
index 9628619..4b7131d 100644
--- a/hacks/rd-bomb.c
+++ b/hacks/rd-bomb.c
@@ -489,12 +489,21 @@ rd_draw (Display *dpy, Window win, void *closure)
struct state *st = (struct state *) closure;
Bool bump = False;
+ /* Let's compute N frames at once. This speeds up the progress of
+ the animation and the seething, but doesn't appreciably affect the
+ frame rate or CPU utilization. */
+ int ii;
+ int chunk = 3;
+ for (ii = 0; ii < chunk; ii++) {
+
int i, j;
pixack_frame(st, st->pd);
+ if (ii == chunk-1) { /* Only need to putimage on the final frame */
for (i = 0; i < st->array_width; i += st->width)
for (j = 0; j < st->array_height; j += st->height)
put_xshm_image(st->dpy, st->window, st->gc, st->image, 0, 0, i+st->array_x, j+st->array_y,
st->width, st->height, &st->shm_info);
+ }
st->array_x += st->array_dx;
st->array_y += st->array_dy;
@@ -526,6 +535,7 @@ rd_draw (Display *dpy, Window win, void *closure)
}
st->frame++;
+ }
return st->delay;
}