summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 12:09:53 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 12:24:59 +0900
commit0f7dfdedfd7aacc3591d48fd47ba78ecb7b2757e (patch)
treec3144e67254db1e2af14e4a6acf4d91a84f9d2c7 /src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
parent258cfbbe8013b50a7d3f89ab863dab73fcedcdb7 (diff)
evas: Fix async filters following changes in EO
EO is now extremely restrictive wrt. threads so that efl_data_scope_get() can't work outside the main loop. This patch fixes the usage to create sw buffers as shared objects (accessible from both the main loop and evas async thread) and use plain old pointers where possible. The buffers now have no parent because efl_add(CLASS, obj_from_mainloop) does not work with shared objects. This is bad, as the buffers conceptually belong to the main loop, and only need to be accessible from the draw thread for a few calls. The main loop determines their lifecycle. Fixes T4628
Diffstat (limited to 'src/modules/evas/engines/software_generic/evas_ector_software_buffer.c')
-rw-r--r--src/modules/evas/engines/software_generic/evas_ector_software_buffer.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c b/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
index a6dc80e0d4..061d5fbd89 100644
--- a/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
+++ b/src/modules/evas/engines/software_generic/evas_ector_software_buffer.c
@@ -13,7 +13,7 @@
13 13
14typedef struct { 14typedef struct {
15 Ector_Software_Buffer_Base_Data *base; 15 Ector_Software_Buffer_Base_Data *base;
16 Evas *evas; 16 Evas_Public_Data *evas;
17 RGBA_Image *image; 17 RGBA_Image *image;
18} Evas_Ector_Software_Buffer_Data; 18} Evas_Ector_Software_Buffer_Data;
19 19
@@ -39,7 +39,7 @@ _evas_ector_software_buffer_evas_ector_buffer_engine_image_set(Eo *obj, Evas_Ect
39 return; 39 return;
40 } 40 }
41 41
42 pd->evas = efl_xref(evas, obj); 42 pd->evas = efl_data_xref(evas, EVAS_CANVAS_CLASS, obj);
43 evas_cache_image_ref(&im->cache_entry); 43 evas_cache_image_ref(&im->cache_entry);
44 pd->image = im; 44 pd->image = im;
45 45
@@ -51,10 +51,15 @@ _evas_ector_software_buffer_evas_ector_buffer_engine_image_get(Eo *obj EINA_UNUS
51 Evas_Ector_Software_Buffer_Data *pd, 51 Evas_Ector_Software_Buffer_Data *pd,
52 Evas **evas, void **image) 52 Evas **evas, void **image)
53{ 53{
54 Evas_Public_Data *e = efl_data_scope_get(pd->evas, EVAS_CANVAS_CLASS); 54 if (!pd->evas)
55 55 {
56 if (evas) *evas = pd->evas; 56 INF("evas_ector_buffer_engine_image_set was not called on this image");
57 if (e->engine.func->gl_surface_read_pixels) 57 if (evas) *evas = NULL;
58 if (image) *image = NULL;
59 return;
60 }
61 if (evas) *evas = pd->evas->evas;
62 if (pd->evas->engine.func->gl_surface_read_pixels)
58 { 63 {
59 ERR("Invalid: requesting engine_image from a GL image from a simple SW buffer!"); 64 ERR("Invalid: requesting engine_image from a GL image from a simple SW buffer!");
60 if (image) *image = NULL; 65 if (image) *image = NULL;
@@ -86,7 +91,8 @@ _evas_ector_software_buffer_efl_object_destructor(Eo *obj, Evas_Ector_Software_B
86{ 91{
87 efl_data_xunref(obj, pd->base, obj); 92 efl_data_xunref(obj, pd->base, obj);
88 evas_cache_image_drop(&pd->image->cache_entry); 93 evas_cache_image_drop(&pd->image->cache_entry);
89 efl_xunref(pd->evas, obj); 94 if (pd->evas)
95 efl_data_xunref(pd->evas->evas, pd->evas, obj);
90 efl_destructor(efl_super(obj, MY_CLASS)); 96 efl_destructor(efl_super(obj, MY_CLASS));
91} 97}
92 98