eng_outbuf_egl_display_get,
eng_gl_context_new,
eng_gl_context_use,
- NULL,//eng_outbuf_context_is_current_set
&evgl_funcs,
epd->output.w, epd->output.h))
{
typedef void *(*Window_EGL_Display_Get)(Outbuf *ob);
typedef Context_3D *(*Window_GL_Context_New)(Outbuf *ob);
typedef void (*Window_GL_Context_Use)(Context_3D *ctx);
-typedef void (*Window_Context_Is_Current_Set)(Outbuf *ob, Eina_Bool context_current);
struct _Render_Engine_GL_Generic
{
Window_EGL_Display_Get window_egl_display_get;
Window_GL_Context_New window_gl_context_new;
Window_GL_Context_Use window_gl_context_use;
- Window_Context_Is_Current_Set window_context_is_current_set;
struct {
Evas_Object_Image_Pixels_Get_Cb get_pixels;
Window_EGL_Display_Get window_egl_display_get,
Window_GL_Context_New window_gl_context_new,
Window_GL_Context_Use window_gl_context_use,
- Window_Context_Is_Current_Set window_context_is_current_set,
const EVGL_Interface *evgl_funcs,
int w, int h)
{
re->window_egl_display_get = window_egl_display_get;
re->window_gl_context_new = window_gl_context_new;
re->window_gl_context_use = window_gl_context_use;
- re->window_context_is_current_set = window_context_is_current_set;
re->func.get_pixels = NULL;
re->func.get_pixels_data = NULL;
evas_gl_preload_target_unregister(gim->tex, (Eo*) target);
}
-static void
-eng_gl_get_pixels_pre(void *data EINA_UNUSED)
-{
- evgl_get_pixels_pre();
-}
-
-static void
-eng_gl_get_pixels_post(void *data)
-{
- Render_Engine_GL_Generic *re = data;
- if (!re) return;
-
- evgl_get_pixels_post();
- if (re->window_context_is_current_set)
- re->window_context_is_current_set(re->software.ob, EINA_FALSE);
-}
-
static Eina_Bool
eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async EINA_UNUSED)
{
direct_surface);
// Call pixel get function
- eng_gl_get_pixels_pre(re);
+ evgl_get_pixels_pre();
re->func.get_pixels(re->func.get_pixels_data, re->func.obj);
- eng_gl_get_pixels_post(re);
+ evgl_get_pixels_post();
// Call end tile if it's being used
if ((gl_context->master_clip.enabled) &&
re->func.obj = (Evas_Object*)obj;
}
+static void
+eng_gl_get_pixels_pre(void *data EINA_UNUSED)
+{
+ evgl_get_pixels_pre();
+}
+
+static void
+eng_gl_get_pixels_post(void *data EINA_UNUSED)
+{
+ evgl_get_pixels_post();
+}
+
static Eina_Bool
eng_gl_surface_lock(void *data, void *surface)
{
_window_egl_display_get,
_window_gl_context_new,
_window_gl_context_use,
- NULL,//eng_outbuf_context_is_current_set
&evgl_funcs,
e->output.w, e->output.h))
goto on_error;
eng_outbuf_egl_display_get,
eng_gl_context_new,
eng_gl_context_use,
- eng_outbuf_context_is_current_set,
&evgl_funcs,
e->output.w, e->output.h))
{
struct {
unsigned char drew : 1;
} draw;
-
- Eina_Bool context_switch_optimize : 1;
- Eina_Bool context_current : 1;
};
struct _Context_3D
void eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode);
Evas_Engine_GL_Context *eng_outbuf_gl_context_get(Outbuf *ob);
void *eng_outbuf_egl_display_get(Outbuf *ob);
-void eng_outbuf_context_is_current_set(Outbuf *ob, Eina_Bool context_current);
Eina_Bool eng_preload_make_current(void *data, void *doit);
#endif
const GLubyte *vendor, *renderer, *version, *glslversion;
int blacklist = 0;
- int val = 0, context_optimize_disable = 0;
- char* s;
+ int val = 0;
if (!fbconf) eng_best_visual_get(info);
if (!_evas_gl_x11_vi) return NULL;
gw->depth_bits = depth_bits;
gw->stencil_bits = stencil_bits;
gw->msaa_bits = msaa_bits;
- gw->context_current = EINA_FALSE;
-
- if ((s = getenv("EVAS_GL_CONTEXT_SWITCH_OPTIMIZE_DISABLE")) != NULL)
- context_optimize_disable = atoi(s);
-
- if (context_optimize_disable == 1)
- gw->context_switch_optimize = EINA_FALSE;
- else
- gw->context_switch_optimize = EINA_TRUE;
if (gw->alpha && _evas_gl_x11_rgba_vi)
gw->visualinfo = _evas_gl_x11_rgba_vi;
xwin = _tls_outbuf_get();
- if (xwin && (xwin == gw))
- if (gw->context_switch_optimize && gw->context_current)
- return;
-
glsym_evas_gl_preload_render_lock(eng_window_make_current, gw);
#ifdef GL_GLES
if (xwin)
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->win, (void *)gw->context);
}
#endif
- if (xwin) xwin->context_current = EINA_FALSE;
- gw->context_current = EINA_TRUE;
}
}
if (gw) glsym_evas_gl_common_context_use(gw->gl_context);
return NULL;
#endif
}
-
-void
-eng_outbuf_context_is_current_set(Outbuf *ob, Eina_Bool context_current)
-{
- if (!ob) return;
-
- ob->context_current = context_current;
- return;
-}
eng_outbuf_egl_display_get,
eng_gl_context_new,
eng_gl_context_use,
- NULL, //eng_outbuf_context_is_current_set
&evgl_funcs,
epd->output.w, epd->output.h))
{