Evas GL: Fix sigsegv with recent Nvidia EGL driver

Welp, glGetString() crashes if called before eglInit... And this
piece of code is now useless because "safe native" mode is not
used anymore (safe_native is never read).

Remove all safe native-related code.
This commit is contained in:
Jean-Philippe Andre 2014-09-22 16:23:52 +09:00
parent f30f55f9f4
commit 38aa72d139
3 changed files with 0 additions and 50 deletions

View File

@ -22,8 +22,6 @@
#define EVAS_GL_UPDATE_TILE_SIZE 16
static int safe_native = -1;
typedef struct _Render_Engine Render_Engine;
struct _Render_Engine
@ -1073,23 +1071,6 @@ eng_setup(Evas *eo_e, void *in)
}
}
if (safe_native == -1)
{
s = getenv("EVAS_GL_SAFE_NATIVE");
safe_native = 0;
if (s) safe_native = atoi(s);
else
{
s = (const char *)glGetString(GL_RENDERER);
if (s)
{
if (strstr(s, "PowerVR SGX 540") ||
strstr(s, "Mali-400 MP"))
safe_native = 1;
}
}
}
// Set this env var to dump files every frame
// Or set the global var in gdb to 1|0 to turn it on and off
if (getenv("EVAS_GL_SWAP_BUFFER_DEBUG_ALWAYS"))

View File

@ -1174,19 +1174,6 @@ eng_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update EINA_UNUSED,
if (!_re_wincheck(ob)) return;
ob->draw.drew = 1;
glsym_evas_gl_common_context_flush(ob->gl_context);
#ifdef GL_GLES
// this is needed to make sure all previous rendering is flushed to
// buffers/surfaces
// previous rendering should be done and swapped
//xx if (!safe_native) eglWaitNative(EGL_CORE_NATIVE_ENGINE);
// if (eglGetError() != EGL_SUCCESS)
// {
// printf("Error: eglWaitNative(EGL_CORE_NATIVE_ENGINE) fail.\n");
// }
#else
// previous rendering should be done and swapped
//xx if (!safe_native) glXWaitX();
#endif
}
void

View File

@ -76,7 +76,6 @@ void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
/* local variables */
static int safe_native = -1;
static Eina_Bool initted = EINA_FALSE;
static int gl_wins = 0;
static Evas_Func func, pfunc;
@ -565,23 +564,6 @@ eng_setup(Evas *evas, void *info)
}
}
if (safe_native == -1)
{
s = getenv("EVAS_GL_SAFE_NATIVE");
safe_native = 0;
if (s) safe_native = atoi(s);
else
{
s = (const char *)glGetString(GL_RENDERER);
if (s)
{
if (strstr(s, "PowerVR SGX 540") ||
strstr(s, "Mali-400 MP"))
safe_native = 1;
}
}
}
if (!(re = epd->engine.data.output))
{
Render_Engine_Merge_Mode merge = MERGE_BOUNDING;