[gegl] process: get rid of warning about 0px processing
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] process: get rid of warning about 0px processing
- Date: Fri, 16 Mar 2012 15:35:02 +0000 (UTC)
commit 93960755c271ccb7ff04971e56b6fa5a466e9b28
Author: Ãyvind KolÃs <pippin gimp org>
Date: Fri Mar 16 15:34:41 2012 +0000
process: get rid of warning about 0px processing
gegl/operation/gegl-operation.c | 2 +-
gegl/process/gegl-eval-visitor.c | 30 +++++++++++++++++++-----------
2 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/gegl/operation/gegl-operation.c b/gegl/operation/gegl-operation.c
index 65eb2b8..eb690ba 100644
--- a/gegl/operation/gegl-operation.c
+++ b/gegl/operation/gegl-operation.c
@@ -119,7 +119,7 @@ gegl_operation_process (GeglOperation *operation,
(result->width == 0 || result->height == 0))
{
GeglBuffer *output = gegl_buffer_new (NULL, NULL);
- g_warning ("processing 0px rectangle");
+ g_warning ("%s Eeek: processing 0px rectangle", G_STRLOC);
/* when this case is hit.. we've done something bad.. */
gegl_operation_context_take_object (context, "output", G_OBJECT (output));
return TRUE;
diff --git a/gegl/process/gegl-eval-visitor.c b/gegl/process/gegl-eval-visitor.c
index e328c6e..6ae6e45 100644
--- a/gegl/process/gegl-eval-visitor.c
+++ b/gegl/process/gegl-eval-visitor.c
@@ -81,17 +81,25 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
}
else
{
- glong time = gegl_ticks ();
+ if ((context->result_rect.width == 0 || context->result_rect.height == 0))
+ {
+ /* 0px processing, bail */
+ gegl_operation_context_take_object (context, "output", G_OBJECT (gegl_buffer_new (NULL, NULL)));
+ }
+ else
+ {
+ /* Make the operation do it's actual processing */
+ glong time = gegl_ticks ();
- /* Make the operation do it's actual processing */
- GEGL_NOTE (GEGL_DEBUG_PROCESS, "For \"%s\" processing pad '%s' result_rect = %d, %d %dÃ%d",
- gegl_pad_get_name (pad), gegl_node_get_debug_name (node),
- context->result_rect.x, context->result_rect.y, context->result_rect.width, context->result_rect.height);
- gegl_operation_process (operation, context, gegl_pad_get_name (pad),
- &context->result_rect);
- time = gegl_ticks () - time;
+ GEGL_NOTE (GEGL_DEBUG_PROCESS, "For \"%s\" processing pad '%s' result_rect = %d, %d %dÃ%d",
+ gegl_pad_get_name (pad), gegl_node_get_debug_name (node),
+ context->result_rect.x, context->result_rect.y, context->result_rect.width, context->result_rect.height);
+ gegl_operation_process (operation, context, gegl_pad_get_name (pad),
+ &context->result_rect);
+ time = gegl_ticks () - time;
- gegl_instrument ("process", gegl_node_get_operation (node), time);
+ gegl_instrument ("process", gegl_node_get_operation (node), time);
+ }
if (gegl_pad_get_num_connections (pad) > 1)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]