summaryrefslogtreecommitdiff
path: root/src/lib/evas/include
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-22 16:55:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-14 11:26:44 +0900
commit1bf24f87626b438598936ad4f780f7877447f496 (patch)
treee6111138de96a1479054e1ab8649c00096273378 /src/lib/evas/include
parent7407a0d073a57e66f6ab68069780026b56bf7b39 (diff)
evas filters: Refactor to support reuse of buffers
This will reuse existing buffers by resetting only the minimum required in the filter context (also reused). Work in progress, as the actual reuse is disabled for now.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/include/evas_filter.h10
-rw-r--r--src/lib/evas/include/evas_private.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index c6854fd3c4..edb12cdcde 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -32,7 +32,6 @@
32# endif 32# endif
33#endif /* ! _WIN32 */ 33#endif /* ! _WIN32 */
34 34
35typedef struct _Evas_Filter_Context Evas_Filter_Context;
36typedef struct _Evas_Filter_Instruction Evas_Filter_Instruction; 35typedef struct _Evas_Filter_Instruction Evas_Filter_Instruction;
37typedef struct _Evas_Filter_Buffer Evas_Filter_Buffer; 36typedef struct _Evas_Filter_Buffer Evas_Filter_Buffer;
38typedef struct _Evas_Filter_Proxy_Binding Evas_Filter_Proxy_Binding; 37typedef struct _Evas_Filter_Proxy_Binding Evas_Filter_Proxy_Binding;
@@ -146,19 +145,22 @@ void evas_filter_program_data_set_all(Evas_Filter_Program *p
146Evas_Filter_Context *evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool async, void *user_data); 145Evas_Filter_Context *evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool async, void *user_data);
147void *evas_filter_context_data_get(Evas_Filter_Context *ctx); 146void *evas_filter_context_data_get(Evas_Filter_Context *ctx);
148Eina_Bool evas_filter_context_async_get(Evas_Filter_Context *ctx); 147Eina_Bool evas_filter_context_async_get(Evas_Filter_Context *ctx);
148void evas_filter_context_size_get(Evas_Filter_Context *ctx, int *w, int *H);
149void evas_filter_context_destroy(Evas_Filter_Context *ctx); 149void evas_filter_context_destroy(Evas_Filter_Context *ctx);
150Eina_Bool evas_filter_context_program_use(Evas_Filter_Context *ctx, Evas_Filter_Program *pgm); 150Eina_Bool evas_filter_context_program_use(Evas_Filter_Context *ctx, Evas_Filter_Program *pgm, Eina_Bool reuse);
151Eina_Bool evas_filter_context_program_reuse(Evas_Filter_Context *ctx, Evas_Filter_Program *pgm);
151void evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj, Eina_Bool do_async); 152void evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj, Eina_Bool do_async);
152void evas_filter_context_post_run_callback_set(Evas_Filter_Context *ctx, Evas_Filter_Cb cb, void *data); 153void evas_filter_context_post_run_callback_set(Evas_Filter_Context *ctx, Evas_Filter_Cb cb, void *data);
153#define evas_filter_context_autodestroy(ctx) evas_filter_context_post_run_callback_set(ctx, ((Evas_Filter_Cb) evas_filter_context_destroy), ctx) 154#define evas_filter_context_autodestroy(ctx) evas_filter_context_post_run_callback_set(ctx, ((Evas_Filter_Cb) evas_filter_context_destroy), ctx)
154Eina_Bool evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx); 155Eina_Bool evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx);
155void evas_filter_context_obscured_region_set(Evas_Filter_Context *ctx, Eina_Rectangle rect); 156void evas_filter_context_obscured_region_set(Evas_Filter_Context *ctx, Eina_Rectangle rect);
156 157
157int evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only); 158int evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, int w, int h, Eina_Bool alpha_only);
159int evas_filter_buffer_proxy_new(Evas_Filter_Context *ctx, Evas_Filter_Proxy_Binding *pb, int *w, int *h);
158void *evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, int bufid, Eina_Bool render); 160void *evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, int bufid, Eina_Bool render);
159Eina_Bool evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer); 161Eina_Bool evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer);
160 162
161Eina_Bool evas_filter_run(Evas_Filter_Context *ctx); 163Eina_Bool evas_filter_context_run(Evas_Filter_Context *ctx);
162 164
163Eina_Bool evas_filter_font_draw(Evas_Filter_Context *ctx, void *draw_context, int bufid, Evas_Font_Set *font, int x, int y, Evas_Text_Props *text_props, Eina_Bool do_async); 165Eina_Bool evas_filter_font_draw(Evas_Filter_Context *ctx, void *draw_context, int bufid, Evas_Font_Set *font, int x, int y, Evas_Text_Props *text_props, Eina_Bool do_async);
164Eina_Bool evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context, void *surface, int x, int y); 166Eina_Bool evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context, void *surface, int x, int y);
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index cd5683817b..6a0c77686c 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -93,6 +93,7 @@ typedef struct _Evas_Object_Protected_Data Evas_Object_Protected_Data;
93 93
94/* gfx filters typedef only */ 94/* gfx filters typedef only */
95typedef struct _Evas_Filter_Program Evas_Filter_Program; 95typedef struct _Evas_Filter_Program Evas_Filter_Program;
96typedef struct _Evas_Filter_Context Evas_Filter_Context;
96typedef struct _Evas_Object_Filter_Data Evas_Object_Filter_Data; 97typedef struct _Evas_Object_Filter_Data Evas_Object_Filter_Data;
97typedef struct _Evas_Filter_Data_Binding Evas_Filter_Data_Binding; 98typedef struct _Evas_Filter_Data_Binding Evas_Filter_Data_Binding;
98typedef struct _Evas_Pointer_Data Evas_Pointer_Data; 99typedef struct _Evas_Pointer_Data Evas_Pointer_Data;
@@ -1288,6 +1289,7 @@ struct _Evas_Object_Filter_Data
1288 Eina_Stringshare *name; 1289 Eina_Stringshare *name;
1289 Eina_Stringshare *code; 1290 Eina_Stringshare *code;
1290 Evas_Filter_Program *chain; 1291 Evas_Filter_Program *chain;
1292 Evas_Filter_Context *context;
1291 Eina_Hash *sources; // Evas_Filter_Proxy_Binding 1293 Eina_Hash *sources; // Evas_Filter_Proxy_Binding
1292 Eina_Inlist *data; // Evas_Filter_Data_Binding 1294 Eina_Inlist *data; // Evas_Filter_Data_Binding
1293 Eina_Rectangle prev_obscured, obscured; 1295 Eina_Rectangle prev_obscured, obscured;
@@ -1306,6 +1308,7 @@ struct _Evas_Object_Filter_Data
1306 Eina_Bool changed : 1; 1308 Eina_Bool changed : 1;
1307 Eina_Bool invalid : 1; // Code parse failed 1309 Eina_Bool invalid : 1; // Code parse failed
1308 Eina_Bool async : 1; 1310 Eina_Bool async : 1;
1311 Eina_Bool reuse : 1;
1309}; 1312};
1310 1313
1311struct _Evas_Object_Func 1314struct _Evas_Object_Func