[gegl] transform prepare: only create the sampler if needed



commit f23587360c53a7143a72ce1381f53ddfe7a4ef0e
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Thu May 23 05:58:46 2013 -0700

    transform prepare: only create the sampler if needed

 operations/transform/transform-core.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 984b182..4cc3105 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -574,12 +574,6 @@ gegl_transform_get_required_for_output (GeglOperation       *op,
   gint           i;
 
   requested_rect = *region;
-  sampler =
-    gegl_buffer_sampler_new (NULL,
-                             babl_format("RaGaBaA float"),
-                             gegl_sampler_type_from_string (transform->filter));
-  context_rect = *gegl_sampler_get_context_rect (sampler);
-  g_object_unref (sampler);
 
   gegl_transform_create_composite_matrix (transform, &inverse);
   gegl_matrix3_invert (&inverse);
@@ -588,6 +582,13 @@ gegl_transform_get_required_for_output (GeglOperation       *op,
       gegl_matrix3_is_identity (&inverse))
     return requested_rect;
 
+  sampler =
+    gegl_buffer_sampler_new (NULL,
+                             babl_format("RaGaBaA float"),
+                             gegl_sampler_type_from_string (transform->filter));
+  context_rect = *gegl_sampler_get_context_rect (sampler);
+  g_object_unref (sampler);
+
   /*
    * Convert indices to absolute positions:
    */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]