[cairo-commit] cairo/src cairo-glitz-surface.c, 1.27, 1.28 cairo-gstate-private.h, 1.2, 1.3 cairo-gstate.c, 1.100, 1.101 cairo-image-surface.c, 1.31, 1.32 cairo-pdf-surface.c, 1.23, 1.24 cairo-ps-surface.c, 1.29, 1.30 cairo-quartz-surface.c, 1.5, 1.6 cairo-surface.c, 1.50, 1.51 cairo-win32-surface.c, 1.13, 1.14 cairo-xcb-surface.c, 1.20, 1.21 cairo-xlib-surface.c, 1.53, 1.54 cairo.c, 1.68, 1.69 cairo.h, 1.88, 1.89 cairoint.h, 1.115, 1.116

Carl Worth commit at pdx.freedesktop.org
Mon Apr 4 06:49:22 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv7777/src

Modified Files:
	cairo-glitz-surface.c cairo-gstate-private.h cairo-gstate.c 
	cairo-image-surface.c cairo-pdf-surface.c cairo-ps-surface.c 
	cairo-quartz-surface.c cairo-surface.c cairo-win32-surface.c 
	cairo-xcb-surface.c cairo-xlib-surface.c cairo.c cairo.h 
	cairoint.h 
Log Message:

        * src/cairo.c:
        * src/cairo.h: Drop cairo_default_matrix since it is now always
        identical to cairo_identity_matrix.

        * src/cairo-gstate-private.h:
        * src/cairo-gstate.c: (_cairo_gstate_init),
        (_cairo_gstate_set_target_surface): Remove gstate->pixels_per
        inch. Change default matrix to always be the identity matrix.

        * src/cairo-glitz-surface.c:
        * src/cairo-image-surface.c:
        * src/cairo-pdf-surface.c:
        * src/cairo-ps-surface.c:
        * src/cairo-quartz-surface.c:
        * src/cairo-surface.c:
        * src/cairo-win32-surface.c:
        * src/cairo-xcb-surface.c:
        * src/cairo-xlib-surface.c:
        * src/cairoint.h: Drop pixels_per_inch function from surface
        backend interface as it is no longer needed.


Index: cairo-glitz-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-glitz-surface.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- cairo-glitz-surface.c	23 Mar 2005 21:49:33 -0000	1.27
+++ cairo-glitz-surface.c	4 Apr 2005 13:49:19 -0000	1.28
@@ -97,12 +97,6 @@
     return crsurface;
 }
 
