Commit 3d9f1d15 authored by Carl Worth's avatar Carl Worth

Simplify matrix manipulation now that cairo exposes the cairo_matrix_t


        * gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
        now that cairo exposes the cairo_matrix_t structure.

        * gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
        cairo API change in signedness of data argument.
parent 3962c116
2005-04-08 Carl Worth <cworth@cworth.org>
* gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
now that cairo exposes the cairo_matrix_t structure.
* gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
cairo API change in signedness of data argument.
2005-04-08 Matthias Clasen <mclasen@redhat.com> 2005-04-08 Matthias Clasen <mclasen@redhat.com>
Fix double-click to autosize treeview columns. This was Fix double-click to autosize treeview columns. This was
......
2005-04-08 Carl Worth <cworth@cworth.org>
* gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
now that cairo exposes the cairo_matrix_t structure.
* gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
cairo API change in signedness of data argument.
2005-04-08 Matthias Clasen <mclasen@redhat.com> 2005-04-08 Matthias Clasen <mclasen@redhat.com>
Fix double-click to autosize treeview columns. This was Fix double-click to autosize treeview columns. This was
......
2005-04-08 Carl Worth <cworth@cworth.org>
* gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
now that cairo exposes the cairo_matrix_t structure.
* gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
cairo API change in signedness of data argument.
2005-04-08 Matthias Clasen <mclasen@redhat.com> 2005-04-08 Matthias Clasen <mclasen@redhat.com>
Fix double-click to autosize treeview columns. This was Fix double-click to autosize treeview columns. This was
......
...@@ -118,18 +118,16 @@ gdk_pango_renderer_constructor (GType type, ...@@ -118,18 +118,16 @@ gdk_pango_renderer_constructor (GType type,
static void static void
emboss_context (cairo_t *cr) emboss_context (cairo_t *cr)
{ {
cairo_matrix_t *tmp_matrix = cairo_matrix_create (); cairo_matrix_t tmp_matrix;
double a, b, c, d, tx, ty;
/* The gymnastics here to adjust the matrix are because we want /* The gymnastics here to adjust the matrix are because we want
* to offset by +1,+1 in device-space, not in user-space, * to offset by +1,+1 in device-space, not in user-space,
* so we can't just draw the layout at x + 1, y + 1 * so we can't just draw the layout at x + 1, y + 1
*/ */
cairo_get_matrix (cr, tmp_matrix); cairo_get_matrix (cr, &tmp_matrix);
cairo_matrix_get_affine (tmp_matrix, &a, &b, &c, &d, &tx, &ty); tmp_matrix.x0 += 1.0;
cairo_matrix_set_affine (tmp_matrix, a, b, c, d, tx + 1, ty + 1); tmp_matrix.y0 += 1.0;
cairo_set_matrix (cr, tmp_matrix); cairo_set_matrix (cr, &tmp_matrix);
cairo_matrix_destroy (tmp_matrix);
cairo_set_rgb_color (cr, 1.0, 1.0, 1.0); cairo_set_rgb_color (cr, 1.0, 1.0, 1.0);
} }
......
...@@ -362,8 +362,9 @@ gdk_pixbuf_set_as_cairo_source (GdkPixbuf *pixbuf, ...@@ -362,8 +362,9 @@ gdk_pixbuf_set_as_cairo_source (GdkPixbuf *pixbuf,
format = CAIRO_FORMAT_ARGB32; format = CAIRO_FORMAT_ARGB32;
cairo_pixels = g_malloc (4 * width * height); cairo_pixels = g_malloc (4 * width * height);
surface = cairo_image_surface_create_for_data ((char *)cairo_pixels, format, surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels,
width, height, 4 * width); format,
width, height, 4 * width);
cairo_surface_set_user_data (surface, &key, cairo_surface_set_user_data (surface, &key,
cairo_pixels, (cairo_destroy_func_t)g_free); cairo_pixels, (cairo_destroy_func_t)g_free);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment