summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2006-02-16 01:20:44 +0000
committerDavid Reveman <davidr@novell.com>2006-02-16 01:20:44 +0000
commit7a54cc935345267b12b8db4626855cd1e38b7dbd (patch)
tree6e657b1e986aae6f04166a9285762661c1da2103 /src
parent18cc256d047a2c12b5e2de3a7e728832b304b36a (diff)
Fix glitz_get_pixels
Diffstat (limited to 'src')
-rw-r--r--src/glitz_pixel.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/glitz_pixel.c b/src/glitz_pixel.c
index 271bf4b..6c78452 100644
--- a/src/glitz_pixel.c
+++ b/src/glitz_pixel.c
@@ -1266,7 +1266,7 @@ glitz_get_pixels (glitz_surface_t *src,
char *pixels, *data = NULL;
glitz_gl_pixel_format_t *gl_format = NULL;
unsigned long transform = 0;
- int src_x = 0, src_y = 0;
+ int src_x = x_src, src_y = y_src;
int src_w = width, src_h = height;
int bytes_per_line, bytes_per_pixel;
glitz_color_format_t *color;
@@ -1557,7 +1557,7 @@ glitz_get_pixels (glitz_surface_t *src,
if (transform)
{
glitz_image_t src_image, dst_image;
- int y1;
+ int y;
src_image.data = data;
src_image.format = &gl_format->pixel;
@@ -1588,22 +1588,26 @@ glitz_get_pixels (glitz_surface_t *src,
if (y_src + height < box.y2)
box.y2 = y_src + height;
- if (box.x1 < box.x2 && box.y1 < box.y2)
+ if (format->scanline_order == GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP)
{
-#if 0
- if (format->scanline_order ==
- GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP)
- y1 = height - (box.y2 + y_src);
- else
-#endif
- y1 = box.y1 - y_src;
+ src_image.data = data + bytes_per_line * (src_h - box.y2);
+ y = height - box.y2 + y_src;
+ }
+ else
+ {
+ src_image.data = data - bytes_per_line * (box.y1 - src_y);
+ y = box.y1 - y_src;
+ }
+ if (box.x1 < box.x2 && box.y1 < box.y2)
+ {
_glitz_pixel_transform (transform,
&src_image,
&dst_image,
- box.x1 - x_src, y1,
- format->xoffset + box.x1 - x_src,
- format->skip_lines + y1,
+ box.x1 - src_x,
+ 0,
+ format->xoffset + (box.x1 - x_src),
+ format->skip_lines + y,
box.x2 - box.x1, box.y2 - box.y1);
}
clip++;