gegl r1935 - in trunk: . operations/meta operations/render
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r1935 - in trunk: . operations/meta operations/render
- Date: Tue, 29 Jan 2008 07:46:31 +0000 (GMT)
Author: neo
Date: Tue Jan 29 07:46:30 2008
New Revision: 1935
URL: http://svn.gnome.org/viewvc/gegl?rev=1935&view=rev
Log:
2008-01-29 Sven Neumann <sven gimp org>
* operations/render/color.c
* operations/render/text.c
* operations/render/noise.c: use g_new() instead of g_malloc().
Modified:
trunk/ChangeLog
trunk/operations/meta/layer.c
trunk/operations/render/color.c
trunk/operations/render/noise.c
trunk/operations/render/text.c
Modified: trunk/operations/meta/layer.c
==============================================================================
--- trunk/operations/meta/layer.c (original)
+++ trunk/operations/meta/layer.c Tue Jan 29 07:46:30 2008
@@ -101,7 +101,7 @@
if (!g_file_test (self->src, G_FILE_TEST_EXISTS))
{
- gchar *name = g_filename_display_name (self->path);
+ gchar *name = g_filename_display_name (self->src);
gchar *tmp = g_strdup_printf ("File '%s' does not exist", name);
g_free (name);
g_warning ("load: %s", tmp);
Modified: trunk/operations/render/color.c
==============================================================================
--- trunk/operations/render/color.c (original)
+++ trunk/operations/render/color.c Tue Jan 29 07:46:30 2008
@@ -62,13 +62,13 @@
&color[2],
&color[3]);
- buf = g_malloc (result->width * result->height * 4 * sizeof (gfloat));
+ buf = g_new (gfloat, result->width * result->height * 4);
{
- gfloat *dst=buf;
- gint i;
- for (i=0; i < result->height *result->width ; i++)
+ gfloat *dst = buf;
+ gint i;
+ for (i = 0; i < result->height * result->width ; i++)
{
- memcpy(dst, color, 4*sizeof(gfloat));
+ memcpy(dst, color, 4 * sizeof (gfloat));
dst += 4;
}
}
Modified: trunk/operations/render/noise.c
==============================================================================
--- trunk/operations/render/noise.c (original)
+++ trunk/operations/render/noise.c Tue Jan 29 07:46:30 2008
@@ -54,14 +54,14 @@
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
gfloat *buf;
- buf = g_malloc (result->width * result->height * 4);
+ buf = g_new (gfloat, result->width * result->height);
{
- gfloat *dst=buf;
- gint y;
- for (y=0; y < result->height; y++)
+ gfloat *dst = buf;
+ gint y;
+ for (y = 0; y < result->height; y++)
{
gint x;
- for (x=0; x < result->width ; x++)
+ for (x = 0; x < result->width ; x++)
{
gfloat val;
Modified: trunk/operations/render/text.c
==============================================================================
--- trunk/operations/render/text.c (original)
+++ trunk/operations/render/text.c Tue Jan 29 07:46:30 2008
@@ -154,13 +154,17 @@
GeglBuffer *output,
const GeglRectangle *result)
{
- GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
-
- guchar *data = g_malloc0 (result->width * result->height * 4);
- cairo_t *cr;
+ GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- cairo_surface_t *surface = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_ARGB32,
- result->width, result->height, result->width * 4);
+ guchar *data = g_new0 (guchar, result->width * result->height * 4);
+ cairo_t *cr;
+ cairo_surface_t *surface;
+
+ surface = cairo_image_surface_create_for_data (data,
+ CAIRO_FORMAT_ARGB32,
+ result->width,
+ result->height,
+ result->width * 4);
cr = cairo_create (surface);
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
cairo_translate (cr, -result->x, -result->y);
@@ -235,7 +239,7 @@
finalize (GObject *object)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (object);
-
+
if (self->priv)
{
CachedExtent *extent = (CachedExtent*)self->priv;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]