aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-19 15:57:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-20 13:27:42 +0900
commit538d078cf007bd62f6a20ad3f8b0cacc11720e54 (patch)
tree4d0d0c303714f8307928eb07924a5b3f105464cc /src
parentEvas filters: Fix options parsing (diff)
downloadefl-538d078cf007bd62f6a20ad3f8b0cacc11720e54.tar.gz
Evas filters: Fix curve filter with RGBA
The curve filter did not respect premultiplied values in RGBA images. Unfortunately, the fastest solution is to unpremul and re-premul everytime...
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter_curve.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/lib/evas/filters/evas_filter_curve.c b/src/lib/evas/filters/evas_filter_curve.c
index a88dbc8e84..179dbce379 100644
--- a/src/lib/evas/filters/evas_filter_curve.c
+++ b/src/lib/evas/filters/evas_filter_curve.c
@@ -41,12 +41,17 @@ _filter_curve_cpu_rgba(Evas_Filter_Command *cmd)
return EINA_FALSE;
}
+ if (src != dst)
+ memcpy(dst, src, len * sizeof(DATA32));
+ evas_data_argb_unpremul(dst, len);
+
// One channel (R, G or B)
if (offset >= 0)
{
- for (k = len; k; k--, dst++, src++)
- C_VAL(dst) = curve[C_VAL(src)];
- return EINA_TRUE;
+ for (k = len, s = src, d = dst; k; k--, d++, s++)
+ C_VAL(d) = curve[C_VAL(s)];
+
+ goto premul;
}
// All RGB channels
@@ -61,7 +66,8 @@ _filter_curve_cpu_rgba(Evas_Filter_Command *cmd)
for (k = len, s = src, d = dst; k; k--, d++, s++)
C_VAL(d) = curve[C_VAL(s)];
}
- return EINA_TRUE;
+
+ goto premul;
}
// Alpha
@@ -71,13 +77,11 @@ _filter_curve_cpu_rgba(Evas_Filter_Command *cmd)
offset = 0;
#endif
- if (src != dst)
- memcpy(dst, src, len * sizeof(DATA32));
- evas_data_argb_unpremul(dst, len);
for (k = len, d = dst; k; k--, d++, src++)
C_VAL(d) = curve[C_VAL(src)];
- evas_data_argb_premul(dst, len);
+premul:
+ evas_data_argb_premul(dst, len);
return EINA_TRUE;
}