gimp r27438 - in trunk: . app/text
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27438 - in trunk: . app/text
- Date: Mon, 27 Oct 2008 08:34:07 +0000 (UTC)
Author: neo
Date: Mon Oct 27 08:34:07 2008
New Revision: 27438
URL: http://svn.gnome.org/viewvc/gimp?rev=27438&view=rev
Log:
2008-10-27 Sven Neumann <sven gimp org>
* app/text/gimptextlayer.c (gimp_text_layer_render_layout):
iterate over the tiles instead of rendering row-by-row.
Modified:
trunk/ChangeLog
trunk/app/text/gimptextlayer.c
Modified: trunk/app/text/gimptextlayer.c
==============================================================================
--- trunk/app/text/gimptextlayer.c (original)
+++ trunk/app/text/gimptextlayer.c Mon Oct 27 08:34:07 2008
@@ -602,18 +602,18 @@
cairo_surface_t *surface;
PixelRegion textPR;
PixelRegion maskPR;
- gint i;
- gint width, height;
+ const guchar *data;
+ gint rowstride;
+ gint width;
+ gint height;
+ gpointer pr;
gimp_drawable_fill (drawable, &layer->text->color, NULL);
-
width = gimp_item_width (item);
height = gimp_item_height (item);
-
- surface = cairo_image_surface_create (CAIRO_FORMAT_A8,
- width, height);
+ surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
cr = cairo_create (surface);
@@ -624,10 +624,25 @@
mask = tile_manager_new ( width, height, 1);
pixel_region_init (&maskPR, mask, 0, 0, width, height, TRUE);
- for (i = 0; i < height; i++)
- pixel_region_set_row (&maskPR,
- 0, i, width,
- cairo_image_surface_get_data (surface) + i * cairo_image_surface_get_stride (surface));
+ data = cairo_image_surface_get_data (surface);
+ rowstride = cairo_image_surface_get_stride (surface);
+
+ for (pr = pixel_regions_register (1, &maskPR);
+ pr != NULL;
+ pr = pixel_regions_process (pr))
+ {
+ const guchar *src = data + maskPR.x + maskPR.y * rowstride;
+ guchar *dest = maskPR.data;
+ gint rows = maskPR.h;
+
+ while (rows--)
+ {
+ memcpy (dest, src, maskPR.w);
+
+ src += rowstride;
+ dest += maskPR.rowstride;
+ }
+ }
cairo_destroy (cr);
cairo_surface_destroy (surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]