-static double
-_cairo_glitz_surface_pixels_per_inch (void *abstract_surface)
-{
-    return 96.0;
-}
-
 static cairo_status_t
 _cairo_glitz_surface_get_image (cairo_glitz_surface_t *surface,
 				cairo_rectangle_t     *interest,
@@ -1260,7 +1254,6 @@
 static const cairo_surface_backend_t cairo_glitz_surface_backend = {
     _cairo_glitz_surface_create_similar,
     _cairo_glitz_surface_finish,
-    _cairo_glitz_surface_pixels_per_inch,
     _cairo_glitz_surface_acquire_source_image,
     _cairo_glitz_surface_release_source_image,
     _cairo_glitz_surface_acquire_dest_image,

Index: cairo-gstate-private.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate-private.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo-gstate-private.h	23 Mar 2005 21:52:54 -0000	1.2
+++ cairo-gstate-private.h	4 Apr 2005 13:49:19 -0000	1.3
@@ -68,8 +68,6 @@
 
     cairo_clip_rec_t clip;
 
-    double pixels_per_inch;
-
     cairo_matrix_t font_matrix;
 
     cairo_matrix_t ctm;

Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- cairo-gstate.c	2 Apr 2005 14:00:32 -0000	1.100
+++ cairo-gstate.c	4 Apr 2005 13:49:19 -0000	1.101
@@ -109,8 +109,7 @@
 
     gstate->alpha = 1.0;
 
-    gstate->pixels_per_inch = CAIRO_GSTATE_PIXELS_PER_INCH_DEFAULT;
-    _cairo_gstate_default_matrix (gstate);
+    _cairo_gstate_identity_matrix (gstate);
 
     _cairo_path_fixed_init (&gstate->path);
 
@@ -360,8 +359,6 @@
 cairo_status_t
 _cairo_gstate_set_target_surface (cairo_gstate_t *gstate, cairo_surface_t *surface)
 {
-    double scale;
-
     _cairo_gstate_unset_font (gstate);
 
     if (gstate->surface)
@@ -377,9 +374,7 @@
 
     cairo_surface_reference (gstate->surface);
 
-    scale = _cairo_surface_pixels_per_inch (surface) / gstate->pixels_per_inch;
-    _cairo_gstate_scale (gstate, scale, scale);
-    gstate->pixels_per_inch = _cairo_surface_pixels_per_inch (surface);
+    _cairo_gstate_identity_matrix (gstate);
 
     return CAIRO_STATUS_SUCCESS;
 }
@@ -671,25 +666,6 @@
 }
 
 cairo_status_t
-_cairo_gstate_default_matrix (cairo_gstate_t *gstate)
-{
-    int scale = gstate->pixels_per_inch / CAIRO_GSTATE_PIXELS_PER_INCH_DEFAULT + 0.5;
-    if (scale == 0)
-	scale = 1;
-
-    _cairo_gstate_unset_font (gstate);
-    
-    cairo_matrix_set_identity (&gstate->font_matrix);
-
-    cairo_matrix_set_identity (&gstate->ctm);
-    cairo_matrix_scale (&gstate->ctm, scale, scale);
-    cairo_matrix_copy (&gstate->ctm_inverse, &gstate->ctm);
-    cairo_matrix_invert (&gstate->ctm_inverse);
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-cairo_status_t
 _cairo_gstate_identity_matrix (cairo_gstate_t *gstate)
 {
     _cairo_gstate_unset_font (gstate);

Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- cairo-image-surface.c	2 Apr 2005 13:18:11 -0000	1.31
+++ cairo-image-surface.c	4 Apr 2005 13:49:19 -0000	1.32
@@ -257,13 +257,6 @@
     surface->owns_data = 1;
 }
 
-static double
-_cairo_image_surface_pixels_per_inch (void *abstract_surface)
-{
-    /* XXX: We'll want a way to let the user set this. */
-    return 96.0;
-}
-
 static cairo_status_t
 _cairo_image_surface_acquire_source_image (void                    *abstract_surface,
 					   cairo_image_surface_t  **image_out,
@@ -660,7 +653,6 @@
 static const cairo_surface_backend_t cairo_image_surface_backend = {
     _cairo_image_surface_create_similar,
     _cairo_image_abstract_surface_finish,
-    _cairo_image_surface_pixels_per_inch,
     _cairo_image_surface_acquire_source_image,
     _cairo_image_surface_release_source_image,
     _cairo_image_surface_acquire_dest_image,

Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- cairo-pdf-surface.c	2 Apr 2005 13:18:11 -0000	1.23
+++ cairo-pdf-surface.c	4 Apr 2005 13:49:19 -0000	1.24
@@ -1114,15 +1114,6 @@
     return status;
 }
 
-/* XXX: We should re-work this interface to return both X/Y ppi values. */
-static double
-_cairo_pdf_surface_pixels_per_inch (void *abstract_surface)
-{
-    cairo_pdf_surface_t *surface = abstract_surface;
- 
-    return surface->document->y_ppi;
-}
-
 static void
 _cairo_pdf_surface_ensure_stream (cairo_pdf_surface_t *surface)
 {
@@ -1856,7 +1847,6 @@
 static const cairo_surface_backend_t cairo_pdf_surface_backend = {
     _cairo_pdf_surface_create_similar,
     _cairo_pdf_surface_finish,
-    _cairo_pdf_surface_pixels_per_inch,
     _cairo_pdf_surface_acquire_source_image,
     _cairo_pdf_surface_release_source_image,
     _cairo_pdf_surface_acquire_dest_image,

Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cairo-ps-surface.c	2 Apr 2005 13:18:11 -0000	1.29
+++ cairo-ps-surface.c	4 Apr 2005 13:49:19 -0000	1.30
@@ -159,15 +159,6 @@
 				   surface->image->height);
 }
 
-/* XXX: We should re-work this interface to return both X/Y ppi values. */
-static double
-_cairo_ps_surface_pixels_per_inch (void *abstract_surface)
-{
-    cairo_ps_surface_t *surface = abstract_surface;
-
-    return surface->y_ppi;
-}
-
 static cairo_status_t
 _cairo_ps_surface_acquire_source_image (void                    *abstract_surface,
 					cairo_image_surface_t  **image_out,
@@ -387,7 +378,6 @@
 static const cairo_surface_backend_t cairo_ps_surface_backend = {
     _cairo_ps_surface_create_similar,
     _cairo_ps_surface_finish,
-    _cairo_ps_surface_pixels_per_inch,
     _cairo_ps_surface_acquire_source_image,
     _cairo_ps_surface_release_source_image,
     _cairo_ps_surface_acquire_dest_image,

Index: cairo-quartz-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-quartz-surface.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cairo-quartz-surface.c	29 Mar 2005 19:24:10 -0000	1.5
+++ cairo-quartz-surface.c	4 Apr 2005 13:49:19 -0000	1.6
@@ -106,14 +106,6 @@
         CGImageRelease(surface->cgImage);
 }
 
-
-static double _cairo_quartz_surface_pixels_per_inch(void *abstract_surface)
-{
-    // TODO - get this from CGDirectDisplay somehow?
-    return 96.0;
-}
-
-
 static cairo_status_t
 _cairo_quartz_surface_acquire_source_image(void *abstract_surface,
 					   cairo_image_surface_t **image_out,
@@ -326,7 +318,6 @@
 static const struct _cairo_surface_backend cairo_quartz_surface_backend = {
     _cairo_quartz_surface_create_similar,
     _cairo_quartz_surface_finish,
-    _cairo_quartz_surface_pixels_per_inch,
     _cairo_quartz_surface_acquire_source_image,
     _cairo_quartz_surface_release_source_image,
     _cairo_quartz_surface_acquire_dest_image,

Index: cairo-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-surface.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- cairo-surface.c	2 Apr 2005 02:00:00 -0000	1.50
+++ cairo-surface.c	4 Apr 2005 13:49:19 -0000	1.51
@@ -309,12 +309,6 @@
     surface->device_y_offset = y_offset;
 }
 
-double
-_cairo_surface_pixels_per_inch (cairo_surface_t *surface)
-{
-    return surface->backend->pixels_per_inch (surface);
-}
-
 /**
  * _cairo_surface_acquire_source_image:
  * @surface: a #cairo_surface_t

Index: cairo-win32-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-win32-surface.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cairo-win32-surface.c	30 Mar 2005 21:34:51 -0000	1.13
+++ cairo-win32-surface.c	4 Apr 2005 13:49:19 -0000	1.14
@@ -345,13 +345,6 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
-static double
-_cairo_win32_surface_pixels_per_inch (void *abstract_surface)
-{
-    /* XXX: We should really get this value from somewhere */
-    return 96.0;
-}
-
 static cairo_status_t
 _cairo_win32_surface_get_subimage (cairo_win32_surface_t  *surface,
 				   int                     x,
@@ -894,7 +887,6 @@
 static const cairo_surface_backend_t cairo_win32_surface_backend = {
     _cairo_win32_surface_create_similar,
     _cairo_win32_surface_finish,
-    _cairo_win32_surface_pixels_per_inch,
     _cairo_win32_surface_acquire_source_image,
     _cairo_win32_surface_release_source_image,
     _cairo_win32_surface_acquire_dest_image,

Index: cairo-xcb-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xcb-surface.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cairo-xcb-surface.c	25 Mar 2005 19:47:39 -0000	1.20
+++ cairo-xcb-surface.c	4 Apr 2005 13:49:19 -0000	1.21
@@ -263,13 +263,6 @@
     surface->dpy = 0;
 }
 
-static double
-_cairo_xcb_surface_pixels_per_inch (void *abstract_surface)
-{
-    /* XXX: We should really get this value from somewhere like Xft.dpy */
-    return 96.0;
-}
-
 static int
 bits_per_pixel(XCBConnection *c, int depth)
 {
@@ -870,7 +863,6 @@
 static const cairo_surface_backend_t cairo_xcb_surface_backend = {
     _cairo_xcb_surface_create_similar,
     _cairo_xcb_surface_finish,
-    _cairo_xcb_surface_pixels_per_inch,
     _cairo_xcb_surface_acquire_source_image,
     _cairo_xcb_surface_release_source_image,
     _cairo_xcb_surface_acquire_dest_image,

Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- cairo-xlib-surface.c	2 Apr 2005 13:18:11 -0000	1.53
+++ cairo-xlib-surface.c	4 Apr 2005 13:49:19 -0000	1.54
@@ -159,13 +159,6 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
-static double
-_cairo_xlib_surface_pixels_per_inch (void *abstract_surface)
-{
-    /* XXX: We should really get this value from somewhere like Xft.dpy */
-    return 96.0;
-}
-
 static cairo_status_t
 _get_image_surface (cairo_xlib_surface_t   *surface,
 		    cairo_rectangle_t      *interest_rect,
@@ -871,7 +864,6 @@
 static const cairo_surface_backend_t cairo_xlib_surface_backend = {
     _cairo_xlib_surface_create_similar,
     _cairo_xlib_surface_finish,
-    _cairo_xlib_surface_pixels_per_inch,
     _cairo_xlib_surface_acquire_source_image,
     _cairo_xlib_surface_release_source_image,
     _cairo_xlib_surface_acquire_dest_image,

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- cairo.c	2 Apr 2005 13:18:11 -0000	1.68
+++ cairo.c	4 Apr 2005 13:49:19 -0000	1.69
@@ -992,6 +992,14 @@
 }
 DEPRECATE(cairo_concat_matrix, cairo_transform);
 
+/**
+ * cairo_set_matrix:
+ * @cr: a cairo context
+ * @matrix: a transformation matrix from user space to device space
+ * 
+ * Modifies the current transformation matrix (CTM) by setting it
+ * equal to @matrix.
+ **/
 void
 cairo_set_matrix (cairo_t *cr,
 		  cairo_matrix_t *matrix)
@@ -1004,17 +1012,15 @@
     CAIRO_CHECK_SANITY (cr);
 }
 
-void
-cairo_default_matrix (cairo_t *cr)
-{
-    CAIRO_CHECK_SANITY (cr);
-    if (cr->status)
-	return;
-
-    cr->status = _cairo_gstate_default_matrix (cr->gstate);
-    CAIRO_CHECK_SANITY (cr);
-}
-
+/**
+ * cairo_identity_matrix:
+ * @cr: a cairo context
+ * 
+ * Resets the current transformation matrix (CTM) by setting it equal
+ * to the identity matrix. That is, the user-space and device-space
+ * axes will be aligned and one user-space unit will transform to one
+ * device-space unit.
+ **/
 void
 cairo_identity_matrix (cairo_t *cr)
 {
@@ -1025,7 +1031,7 @@
     cr->status = _cairo_gstate_identity_matrix (cr->gstate);
     CAIRO_CHECK_SANITY (cr);
 }
-
+DEPRECATE(cairo_default_matrix, cairo_identity_matrix);
 
 /**
  * cairo_user_to_device:

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- cairo.h	2 Apr 2005 13:18:11 -0000	1.88
+++ cairo.h	4 Apr 2005 13:49:19 -0000	1.89
@@ -327,11 +327,6 @@
 		  cairo_matrix_t *matrix);
 
 void
-cairo_default_matrix (cairo_t *cr);
-
-/* XXX: There's been a proposal to add cairo_default_matrix_exact */
-
-void
 cairo_identity_matrix (cairo_t *cr);
 
 void
@@ -1072,6 +1067,7 @@
 #define cairo_inverse_transform_distance cairo_inverse_transform_distance_DEPRECATED_BY_cairo_device_to_user_distance
 #define cairo_init_clip			 cairo_init_clip_DEPRECATED_BY_cairo_reset_clip
 #define cairo_surface_create_for_image	 cairo_surface_create_for_image_DEPRECATED_BY_cairo_image_surface_create_for_data
+#define cairo_default_matrix		 cairo_default_matrix_DEPRECATED_BY_cairo_identity_matrix
 
 #else /* CAIRO_API_SHAKEUP_FLAG_DAY */
 
@@ -1100,6 +1096,7 @@
 #define cairo_inverse_transform_distance cairo_device_to_user_distance
 #define cairo_init_clip			 cairo_reset_clip
 #define cairo_surface_create_for_image	 cairo_image_surface_create_for_data
+#define cairo_default_matrix		 cairo_identity_matrix
 
 #endif /* CAIRO_API_SHAKEUP_FLAG_DAY */
 

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- cairoint.h	2 Apr 2005 13:18:11 -0000	1.115
+++ cairoint.h	4 Apr 2005 13:49:19 -0000	1.116
@@ -536,9 +536,6 @@
     cairo_status_t
     (*finish)			(void			*surface);
 
-    double
-    (*pixels_per_inch)		(void			*surface);
-
     cairo_status_t
     (* acquire_source_image)    (void                    *abstract_surface,
 				 cairo_image_surface_t  **image_out,
@@ -812,7 +809,6 @@
 #define CAIRO_GSTATE_LINE_CAP_DEFAULT	CAIRO_LINE_CAP_BUTT
 #define CAIRO_GSTATE_LINE_JOIN_DEFAULT	CAIRO_LINE_JOIN_MITER
 #define CAIRO_GSTATE_MITER_LIMIT_DEFAULT	10.0
-#define CAIRO_GSTATE_PIXELS_PER_INCH_DEFAULT	96.0
 
 /* Need a name distinct from the cairo_clip function */
 typedef struct _cairo_clip_rec {
@@ -981,9 +977,6 @@
 			  cairo_matrix_t *matrix);
 
 cairo_private cairo_status_t
-_cairo_gstate_default_matrix (cairo_gstate_t *gstate);
-
-cairo_private cairo_status_t
 _cairo_gstate_identity_matrix (cairo_gstate_t *gstate);
 
 cairo_private cairo_status_t
@@ -1420,9 +1413,6 @@
 cairo_private cairo_status_t
 _cairo_surface_show_page (cairo_surface_t *surface);
 
-cairo_private double
-_cairo_surface_pixels_per_inch (cairo_surface_t *surface);
-
 cairo_private cairo_status_t
 _cairo_surface_acquire_source_image (cairo_surface_t         *surface,
 				     cairo_image_surface_t  **image_out,




More information about the cairo-commit mailing list