#include <tizen-extension-server-protocol.h>
#include <wayland-tbm-server.h>
+#include <Evas_GL.h>
/* handle include for printing uint64_t */
#define __STDC_FORMAT_MACROS
Ecore_Device *dev;
} E_Comp_Wl_Key_Data;
+struct _E_Comp_Wl_Evas_Gl
+{
+ Evas_GL *gl;
+ Evas_GL_Config *glcfg;
+ Evas_GL_Context *glctx;
+ Evas_GL_Surface *glsfc;
+ Evas_GL_API *glapi;
+};
+
static Eina_List *handlers = NULL;
static E_Client *cursor_timer_ec = NULL;
static Eina_Bool need_send_released = EINA_FALSE;
Evas_GL_Surface *sfc = NULL;
Evas_GL_Config *cfg = NULL;
Eina_Bool res;
+ E_Comp_Wl_Evas_Gl *evas_gl = NULL;
if (!e_comp_gl_get()) return;
+ evas_gl = E_NEW(E_Comp_Wl_Evas_Gl, 1);
+ EINA_SAFETY_ON_NULL_RETURN(evas_gl);
+
/* create dummy evas gl to bind wayland display of enlightenment to egl display */
e_main_ts_begin("\tE_Comp_Wl_GL Init");
evas_gl_config_free(cfg);
- e_comp_wl->wl.gl = evasgl;
- e_comp_wl->wl.glapi = glapi;
- e_comp_wl->wl.glsfc = sfc;
- e_comp_wl->wl.glctx = ctx;
+ evas_gl->gl = evasgl;
+ evas_gl->glapi = glapi;
+ evas_gl->glsfc = sfc;
+ evas_gl->glctx = ctx;
+
+ e_comp_wl->evas_gl = evas_gl;
/* for native surface */
e_comp->gl = 1;
evas_gl_context_destroy(evasgl, ctx);
evas_gl_surface_destroy(evasgl, sfc);
evas_gl_free(evasgl);
+ free(evas_gl);
}
// FIXME
static void
_e_comp_wl_gl_shutdown(void)
{
- if (!e_comp_wl->wl.gl) return;
+ if (!e_comp_wl->evas_gl) return;
- e_comp_wl->wl.glapi->evasglUnbindWaylandDisplay(e_comp_wl->wl.gl, e_comp_wl->wl.disp);
+ e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(e_comp_wl->evas_gl->gl, e_comp_wl->wl.disp);
- evas_gl_make_current(e_comp_wl->wl.gl, NULL, NULL);
- evas_gl_context_destroy(e_comp_wl->wl.gl, e_comp_wl->wl.glctx);
- evas_gl_surface_destroy(e_comp_wl->wl.gl, e_comp_wl->wl.glsfc);
- evas_gl_free(e_comp_wl->wl.gl);
+ evas_gl_make_current(e_comp_wl->evas_gl->gl, NULL, NULL);
+ evas_gl_context_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glctx);
+ evas_gl_surface_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glsfc);
+ evas_gl_free(e_comp_wl->evas_gl->gl);
- e_comp_wl->wl.glsfc = NULL;
- e_comp_wl->wl.glctx = NULL;
- e_comp_wl->wl.glapi = NULL;
- e_comp_wl->wl.gl = NULL;
+ E_FREE(e_comp_wl->evas_gl);
}
/* public functions */
buffer->w = wl_shm_buffer_get_width(shmbuff);
buffer->h = wl_shm_buffer_get_height(shmbuff);
+ buffer->format = wl_shm_buffer_get_format(shmbuff);
}
else
{
{
buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
buffer->w = buffer->h = 1;
+ buffer->format = 0;
}
else if ((ec) && (e_client_video_hw_composition_check(ec)))
{
buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
buffer->w = tbm_surface_get_width(tbm_surf);
buffer->h = tbm_surface_get_height(tbm_surf);
+ buffer->format = tbm_surface_get_format(tbm_surf);
buffer->tbm_surface = tbm_surf;
}
else if (e_comp->gl)
{
buffer->type = E_COMP_WL_BUFFER_TYPE_NATIVE;
- res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
- resource,
- EVAS_GL_WIDTH,
- &buffer->w);
+ res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+ resource,
+ EVAS_GL_WIDTH,
+ &buffer->w);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
- res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
- resource,
- EVAS_GL_HEIGHT,
- &buffer->h);
+ res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+ resource,
+ EVAS_GL_HEIGHT,
+ &buffer->h);
+ EINA_SAFETY_ON_FALSE_GOTO(res, err);
+
+ res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+ resource,
+ EVAS_GL_TEXTURE_FORMAT,
+ &buffer->format);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
}
else
buffer->type = E_COMP_WL_BUFFER_TYPE_NATIVE;
buffer->w = tbm_surface_get_width(tbm_surf);
buffer->h = tbm_surface_get_height(tbm_surf);
+ buffer->format = tbm_surface_get_format(tbm_surf);
buffer->tbm_surface = tbm_surf;
}
}
buffer->w = wl_shm_buffer_get_width(shmbuff);
buffer->h = wl_shm_buffer_get_height(shmbuff);
+ buffer->format = wl_shm_buffer_get_format(shmbuff);
}
else if (tbm_surf)
{
{
buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
buffer->w = buffer->h = 1;
+ buffer->format = 0;
}
else if ((ec) && (e_client_video_hw_composition_check(ec)))
{
buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
buffer->w = tbm_surface_get_width(tbm_surf);
buffer->h = tbm_surface_get_height(tbm_surf);
+ buffer->format = tbm_surface_get_format(tbm_surf);
}
else
{
buffer->type = E_COMP_WL_BUFFER_TYPE_TBM;
buffer->w = tbm_surface_get_width(tbm_surf);
buffer->h = tbm_surface_get_height(tbm_surf);
+ buffer->format = tbm_surface_get_format(tbm_surf);
}
}
else if (e_comp->gl)
{
buffer->type = E_COMP_WL_BUFFER_TYPE_NATIVE;
- res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
- resource,
- EVAS_GL_WIDTH,
- &buffer->w);
+ res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+ resource,
+ EVAS_GL_WIDTH,
+ &buffer->w);
+ EINA_SAFETY_ON_FALSE_GOTO(res, err);
+
+ res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+ resource,
+ EVAS_GL_HEIGHT,
+ &buffer->h);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
- res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
- resource,
- EVAS_GL_HEIGHT,
- &buffer->h);
+ res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+ resource,
+ EVAS_GL_TEXTURE_FORMAT,
+ &buffer->format);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
}
else