[cairo-commit] 3 commits - src/cairo-win32-printing-surface.c src/cairo-win32-private.h util/cairo-trace

Chris Wilson ickle at kemper.freedesktop.org
Tue Nov 4 02:43:37 PST 2008


 src/cairo-win32-printing-surface.c |    3 ++-
 src/cairo-win32-private.h          |    3 ++-
 util/cairo-trace/Makefile.am       |   12 ++++++------
 util/cairo-trace/trace.c           |   34 +++++++++++++++++++++++++---------
 4 files changed, 35 insertions(+), 17 deletions(-)

New commits:
commit 3f18d38fbdc661d34e0fd951e0fd3aa1aa2cbcc9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Nov 4 10:31:48 2008 +0000

    [win32] Compile fix for extend-pad extents.
    
    Update the show_glyphs() prototype to include the extents argument.

diff --git a/src/cairo-win32-printing-surface.c b/src/cairo-win32-printing-surface.c
index 77febf0..94bbc28 100644
--- a/src/cairo-win32-printing-surface.c
+++ b/src/cairo-win32-printing-surface.c
@@ -1418,7 +1418,8 @@ _cairo_win32_printing_surface_show_glyphs (void                 *abstract_surfac
 	status = _cairo_win32_surface_show_glyphs (surface, op,
 						   source, glyphs,
 						   num_glyphs, scaled_font,
-						   remaining_glyphs);
+						   remaining_glyphs,
+						   extents);
 	if (surface->has_ctm)
 	    cairo_scaled_font_destroy (scaled_font);
 
diff --git a/src/cairo-win32-private.h b/src/cairo-win32-private.h
index 09f6328..6f15408 100644
--- a/src/cairo-win32-private.h
+++ b/src/cairo-win32-private.h
@@ -145,7 +145,8 @@ _cairo_win32_surface_show_glyphs (void			*surface,
 				  cairo_glyph_t		*glyphs,
 				  int			 num_glyphs,
 				  cairo_scaled_font_t	*scaled_font,
-				  int			*remaining_glyphs);
+				  int			*remaining_glyphs,
+				  cairo_rectangle_int_t *extents);
 
 cairo_surface_t *
 _cairo_win32_surface_create_similar (void	    *abstract_src,
commit 5ba95b7e1287ade0b8a1acf2f5cb73fa1f44c451
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Nov 4 09:22:28 2008 +0000

    [trace] Convert [1 0 0 1 0 0] to identity
    
    Simplify the trace/replay by replacing the identity array with the
    identity operator.

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 864038d..eeca07a 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -800,6 +800,14 @@ _get_surface_id (cairo_surface_t *surface)
     return _get_id (SURFACE, surface);
 }
 
+static bool
+_matrix_is_identity (const cairo_matrix_t *m)
+{
+    return m->xx == 1. && m->yx == 0. &&
+	   m->xy == 0. && m->yy == 1. &&
+	   m->x0 == 0. && m->y0 == 0.;
+}
+
 #define BUFFER_SIZE 16384
 struct _data_stream {
     z_stream zlib_stream;
@@ -1558,10 +1566,14 @@ cairo_transform (cairo_t *cr, const cairo_matrix_t *matrix)
 void
 cairo_set_matrix (cairo_t *cr, const cairo_matrix_t *matrix)
 {
-    _emit_cairo_op (cr, "[%g %g %g %g %g %g] set_matrix\n",
-		    matrix->xx, matrix->yx,
-		    matrix->xy, matrix->yy,
-		    matrix->x0, matrix->y0);
+    if (_matrix_is_identity (matrix)) {
+	_emit_cairo_op (cr, "identity set_matrix\n");
+    } else {
+	_emit_cairo_op (cr, "[%g %g %g %g %g %g] set_matrix\n",
+			matrix->xx, matrix->yx,
+			matrix->xy, matrix->yy,
+			matrix->x0, matrix->y0);
+    }
     return DLCALL (cairo_set_matrix, cr, matrix);
 }
 
@@ -2707,11 +2719,15 @@ cairo_pattern_add_color_stop_rgba (cairo_pattern_t *pattern, double offset, doub
 void
 cairo_pattern_set_matrix (cairo_pattern_t *pattern, const cairo_matrix_t *matrix)
 {
-    _emit_pattern_op (pattern,
-		      "[%g %g %g %g %g %g] set_matrix\n",
-		      matrix->xx, matrix->yx,
-		      matrix->xy, matrix->yy,
-		      matrix->x0, matrix->y0);
+    if (_matrix_is_identity (matrix)) {
+	_emit_pattern_op (pattern, "identity set_matrix\n");
+    } else {
+	_emit_pattern_op (pattern,
+			  "[%g %g %g %g %g %g] set_matrix\n",
+			  matrix->xx, matrix->yx,
+			  matrix->xy, matrix->yy,
+			  matrix->x0, matrix->y0);
+    }
     return DLCALL (cairo_pattern_set_matrix, pattern, matrix);
 }
 
commit 3664b32195b101ebab9a5f9087095306f8969c80
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Nov 4 10:38:41 2008 +0000

    [trace] Remove more @..@ from Makefile.am
    
    Use $(..) for make variable substitution as opposed to incorrectly using
    @..@ for substitution by configure.

diff --git a/util/cairo-trace/Makefile.am b/util/cairo-trace/Makefile.am
index c6caf0c..f9c68b1 100644
--- a/util/cairo-trace/Makefile.am
+++ b/util/cairo-trace/Makefile.am
@@ -1,5 +1,5 @@
 bin_SCRIPTS = cairo-trace
-cairolibdir = @libdir@/cairo
+cairolibdir = $(libdir)/cairo
 cairolib_LTLIBRARIES = cairo-trace.la
 
 AM_CPPFLAGS = -I$(top_srcdir)/src \
@@ -9,15 +9,15 @@ cairo_trace_la_SOURCES = \
 			 lookup-symbol.c \
 			 lookup-symbol.h \
 			 trace.c
-cairo_trace_la_CFLAGS = $(FREETYPE_CFLAGS) $(CAIRO_CFLAGS)
+cairo_trace_la_CFLAGS = $(CAIRO_CFLAGS)
 cairo_trace_la_LDFLAGS = -module -no-undefined
 cairo_trace_la_LIBADD = -ldl -lz $(BFD_LIBS)
 
-system-install:
-	grep -sq @cairolibdir@/cairo-trace.so /etc/ld.so.preload || echo @libdir@/cairo-trace.so >> /etc/ld.so.preload
+system-install: install
+	grep -sq $(cairolibdir)/cairo-trace.so /etc/ld.so.preload || echo $(cairolibdir)/cairo-trace.so >> /etc/ld.so.preload
 
-system-uninstall:
-	sed -e '@cairolibdir@\/cairo-trace.so/d' < /etc/ld.so.preload > /tmp/ld.so.preload && mv /tmp/ld.so.preload /etc/ld.so.preload;
+system-uninstall: uninstall
+	sed -e '$(cairolibdir)\/cairo-trace.so/d' < /etc/ld.so.preload > /tmp/ld.so.preload && mv /tmp/ld.so.preload /etc/ld.so.preload;
 
 EXTRA_DIST = \
 	COPYING \


More information about the cairo-commit mailing list