summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_engine.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-01-05 16:55:59 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-01-05 17:08:22 +0900
commit3593186a60e5530871a252a4bd6b03d881a0ead4 (patch)
tree188e336cdefd0b58262dc74332d0b46f83d88a16 /src/modules/evas/engines/wayland_shm/evas_engine.c
parentd7903e40b326de5323276cdf2869a608cd0c5a33 (diff)
wayland: Add support for TBM buffers
This is a follow up on the previous commits. The original patch on Phab was split in 3 parts (factorization, fix & this one). Adds support to both SHM and EGL. See D3501.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c91
1 files changed, 0 insertions, 91 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index e6a810c130..82500908b3 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -5,11 +5,6 @@
5#endif 5#endif
6 6
7#include "evas_engine.h" 7#include "evas_engine.h"
8#include "../software_generic/evas_native_common.h"
9
10#ifdef HAVE_DLSYM
11# include <dlfcn.h>
12#endif
13 8
14/* logging domain variable */ 9/* logging domain variable */
15int _evas_engine_way_shm_log_dom = -1; 10int _evas_engine_way_shm_log_dom = -1;
@@ -17,8 +12,6 @@ int _evas_engine_way_shm_log_dom = -1;
17/* evas function tables - filled in later (func and parent func) */ 12/* evas function tables - filled in later (func and parent func) */
18static Evas_Func func, pfunc; 13static Evas_Func func, pfunc;
19 14
20Evas_Native_Tbm_Surface_Image_Set_Call glsym_evas_native_tbm_surface_image_set = NULL;
21
22/* engine structure data */ 15/* engine structure data */
23typedef struct _Render_Engine Render_Engine; 16typedef struct _Render_Engine Render_Engine;
24struct _Render_Engine 17struct _Render_Engine
@@ -84,22 +77,6 @@ err:
84 return NULL; 77 return NULL;
85} 78}
86 79
87static void
88_symbols(void)
89{
90 static int done = 0;
91
92 if (done) return;
93
94#define LINK2GENERIC(sym) \
95 glsym_##sym = dlsym(RTLD_DEFAULT, #sym);
96
97 // Get function pointer to native_common that is now provided through the link of SW_Generic.
98 LINK2GENERIC(evas_native_tbm_surface_image_set);
99
100 done = 1;
101}
102
103/* ENGINE API FUNCTIONS WE PROVIDE */ 80/* ENGINE API FUNCTIONS WE PROVIDE */
104static void * 81static void *
105eng_info(Evas *eo_evas EINA_UNUSED) 82eng_info(Evas *eo_evas EINA_UNUSED)
@@ -265,71 +242,6 @@ eng_output_resize(void *data, int w, int h)
265 re->generic.h = h; 242 re->generic.h = h;
266} 243}
267 244
268static void *
269eng_image_native_set(void *data EINA_UNUSED, void *image, void *native)
270{
271 Evas_Native_Surface *ns = native;
272 Image_Entry *ie = image;
273 RGBA_Image *im = image, *im2;
274
275 if (!im || !ns) return im;
276
277 if (ns->type == EVAS_NATIVE_SURFACE_TBM)
278 {
279 if (im->native.data)
280 {
281 //image have native surface already
282 Evas_Native_Surface *ens = im->native.data;
283
284 if ((ens->type == ns->type) &&
285 (ens->data.tbm.buffer == ns->data.tbm.buffer))
286 return im;
287 }
288 }
289
290 if ((ns->type == EVAS_NATIVE_SURFACE_OPENGL) &&
291 (ns->version == EVAS_NATIVE_SURFACE_VERSION))
292 im2 = evas_cache_image_data(evas_common_image_cache_get(),
293 ie->w, ie->h,
294 ns->data.x11.visual, 1,
295 EVAS_COLORSPACE_ARGB8888);
296 else
297 im2 = evas_cache_image_data(evas_common_image_cache_get(),
298 ie->w, ie->h,
299 NULL, 1,
300 EVAS_COLORSPACE_ARGB8888);
301
302 if (im->native.data)
303 {
304 if (im->native.func.free)
305 im->native.func.free(im->native.func.data, im);
306 }
307
308#ifdef EVAS_CSERVE2
309 if (evas_cserve2_use_get() && evas_cache2_image_cached(ie))
310 evas_cache2_image_close(ie);
311 else
312#endif
313 evas_cache_image_drop(ie);
314 im = im2;
315
316 if (ns->type == EVAS_NATIVE_SURFACE_TBM)
317 return glsym_evas_native_tbm_surface_image_set(NULL, im, ns);
318
319 return im;
320}
321
322static void *
323eng_image_native_get(void *data EINA_UNUSED, void *image)
324{
325 RGBA_Image *im = image;
326 Native *n;
327 if (!im) return NULL;
328 n = im->native.data;
329 if (!n) return NULL;
330 return &(n->ns);
331}
332
333/* EVAS MODULE FUNCTIONS */ 245/* EVAS MODULE FUNCTIONS */
334static int 246static int
335module_open(Evas_Module *em) 247module_open(Evas_Module *em)
@@ -361,10 +273,7 @@ module_open(Evas_Module *em)
361 ORD(setup); 273 ORD(setup);
362 ORD(output_free); 274 ORD(output_free);
363 ORD(output_resize); 275 ORD(output_resize);
364 ORD(image_native_set);
365 ORD(image_native_get);
366 276
367 _symbols();
368 /* advertise our own engine functions */ 277 /* advertise our own engine functions */
369 em->functions = (void *)(&func); 278 em->functions = (void *)(&func);
370 279