Evas filter: Fix proxies of filtered images
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 8 Oct 2015 02:19:50 +0000 (11:19 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 12 Oct 2015 04:40:20 +0000 (13:40 +0900)
@fix

src/lib/evas/canvas/evas_filter.eo
src/lib/evas/canvas/evas_filter_mixin.c
src/lib/evas/canvas/evas_object_image.c

index 5f8442f..0d618c5 100644 (file)
@@ -57,6 +57,17 @@ mixin Evas.Filter (Efl.Gfx.Filter)
            Virtual, to be implemented in the parent class.
          ]]
       }
+      @property output_buffer @protected {
+         get {
+            [[Retrieve cached output buffer, if any.
+
+              Does not increment the reference count.
+            ]]
+         }
+         values {
+            buffer: void*;
+         }
+      }
    }
    implements {
       Efl.Gfx.Filter.program.set;
index 154c6dc..46bf5fe 100644 (file)
@@ -584,4 +584,10 @@ _evas_filter_efl_gfx_filter_data_set(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
    FCOW_END(fcow, pd);
 }
 
+EOLIAN void *
+_evas_filter_output_buffer_get(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd)
+{
+   return pd->data->output;
+}
+
 #include "evas_filter.eo.c"
index 6b05037..ee19838 100644 (file)
@@ -3290,7 +3290,7 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
                    void *output, void *context, void *surface, int x, int y,
                    int l, int t, int r, int b, Eina_Bool do_async)
 {
-   Evas_Image_Data *o = obj->private_data;
+   Evas_Image_Data *o = obj->private_data, *oi = NULL;
    int imagew, imageh, uvw, uvh;
    void *pixels;
 
@@ -3298,6 +3298,8 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
       (o->cur->source ?
        eo_data_scope_get(o->cur->source, EVAS_OBJECT_CLASS):
        NULL);
+   if (source && (source->type == o_type))
+     oi = eo_data_scope_get(o->cur->source, MY_CLASS);
 
    if (o->cur->scene)
      {
@@ -3333,13 +3335,16 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
         uvw = imagew;
         uvh = imageh;
      }
-   else if (source->type == o_type &&
-            ((Evas_Image_Data *)eo_data_scope_get(o->cur->source, MY_CLASS))->engine_data)
+   else if (oi && oi->engine_data)
      {
-        Evas_Image_Data *oi;
-
-        oi = eo_data_scope_get(o->cur->source, MY_CLASS);
         pixels = oi->engine_data;
+        if (oi->has_filter)
+          {
+             void *output_buffer = eo_do_ret(source->object, output_buffer,
+                                             evas_filter_output_buffer_get());
+             if (output_buffer)
+               pixels = output_buffer;
+          }
         imagew = oi->cur->image.w;
         imageh = oi->cur->image.h;
         uvw = source->cur->geometry.w;