summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-01 22:17:44 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-12-01 22:23:33 +0000
commite7b8457236a7858a7e8d5c22416a8f4a2f621b83 (patch)
treec703a2c7560959eecd02019c2c56ba0a0bf609ca
parent81d988f407ab997e0e43432b3e2a85820bbe2756 (diff)
blend: Second attempt to handle multiple source pages...
The first attempt failed to reset the dst_color iter after completing a page, so we would advance to the end of the dst array before completing the source array and attempt to render a zero length page. [In my defense not even valgrind spotted the mistake on my machine! A poor craftsman blames his tools :(] Reported-again-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--t_blend.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/t_blend.c b/t_blend.c
index 3a91400..57b2f2d 100644
--- a/t_blend.c
+++ b/t_blend.c
@@ -46,18 +46,18 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst,
k = y = 0;
while (k < num_dst) {
XImage *image;
- int k0 = k;
+ int k0 = k, k1 = k;
int this_src, rem_src;
rem_src = num_src;
for (page = 0; page < num_pages; page++) {
this_src = rem_src / (num_pages - page);
for (iter = 0; iter < pixmap_move_iter; iter++) {
- k = k0;
+ k1 = k0;
y = 0;
- while (k < num_dst && y + this_src < win_height) {
+ while (k1 < num_dst && y + this_src <= win_height) {
XRenderComposite(dpy, PictOpSrc,
- dst_color[k]->pict, 0, dst->pict,
+ dst_color[k1++]->pict, 0, dst->pict,
0, 0,
0, 0,
0, y,
@@ -73,7 +73,6 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst,
}
y++;
}
- k++;
}
}
@@ -83,14 +82,14 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst,
copy_pict_to_win(dpy, dst, win, win_width, win_height);
y = 0;
- while (k0 < k) {
+ for (k = k0; k < k1; k++) {
XRenderDirectFormat dst_acc;
accuracy(&dst_acc,
&dst->format->direct,
- &dst_color[k0]->format->direct);
+ &dst_color[k]->format->direct);
- tdst = dst_color[k0]->color;
+ tdst = dst_color[k]->color;
color_correct(dst, &tdst);
for (j = 0; j < this_src; j++) {
@@ -121,15 +120,16 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst,
src_color[j]->color.r, src_color[j]->color.g,
src_color[j]->color.b, src_color[j]->color.a,
srcformat,
- dst_color[k0]->color.r, dst_color[k0]->color.g,
- dst_color[k0]->color.b, dst_color[k0]->color.a);
+ dst_color[k]->color.r,
+ dst_color[k]->color.g,
+ dst_color[k]->color.b,
+ dst_color[k]->color.a);
printf("src: %s, dst: %s\n", src_color[j]->name, dst->name);
return FALSE;
}
}
y++;
}
- k0++;
}
XDestroyImage(image);