[cairo-commit] 2 commits - src/cairo-pdf-surface.c src/cairo-ps-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Mon Sep 5 06:05:03 PDT 2011


 src/cairo-pdf-surface.c |    8 ++++++--
 src/cairo-ps-surface.c  |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit d6d3825b51f51f5897099ffd7989fa7ca4cb0378
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Sep 5 22:31:53 2011 +0930

    ps: each row of 1-bit image data needs to begin on a byte boundary

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 3a74b7c..5444b33 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -2284,6 +2284,8 @@ _cairo_ps_surface_emit_image (cairo_ps_surface_t    *surface,
 		    break;
 	    }
 	}
+	if (bit != 7)
+	    i++;
     }
 
     if (surface->ps_level == CAIRO_PS_LEVEL_2) {
commit 3614892d8d4d527cc98e44f72a9caaff05c8f86b
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Sep 5 22:30:15 2011 +0930

    pdf: each row of 1-bit image data needs to begin on a byte boundary

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index c475ddd..19d829a 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1953,7 +1953,6 @@ _cairo_pdf_surface_emit_smask (cairo_pdf_surface_t	*surface,
     }
 
     i = 0;
-    bit = 7;
     for (y = 0; y < image->height; y++) {
 	if (image->format == CAIRO_FORMAT_A1) {
 	    pixel8 = (uint8_t *) (image->data + y * image->stride);
@@ -1966,6 +1965,7 @@ _cairo_pdf_surface_emit_smask (cairo_pdf_surface_t	*surface,
 	} else {
 	    pixel8 = (uint8_t *) (image->data + y * image->stride);
 	    pixel32 = (uint32_t *) (image->data + y * image->stride);
+	    bit = 7;
 	    for (x = 0; x < image->width; x++) {
 		if (image->format == CAIRO_FORMAT_ARGB32) {
 		    a = (*pixel32 & 0xff000000) >> 24;
@@ -1989,6 +1989,8 @@ _cairo_pdf_surface_emit_smask (cairo_pdf_surface_t	*surface,
 		    }
 		}
 	    }
+	    if (bit != 7)
+		i++;
 	}
     }
 
@@ -2071,10 +2073,10 @@ _cairo_pdf_surface_emit_image (cairo_pdf_surface_t     *surface,
     }
 
     i = 0;
-    bit = 7;
     for (y = 0; y < image->height; y++) {
 	pixel = (uint32_t *) (image->data + y * image->stride);
 
+	bit = 7;
 	for (x = 0; x < image->width; x++, pixel++) {
 	    int r, g, b;
 
@@ -2126,6 +2128,8 @@ _cairo_pdf_surface_emit_image (cairo_pdf_surface_t     *surface,
 		    break;
 	    }
 	}
+	if (bit != 7)
+	    i++;
     }
 
     need_smask = FALSE;


More information about the cairo-commit mailing list