Evas filters: Remove FIXME and unimplemented code
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 4 Feb 2014 03:32:15 +0000 (12:32 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 7 Feb 2014 08:33:17 +0000 (17:33 +0900)
Remove compilation warnings: we don't really need cubic
interpolation at this point, we can still add it back
later if wanted.

Also, make it clear that buffer #2 is the output buffer.
Remove meaningless FIXME.

src/lib/evas/filters/evas_filter.c
src/lib/evas/filters/evas_filter_parser.c
src/lib/evas/filters/evas_filter_private.h
src/lib/evas/filters/evas_filter_utils.c
src/lib/evas/include/evas_filter.h

index 8bf7b47..1d41f93 100644 (file)
@@ -1450,7 +1450,9 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
    if (!ctx->gl_engine)
      {
         ctx->target.bufid = evas_filter_buffer_image_new(ctx, surface);
-        evas_filter_command_blend_add(ctx, draw_context, 2, ctx->target.bufid,
+        evas_filter_command_blend_add(ctx, draw_context,
+                                      EVAS_FILTER_BUFFER_OUTPUT_ID,
+                                      ctx->target.bufid,
                                       x, y, EVAS_FILTER_FILL_MODE_NONE);
      }
    else
@@ -1468,7 +1470,7 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
         target->glimage = target->backing;
         target->backing = NULL;
 
-        image = _filter_buffer_get(ctx, 2);
+        image = _filter_buffer_get(ctx, EVAS_FILTER_BUFFER_OUTPUT_ID);
         im = image->backing;
         image->glimage = ENFN->image_new_from_data
           (ENDT, image->w, image->h, im->image.data, EINA_TRUE, im->cache_entry.space);
@@ -1491,7 +1493,7 @@ _filter_target_render(Evas_Filter_Context *ctx)
    if (!ctx->gl_engine) return EINA_FALSE;
    EINA_SAFETY_ON_FALSE_RETURN_VAL(ctx->target.bufid, EINA_FALSE);
 
-   src = _filter_buffer_get(ctx, 2);
+   src = _filter_buffer_get(ctx, EVAS_FILTER_BUFFER_OUTPUT_ID);
    if (!src) return EINA_FALSE;
 
    dst = _filter_buffer_get(ctx, ctx->target.bufid);
index 6033f43..f30095f 100644 (file)
@@ -1704,13 +1704,8 @@ _instr2cmd_curve(Evas_Filter_Context *ctx, Evas_Filter_Program *pgm,
           channel = EVAS_FILTER_CHANNEL_ALPHA;
      }
 
-   if (interpolation)
-     {
-        if (!strcasecmp(interpolation, "none"))
-          mode = EVAS_FILTER_INTERPOLATION_MODE_NONE;
-        else if (!strcasecmp(interpolation, "cubic"))
-          mode = EVAS_FILTER_INTERPOLATION_MODE_CUBIC;
-     }
+   if (interpolation && !strcasecmp(interpolation, "none"))
+     mode = EVAS_FILTER_INTERPOLATION_MODE_NONE;
 
    if (!points_str) goto interpolated;
    copy = strdup(points_str);
index a91cbcb..f6ecc56 100644 (file)
@@ -163,8 +163,7 @@ struct _Evas_Filter_Buffer
 enum _Evas_Filter_Interpolation_Mode
 {
    EVAS_FILTER_INTERPOLATION_MODE_NONE,
-   EVAS_FILTER_INTERPOLATION_MODE_LINEAR,
-   EVAS_FILTER_INTERPOLATION_MODE_CUBIC
+   EVAS_FILTER_INTERPOLATION_MODE_LINEAR
 };
 
 void                     evas_filter_context_clear(Evas_Filter_Context *ctx);
index 5e80481..7ef552f 100644 (file)
@@ -105,13 +105,6 @@ _interpolate_linear(DATA8 *output, DATA8 *points, int point_count)
    return EINA_TRUE;
 }
 
-static Eina_Bool
-_interpolate_cubic(DATA8 *output, DATA8 *points, int point_count)
-{
-   CRI("Not implemented yet");
-   return EINA_FALSE;
-}
-
 Eina_Bool
 evas_filter_interpolate(DATA8 *output, DATA8 *points, int point_count,
                         Evas_Filter_Interpolation_Mode mode)
@@ -120,8 +113,6 @@ evas_filter_interpolate(DATA8 *output, DATA8 *points, int point_count,
      {
       case EVAS_FILTER_INTERPOLATION_MODE_NONE:
         return _interpolate_none(output, points, point_count);
-      case EVAS_FILTER_INTERPOLATION_MODE_CUBIC:
-        return _interpolate_cubic(output, points, point_count);
       case EVAS_FILTER_INTERPOLATION_MODE_LINEAR:
       default:
         return _interpolate_linear(output, points, point_count);
index 9de6532..12d62c8 100644 (file)
@@ -23,6 +23,9 @@ typedef void (* Evas_Filter_Cb) (Evas_Filter_Context *ctx, void *data);
 #define EVAS_FILTER_BUFFER_RGBA  EINA_FALSE
 #define EVAS_FILTER_BUFFER_ALPHA EINA_TRUE
 
+#define EVAS_FILTER_BUFFER_INPUT_ID  1
+#define EVAS_FILTER_BUFFER_OUTPUT_ID 2
+
 enum _Evas_Filter_Mode
 {
    EVAS_FILTER_MODE_BLEND,        /**< Blend with current context render_op */