summaryrefslogtreecommitdiff
path: root/src/lib/evas/include/evas_filter.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-01-18 11:47:25 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-14 11:26:43 +0900
commit2ef8d6f39af839c23551239216cea100254f80df (patch)
tree415581d3cb5245012225777926638827051bc3c2 /src/lib/evas/include/evas_filter.h
parentfb52c15e8513cc1458341da13e570d231a886551 (diff)
evas filters: Refactor ector and gfx filters A LOT
Alright, so this is a massive patch that is the result of trying to get rid of unused or poorly implemented classes in ector. Originally ector was meant to support VG but extend to things like filters as well. At the moment, ector's design makes it quite hard to plug in the filters. For now I think it's easier to implement the GL support for the filters directly in the engine, where I hope to interfere as little as possible. This massive patch keeps only the required minimum to support a versatile gl buffer that can be mapped, drawn or rendered to (FBO). It's extremely inefficient as it relies on glReadPixels and lots of texture uploads, as well as conversions between ARGB and Alpha. Another type of GL buffer is a wrap around an existing GL image, but that one is read-only (map or draw: no write map, no FBO). No, all the filters run fine, and the high-level implementation (evas_filters.c) does not need to know whether the underlying engine is SW or GL. One problem though appears with the blending or blurring of some Alpha buffers, the colors are wrong. This patch removes more lines than it adds so it must be good ;)
Diffstat (limited to '')
-rw-r--r--src/lib/evas/include/evas_filter.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index cfea9bd197..0736b5b542 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -146,7 +146,6 @@ void evas_filter_context_post_run_callback_set(Evas_Filter_C
146Eina_Bool evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx); 146Eina_Bool evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx);
147 147
148int evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only); 148int evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only);
149void *evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, int bufid);
150void *evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid); 149void *evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid);
151Eina_Bool evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer); 150Eina_Bool evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer);
152 151
@@ -171,7 +170,7 @@ void _evas_filter_source_hash_free_cb(void *data);
171 * @return Filter command ID or -1 in case of error 170 * @return Filter command ID or -1 in case of error
172 * @internal 171 * @internal
173 */ 172 */
174int evas_filter_command_blend_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, int ox, int oy, Evas_Filter_Fill_Mode fillmode); 173Evas_Filter_Command *evas_filter_command_blend_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, int ox, int oy, Evas_Filter_Fill_Mode fillmode);
175 174
176/** 175/**
177 * @brief Apply a blur effect on a buffer 176 * @brief Apply a blur effect on a buffer
@@ -188,7 +187,7 @@ int evas_filter_command_blend_add(Evas_Filter_Context *ctx,
188 * @return Filter command ID or -1 in case of error 187 * @return Filter command ID or -1 in case of error
189 * @internal 188 * @internal
190 */ 189 */
191int evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, Evas_Filter_Blur_Type type, int dx, int dy, int ox, int oy, int count); 190Evas_Filter_Command *evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, Evas_Filter_Blur_Type type, int dx, int dy, int ox, int oy, int count);
192 191
193/** 192/**
194 * @brief Fill a buffer with the current color 193 * @brief Fill a buffer with the current color
@@ -199,7 +198,7 @@ int evas_filter_command_blur_add(Evas_Filter_Context *ctx,
199 * @note The current draw context's render operation is ignored (always uses COPY mode). 198 * @note The current draw context's render operation is ignored (always uses COPY mode).
200 * @internal 199 * @internal
201 */ 200 */
202int evas_filter_command_fill_add(Evas_Filter_Context *ctx, void *draw_context, int buf); 201Evas_Filter_Command *evas_filter_command_fill_add(Evas_Filter_Context *ctx, void *draw_context, int buf);
203 202
204/** 203/**
205 * @brief evas_filter_command_curve_add 204 * @brief evas_filter_command_curve_add
@@ -212,7 +211,7 @@ int evas_filter_command_fill_add(Evas_Filter_Context *ctx,
212 * @return Filter command ID or -1 in case of error 211 * @return Filter command ID or -1 in case of error
213 * @internal 212 * @internal
214 */ 213 */
215int evas_filter_command_curve_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, DATA8 *curve /* 256 elements */, Evas_Filter_Channel channel); 214Evas_Filter_Command *evas_filter_command_curve_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, DATA8 *curve /* 256 elements */, Evas_Filter_Channel channel);
216 215
217/** 216/**
218 * @brief Grow/Shrink an image, as defined in image processing (this is not a scale algorithm!) 217 * @brief Grow/Shrink an image, as defined in image processing (this is not a scale algorithm!)
@@ -225,7 +224,7 @@ int evas_filter_command_curve_add(Evas_Filter_Context *ctx,
225 * @return Filter command ID or -1 in case of error 224 * @return Filter command ID or -1 in case of error
226 * @internal 225 * @internal
227 */ 226 */
228int evas_filter_command_grow_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, int radius, Eina_Bool smooth); 227Evas_Filter_Command *evas_filter_command_grow_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, int radius, Eina_Bool smooth);
229 228
230/** 229/**
231 * @brief Apply a displacement map to a buffer. This will move pixels from the source to the destination based on pixel per pixel offset, as defined in the displacement map 230 * @brief Apply a displacement map to a buffer. This will move pixels from the source to the destination based on pixel per pixel offset, as defined in the displacement map
@@ -240,7 +239,7 @@ int evas_filter_command_grow_add(Evas_Filter_Context *ctx,
240 * @return Filter command ID or -1 in case of error 239 * @return Filter command ID or -1 in case of error
241 * @internal 240 * @internal
242 */ 241 */
243int evas_filter_command_displacement_map_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, int dispbuf, Evas_Filter_Displacement_Flags flags, int intensity, Evas_Filter_Fill_Mode fillmode); 242Evas_Filter_Command *evas_filter_command_displacement_map_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, int dispbuf, Evas_Filter_Displacement_Flags flags, int intensity, Evas_Filter_Fill_Mode fillmode);
244 243
245/** 244/**
246 * @brief Apply a texture to a buffer 245 * @brief Apply a texture to a buffer
@@ -254,7 +253,7 @@ int evas_filter_command_displacement_map_add(Evas_Filter_Co
254 * @note For the moment, inbuf can only be ALPHA, and output must be RGBA if mask is RGBA as well 253 * @note For the moment, inbuf can only be ALPHA, and output must be RGBA if mask is RGBA as well
255 * @internal 254 * @internal
256 */ 255 */
257int evas_filter_command_mask_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int maskbuf, int outbuf, Evas_Filter_Fill_Mode fillmode); 256Evas_Filter_Command *evas_filter_command_mask_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int maskbuf, int outbuf, Evas_Filter_Fill_Mode fillmode);
258 257
259/** 258/**
260 * @brief Apply a relief effect based on a bump map (Z map) 259 * @brief Apply a relief effect based on a bump map (Z map)
@@ -275,7 +274,7 @@ int evas_filter_command_mask_add(Evas_Filter_Context *ctx,
275 * @return Filter command ID or -1 in case of error 274 * @return Filter command ID or -1 in case of error
276 * @internal 275 * @internal
277 */ 276 */
278int evas_filter_command_bump_map_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int bumpbuf, int outbuf, float azimuth, float elevation, float depth, float specular_factor, DATA32 black, DATA32 color, DATA32 white, Evas_Filter_Bump_Flags flags, Evas_Filter_Fill_Mode fillmode); 277Evas_Filter_Command *evas_filter_command_bump_map_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int bumpbuf, int outbuf, float azimuth, float elevation, float depth, float specular_factor, DATA32 black, DATA32 color, DATA32 white, Evas_Filter_Bump_Flags flags, Evas_Filter_Fill_Mode fillmode);
279 278
280/** 279/**
281 * @brief Apply a geometrical transformation to the buffer 280 * @brief Apply a geometrical transformation to the buffer
@@ -289,7 +288,7 @@ int evas_filter_command_bump_map_add(Evas_Filter_Context *c
289 * @return Filter command ID or -1 in case of error 288 * @return Filter command ID or -1 in case of error
290 * @internal 289 * @internal
291 */ 290 */
292int evas_filter_command_transform_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, Evas_Filter_Transform_Flags flags, int ox, int oy); 291Evas_Filter_Command *evas_filter_command_transform_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, Evas_Filter_Transform_Flags flags, int ox, int oy);
293 292
294/* Simple binding between a filter object and its sources */ 293/* Simple binding between a filter object and its sources */
295struct _Evas_Filter_Proxy_Binding 294struct _Evas_Filter_Proxy_Binding