[cairo-commit] glitz/src glitz_pixel.c,1.23,1.24
David Reveman
commit at pdx.freedesktop.org
Wed Feb 15 07:15:22 PST 2006
Committed by: davidr
Update of /cvs/cairo/glitz/src
In directory gabe:/tmp/cvs-serv604/src
Modified Files:
glitz_pixel.c
Log Message:
Fix y-inverted pixel transfers
Index: glitz_pixel.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_pixel.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- glitz_pixel.c 21 Dec 2005 16:19:51 -0000 1.23
+++ glitz_pixel.c 15 Feb 2006 15:15:20 -0000 1.24
@@ -598,8 +598,10 @@
for (y = 0; y < height; y++) {
if (src->format->scanline_order != dst->format->scanline_order)
- src_op.line = &src->data[(src->height - (y + y_src) - 1) *
+ {
+ src_op.line = &src->data[(src->height + y_src - y - 1) *
src_stride];
+ }
else
src_op.line = &src->data[(y + y_src) * src_stride];
@@ -609,12 +611,12 @@
{
src_op.line2 =
&src->data[src_planeoffset +
- (((src->height - (y + y_src) - 1) >> 1))
+ (((src->height + y_src - y - 1) >> 1))
* (src_stride >> 1)];
src_op.line3 =
&src->data[src_planeoffset +
(src_planeoffset >> 2) +
- (((src->height - (y + y_src) - 1) >> 1))
+ (((src->height + y_src - y - 1) >> 1))
* (src_stride >> 1)];
}
else
@@ -1555,6 +1557,7 @@
if (transform)
{
glitz_image_t src_image, dst_image;
+ int y1;
src_image.data = data;
src_image.format = &gl_format->pixel;
@@ -1587,12 +1590,18 @@
if (box.x1 < box.x2 && box.y1 < box.y2)
{
+ if (format->scanline_order ==
+ GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP)
+ y1 = height - (box.y2 + y_src);
+ else
+ y1 = box.y1 - y_src;
+
_glitz_pixel_transform (transform,
&src_image,
&dst_image,
- box.x1 - x_src, box.y1 - y_src,
+ box.x1 - x_src, y1,
format->xoffset + box.x1 - x_src,
- format->skip_lines + box.y1 - y_src,
+ format->skip_lines + y1,
box.x2 - box.x1, box.y2 - box.y1);
}
clip++;
More information about the cairo-commit
mailing list