Eina_Bool blacklist = EINA_FALSE;
struct wl_display *wl_disp;
+// TIZEN_ONLY(20171123) : bug fixed : using wl_surface
+ struct wl_surface *wl_surface;
+//
/* try to allocate space for our window */
if (!(gw = calloc(1, sizeof(Outbuf))))
return NULL;
return NULL;
}
+ // TIZEN_ONLY(20171123) : bug fixed : using wl_surface
+ wl_surface = ecore_wl2_window_surface_get(gw->wl2_win);
+ /* TIZEN_ONLY(20171123) : temporary patch */
+ if (gw->w < 1) gw->w = 1;
+ if (gw->h < 1) gw->h = 1;
+
+ if ((gw->rot == 0) || (gw->rot == 180))
+ gw->win = wl_egl_window_create(wl_surface, gw->w, gw->h);
+ else if ((gw->rot == 90) || (gw->rot == 270))
+ gw->win = wl_egl_window_create(wl_surface, gw->h, gw->w);
+
+ if (gw->win == NULL)
+ {
+ ERR("wl_egl_window_create() fail");
+ eng_window_free(gw);
+ return NULL;
+ }
+
+ gw->egl_surface =
+ eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
+ (EGLNativeWindowType)gw->win, NULL);
+ if (gw->egl_surface == EGL_NO_SURFACE)
+ {
+ ERR("eglCreateWindowSurface() fail for %p. code=%#x",
+ gw->win, eglGetError());
+ eng_window_free(gw);
+ return NULL;
+ }
+ // TIZEN_ONLY(20171123)
+
context = _tls_context_get();
gw->egl_context =
GL_TH(eglCreateContext, gw->egl_disp, gw->egl_config, context, context_attrs);
if (context == EGL_NO_CONTEXT)
_tls_context_set(gw->egl_context);
- if (GL_TH(eglMakeCurrent, gw->egl_disp, EGL_NO_SURFACE,
- EGL_NO_SURFACE, gw->egl_context) == EGL_FALSE)
+ SET_RESTORE_CONTEXT();
+ if (GL_TH(eglMakeCurrent, gw->egl_disp, gw->egl_surface,
+ gw->egl_surface, gw->egl_context) == EGL_FALSE)
{
ERR("eglMakeCurrent() fail. code=%#x", GL_TH(eglGetError));
eng_window_free(gw);
gw->gl_context->eglctxt = gw->egl_context;
eng_window_use(gw);
}
- if (w && h)
- eng_window_resurf(gw);
+//* TIZEN_ONLY(20171123) : temporary patch */
+// if (w && h)
+// eng_window_resurf(gw);
return gw;
}
glsym_evas_gl_common_context_free(gw->gl_context);
}
- GL_TH(eglMakeCurrent, gw->egl_disp, EGL_NO_SURFACE,
+ SET_RESTORE_CONTEXT();
+ GL_TH(eglMakeCurrent, gw->egl_disp, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (gw->egl_context != context)
{
if (gw->egl_surface != EGL_NO_SURFACE)
{
+ SET_RESTORE_CONTEXT();
if (GL_TH(eglMakeCurrent, gw->egl_disp, gw->egl_surface,
gw->egl_surface,
gw->egl_context) == EGL_FALSE)
if (wl_win == gw)
{
+ SET_RESTORE_CONTEXT();
GL_TH(eglMakeCurrent, gw->egl_disp, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (gw->egl_surface != EGL_NO_SURFACE)
gw->win = wl_egl_window_create(wls, gw->w, gw->h);
else if ((gw->rot == 90) || (gw->rot == 270))
gw->win = wl_egl_window_create(wls, gw->h, gw->w);
+// TIZEN_ONLY(20171123) : temporary patch */
+ if (gw->win == NULL)
+ {
+ ERR("wl_egl_window_create() fail");
+ return;
+ }
+//
}
gw->egl_surface =
return;
}
+ SET_RESTORE_CONTEXT();
if (GL_TH(eglMakeCurrent, gw->egl_disp, gw->egl_surface,
gw->egl_surface, gw->egl_context) == EGL_FALSE)
{
void
eng_gl_context_use(Context_3D *ctx)
{
- if (GL_TH(eglMakeCurrent, ctx->display, ctx->surface,
+ SET_RESTORE_CONTEXT();
+ if (GL_TH(eglMakeCurrent, ctx->display, ctx->surface,
ctx->surface, ctx->context) == EGL_FALSE)
{
ERR("eglMakeCurrent Failed: %#x", GL_TH(eglGetError));