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

Andrea Canciani ranma42 at kemper.freedesktop.org
Tue Nov 23 06:23:57 PST 2010


 src/cairo-ps-surface.c  |    5 ++---
 src/cairo-quartz-font.c |   23 ++++++++++-------------
 2 files changed, 12 insertions(+), 16 deletions(-)

New commits:
commit 56528d7b9dd1dcd74cd1806f8b22d2d8189f0a03
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Mon Nov 22 23:41:33 2010 +0100

    ps: Fix painting
    
    Painting of some pattern was broken because the paint operation was
    implemented as a fill to a rect containing the clip, but this rect was
    not transformed as appropriate (using the cairo_to_ps matrix).
    PDF simply fills the whole surface rect, so we implement the same
    behavior in PS.
    
    Fixes clip-group-shapes-circles, clip-stroke, linear-gradient-extend,
    linear-gradient-one-stop, radial-gradient-one-stop.

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 03c1fa0..fc02003 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -3552,9 +3552,8 @@ _cairo_ps_surface_paint (void			*abstract_surface,
 	if (unlikely (status))
 	    return status;
 
-	_cairo_output_stream_printf (stream, "%d %d %d %d rectfill\n",
-				     extents.bounded.x, extents.bounded.y,
-				     extents.bounded.width, extents.bounded.height);
+	_cairo_output_stream_printf (stream, "0 0 %f %f rectfill\n",
+				     surface->width, surface->height);
     }
 
     return CAIRO_STATUS_SUCCESS;
commit e2c9964c3e1bbf253b20f3e7b747eeedcb3f56e6
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Tue Nov 23 13:24:25 2010 +0100

    quartz-font: Implement new load_truetype_table semantics
    
    fb0304e2a9c99fa00e68bf4b37074a6885f19cff changed and specified the
    behavior of load_truetype_table.
    This commit makes quartz-font implement the new behavior.

diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c
index da9d2ae..75dda02 100644
--- a/src/cairo-quartz-font.c
+++ b/src/cairo-quartz-font.c
@@ -767,7 +767,6 @@ _cairo_quartz_load_truetype_table (void	            *abstract_font,
 {
     cairo_quartz_font_face_t *font_face = _cairo_quartz_scaled_to_face (abstract_font);
     CFDataRef data = NULL;
-    CFIndex len;
 
     if (likely (CGFontCopyTableForTagPtr))
 	data = CGFontCopyTableForTagPtr (font_face->cgFont, tag);
@@ -775,20 +774,18 @@ _cairo_quartz_load_truetype_table (void	            *abstract_font,
     if (!data)
         return CAIRO_INT_STATUS_UNSUPPORTED;
 
-    if (length) {
-	if (*length == 0) {
-	    *length = CFDataGetLength (data);
-	    CFRelease (data);
-	    return CAIRO_STATUS_SUCCESS;
-	}
-
-	len = *length;
-    } else
-	len = CFDataGetLength (data);
+    if (buffer == NULL) {
+	*length = CFDataGetLength (data);
+	CFRelease (data);
+	return CAIRO_STATUS_SUCCESS;
+    }
 
-    if (buffer)
-	CFDataGetBytes (data, CFRangeMake (offset, len), buffer);
+    if (CFDataGetLength (data) < offset + (long) *length) {
+	CFRelease (data);
+	return CAIRO_INT_STATUS_UNSUPPORTED;
+    }
 
+    CFDataGetBytes (data, CFRangeMake (offset, *length), buffer);
     CFRelease (data);
 
     return CAIRO_STATUS_SUCCESS;


More information about the cairo-commit mailing list