+2008-05-26 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 513811 – Use cairo_format_stride_for_width()
+
+ * gtk/gtkhsv.c (paint_ring, paint_triangle):
+ * gdk/gdkcairo.c (gdk_cairo_set_source_pixbuf): Use
+ cairo_format_stride_for_width, proposed by Behdad Esfahbod.
+
+ * configure.in: Bump cairo requirement to 1.6.0
+
+ * INSTALL.in: Update required versions
+
2008-05-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkshow.[hc]: Formatting fixes
GTK+ requires the following packages:
- The GLib, Pango, ATK and cairo libraries, available at the same
- location as GTK+. GTK+ @GTK_VERSION@ requires at least GLib 2.12,
- Pango 1.13, ATK 1.9 and cairo 1.2.
+ location as GTK+. GTK+ @GTK_VERSION@ requires at least GLib 2.15.0,
+ Pango 1.19.3, ATK 1.13.0 and cairo 1.6.0.
- The TIFF, PNG, and JPEG image loading libraries. You most
likely have these installed on your system already. If not
m4_define([glib_required_version], [2.15.0])
m4_define([pango_required_version], [1.19.3])
m4_define([atk_required_version], [1.13.0])
-m4_define([cairo_required_version], [1.5.2])
+m4_define([cairo_required_version], [1.6])
AC_INIT([gtk+], [gtk_version],
guchar *gdk_pixels = gdk_pixbuf_get_pixels (pixbuf);
int gdk_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
int n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+ int cairo_stride;
guchar *cairo_pixels;
cairo_format_t format;
cairo_surface_t *surface;
else
format = CAIRO_FORMAT_ARGB32;
- cairo_pixels = g_malloc (4 * width * height);
+ cairo_stride = cairo_format_stride_for_width (format, width);
+ cairo_pixels = g_malloc (height * cairo_stride);
surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels,
- format,
- width, height, 4 * width);
+ format,
+ width, height, cairo_stride);
+
cairo_surface_set_user_data (surface, &key,
cairo_pixels, (cairo_destroy_func_t)g_free);
}
gdk_pixels += gdk_rowstride;
- cairo_pixels += 4 * width;
+ cairo_pixels += cairo_stride;
}
cairo_set_source_surface (cr, surface, pixbuf_x, pixbuf_y);
gdouble r, g, b;
cairo_surface_t *source;
cairo_t *source_cr;
+ gint stride;
gint focus_width;
gint focus_pad;
/* Create an image initialized with the ring colors */
- buf = g_new (guint32, width * height);
+ stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width);
+ buf = g_new (guint32, height * stride / 4);
for (yy = 0; yy < height; yy++)
{
source = cairo_image_surface_create_for_data ((char *)buf,
CAIRO_FORMAT_RGB24,
- width, height, 4 * width);
+ width, height, stride);
/* Now draw the value marker onto the source image, so that it
* will get properly clipped at the edges of the ring
cairo_surface_t *source;
gdouble r, g, b;
gchar *detail;
+ gint stride;
priv = hsv->priv;
}
/* Shade the triangle */
-
- buf = g_new (guint32, width * height);
+
+ stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width);
+ buf = g_new (guint32, height * stride / 4);
for (yy = 0; yy < height; yy++)
{
source = cairo_image_surface_create_for_data ((char *)buf,
CAIRO_FORMAT_RGB24,
- width, height, 4 * width);
+ width, height, stride);
/* Draw a triangle with the image as a source */