[gegl] ABYSS_NONE cause problems in the color conversion code in OpenCL



commit 59c1f9d7b4b3c7db6ca55305af62b09ca18f5609
Author: Victor Oliveira <victormatheus gmail com>
Date:   Tue Feb 19 14:59:22 2013 -0300

    ABYSS_NONE cause problems in the color conversion code in OpenCL
    
    ABYSS_NONE fills void space in buffers with black or transparent
    color depending if the color format has or not alpha. So we have
    to disable color conversion in the gpu if that's the case.

 gegl/buffer/gegl-buffer-cl-iterator.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-cl-iterator.c b/gegl/buffer/gegl-buffer-cl-iterator.c
index 16c22b9..814d6ff 100644
--- a/gegl/buffer/gegl-buffer-cl-iterator.c
+++ b/gegl/buffer/gegl-buffer-cl-iterator.c
@@ -135,6 +135,16 @@ gegl_buffer_cl_iterator_add_2 (GeglBufferClIterator  *iterator,
 
       gegl_cl_color_babl (buffer->soft_format, &i->buf_cl_format_size[self]);
       gegl_cl_color_babl (format,              &i->op_cl_format_size [self]);
+
+      /* alpha, non-alpha & GEGL_ABYSS_NONE */
+      if (babl_format_has_alpha(buffer->soft_format) != babl_format_has_alpha(format) &&
+          abyss_policy == GEGL_ABYSS_NONE &&
+          !gegl_rectangle_contains (gegl_buffer_get_extent (buffer), result))
+        {
+          i->conv[self] = GEGL_CL_COLOR_NOT_SUPPORTED;
+          GEGL_NOTE (GEGL_DEBUG_OPENCL, "Performance warning: not using color conversion "
+                                        "with OpenCL because abyss depends on alpha");
+        }
     }
   else /* GEGL_CL_BUFFER_AUX */
     {


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