[cairo-commit] 2 commits - src/cairo-ft-font.c src/cairo-pdf-surface.c src/cairo-ps-surface.c src/cairo-scaled-font.c src/cairo-svg-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Sep 1 10:25:15 PDT 2008


 src/cairo-ft-font.c     |    2 +-
 src/cairo-pdf-surface.c |    2 +-
 src/cairo-ps-surface.c  |   24 ++++++++++++------------
 src/cairo-scaled-font.c |    2 +-
 src/cairo-svg-surface.c |    4 ++--
 5 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 83f390cfc5f594444413dfed3346e8412cb4c973
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 1 18:23:00 2008 +0100

    [ps] Initialise has_creation_date.
    
    Slipped by check-valgrind, since the boilerplate always initialised it
    when explicitly setting the date.

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 3937cfc..f2c4b73 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -682,6 +682,7 @@ _cairo_ps_surface_create_for_stream_internal (cairo_output_stream_t *stream,
 	goto CLEANUP_OUTPUT_STREAM;
     }
 
+    surface->has_creation_date = FALSE;
     surface->eps = FALSE;
     surface->ps_level = CAIRO_PS_LEVEL_3;
     surface->ps_level_used = CAIRO_PS_LEVEL_2;
commit e955b7399ef5741c8f2fda1c4aa73e02c2ce39d0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 1 15:33:05 2008 +0100

    Check that lvalue of BITSWAP8() is a uint8_t.
    
    The bit-swapping macro uses the full register for intermediate storage so
    we need to be careful to only read the low byte when using the result.
    
    [Only the use in ps-surface.c was incorrect, I just converted the other
    unsigned chars to uint8_t for consistency.]

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 99d5a1e..1ad7145 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1095,7 +1095,7 @@ _get_bitmap_surface (FT_Bitmap		     *bitmap,
 
 #ifndef WORDS_BIGENDIAN
 	{
-	    unsigned char   *d = data;
+	    uint8_t   *d = data;
 	    int		count = stride * height;
 
 	    while (count--) {
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 676eb14..de64c0c 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -3444,7 +3444,7 @@ static cairo_status_t
 _cairo_pdf_emit_imagemask (cairo_image_surface_t *image,
 			     cairo_output_stream_t *stream)
 {
-    unsigned char *byte, output_byte;
+    uint8_t *byte, output_byte;
     int row, col, num_cols;
 
     /* The only image type supported by Type 3 fonts are 1-bit image
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 8fcf89e..3937cfc 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -388,7 +388,7 @@ static cairo_status_t
 _cairo_ps_emit_imagemask (cairo_image_surface_t *image,
 			  cairo_output_stream_t *stream)
 {
-    unsigned char *row, *byte;
+    uint8_t *row, *byte;
     int rows, cols;
 
     /* The only image type supported by Type 3 fonts are 1-bit image
@@ -410,18 +410,15 @@ _cairo_ps_emit_imagemask (cairo_image_surface_t *image,
 				 image->height);
 
     _cairo_output_stream_printf (stream,
-				 "   /DataSource   {<");
+				 "   /DataSource {<\n   ");
     for (row = image->data, rows = image->height; rows; row += image->stride, rows--) {
 	for (byte = row, cols = (image->width + 7) / 8; cols; byte++, cols--) {
-	    unsigned int output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte);
+	    uint8_t output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte);
 	    _cairo_output_stream_printf (stream, "%02x ", output_byte);
 	}
 	_cairo_output_stream_printf (stream, "\n   ");
     }
-    _cairo_output_stream_printf (stream,
-				 "   >}\n");
-    _cairo_output_stream_printf (stream,
-				 ">>\n");
+    _cairo_output_stream_printf (stream, ">}\n>>\n");
 
     _cairo_output_stream_printf (stream,
 				 "imagemask\n");
@@ -2238,11 +2235,13 @@ _cairo_ps_surface_paint_surface (cairo_ps_surface_t      *surface,
     cairo_matrix_translate (&ps_p2d, 0.0, height);
     cairo_matrix_scale (&ps_p2d, 1.0, -1.0);
 
-    _cairo_output_stream_printf (surface->stream,
-				 "[ %f %f %f %f %f %f ] concat\n",
-				 ps_p2d.xx, ps_p2d.yx,
-				 ps_p2d.xy, ps_p2d.yy,
-				 ps_p2d.x0, ps_p2d.y0);
+    if (! _cairo_matrix_is_identity (&ps_p2d)) {
+	_cairo_output_stream_printf (surface->stream,
+				     "[ %f %f %f %f %f %f ] concat\n",
+				     ps_p2d.xx, ps_p2d.yx,
+				     ps_p2d.xy, ps_p2d.yy,
+				     ps_p2d.x0, ps_p2d.y0);
+    }
 
     status = _cairo_ps_surface_emit_surface (surface, pattern, op);
     _cairo_ps_surface_release_surface (surface, pattern);
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 73d1eb4..385bdf0 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -2023,7 +2023,7 @@ _trace_mask_to_path (cairo_image_surface_t *mask,
 {
     cairo_status_t status;
     cairo_image_surface_t *a1_mask;
-    unsigned char *row, *byte_ptr, byte;
+    uint8_t *row, *byte_ptr, byte;
     int rows, cols, bytes_per_row;
     int x, y, bit;
     double xoff, yoff;
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 8d17cad..97ceedd 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -651,7 +651,7 @@ _cairo_svg_document_emit_bitmap_glyph_data (cairo_svg_document_t	*document,
     cairo_image_surface_t *image;
     cairo_scaled_glyph_t *scaled_glyph;
     cairo_status_t status;
-    unsigned char *row, *byte;
+    uint8_t *row, *byte;
     int rows, cols;
     int x, y, bit;
 
@@ -677,7 +677,7 @@ _cairo_svg_document_emit_bitmap_glyph_data (cairo_svg_document_t	*document,
 
     for (y = 0, row = image->data, rows = image->height; rows; row += image->stride, rows--, y++) {
 	for (x = 0, byte = row, cols = (image->width + 7) / 8; cols; byte++, cols--) {
-	    unsigned char output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte);
+	    uint8_t output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte);
 	    for (bit = 7; bit >= 0 && x < image->width; bit--, x++) {
 		if (output_byte & (1 << bit)) {
 		    _cairo_output_stream_printf (document->xml_node_glyphs,


More information about the cairo-commit mailing list