app: fix GIMP_TIMER_END() to take an arbitrary string
not a string constant that only works in the C preprocessor, and add a timer to gimp_apply_operation().
This commit is contained in:
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "gegl/gimp-gegl-utils.h"
|
#include "gegl/gimp-gegl-utils.h"
|
||||||
|
|
||||||
|
#include "gimp-utils.h"
|
||||||
#include "gimp-apply-operation.h"
|
#include "gimp-apply-operation.h"
|
||||||
#include "gimpprogress.h"
|
#include "gimpprogress.h"
|
||||||
|
|
||||||
@ -92,10 +93,18 @@ gimp_apply_operation (GeglBuffer *src_buffer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GIMP_UNSTABLE
|
||||||
|
GIMP_TIMER_START ();
|
||||||
|
#endif
|
||||||
|
|
||||||
while (gegl_processor_work (processor, &value))
|
while (gegl_processor_work (processor, &value))
|
||||||
if (progress)
|
if (progress)
|
||||||
gimp_progress_set_value (progress, value);
|
gimp_progress_set_value (progress, value);
|
||||||
|
|
||||||
|
#ifdef GIMP_UNSTABLE
|
||||||
|
GIMP_TIMER_END (undo_desc ? undo_desc : "operation");
|
||||||
|
#endif
|
||||||
|
|
||||||
g_object_unref (processor);
|
g_object_unref (processor);
|
||||||
|
|
||||||
g_object_unref (gegl);
|
g_object_unref (gegl);
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
{ GTimer *_timer = g_timer_new ();
|
{ GTimer *_timer = g_timer_new ();
|
||||||
|
|
||||||
#define GIMP_TIMER_END(message) \
|
#define GIMP_TIMER_END(message) \
|
||||||
g_printerr ("%s: " message " took %0.2f seconds\n", \
|
g_printerr ("%s: %s took %0.2f seconds\n", \
|
||||||
G_STRFUNC, g_timer_elapsed (_timer, NULL)); \
|
G_STRFUNC, message, g_timer_elapsed (_timer, NULL)); \
|
||||||
g_timer_destroy (_timer); }
|
g_timer_destroy (_timer); }
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "gegl/gimp-gegl-utils.h"
|
#include "gegl/gimp-gegl-utils.h"
|
||||||
|
|
||||||
#include "gimp-utils.h" /* temp for GIMP_TIMER */
|
#include "gimp-utils.h"
|
||||||
#include "gimpchannel.h"
|
#include "gimpchannel.h"
|
||||||
#include "gimpcontext.h"
|
#include "gimpcontext.h"
|
||||||
#include "gimpdrawable-combine.h"
|
#include "gimpdrawable-combine.h"
|
||||||
@ -434,10 +434,6 @@ gimp_drawable_scale (GimpItem *item,
|
|||||||
new_width, new_height),
|
new_width, new_height),
|
||||||
gimp_drawable_get_format (drawable));
|
gimp_drawable_get_format (drawable));
|
||||||
|
|
||||||
#ifdef GIMP_UNSTABLE
|
|
||||||
GIMP_TIMER_START ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
scale = g_object_new (GEGL_TYPE_NODE,
|
scale = g_object_new (GEGL_TYPE_NODE,
|
||||||
"operation", "gegl:scale",
|
"operation", "gegl:scale",
|
||||||
NULL);
|
NULL);
|
||||||
@ -458,10 +454,6 @@ gimp_drawable_scale (GimpItem *item,
|
|||||||
scale, new_buffer);
|
scale, new_buffer);
|
||||||
g_object_unref (scale);
|
g_object_unref (scale);
|
||||||
|
|
||||||
#ifdef GIMP_UNSTABLE
|
|
||||||
GIMP_TIMER_END ("scaling");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gimp_drawable_set_buffer_full (drawable, gimp_item_is_attached (item), NULL,
|
gimp_drawable_set_buffer_full (drawable, gimp_item_is_attached (item), NULL,
|
||||||
new_buffer,
|
new_buffer,
|
||||||
new_offset_x, new_offset_y);
|
new_offset_x, new_offset_y);
|
||||||
|
Reference in New Issue
Block a user