sorry sungwoo - going to have to back this dlopen/dlsym styuff out.

intel drivers don;'t like it for some odd reason - i'm trying to track
it down but i can't sanely try middlegrounds right now (eg dont
dlopen/dlsym but actually directly assign symbols etc.), so back out
and let's figure this out before it goes back in :(



SVN revision: 66308
This commit is contained in:
Carsten Haitzler 2011-12-18 05:03:24 +00:00
parent ac49da31df
commit dbc5afdee2
11 changed files with 1373 additions and 8016 deletions

View File

@ -14,8 +14,6 @@ if BUILD_ENGINE_GL_COMMON
noinst_LTLIBRARIES = libevas_engine_gl_common.la
libevas_engine_gl_common_la_SOURCES = \
evas_gl_core.h \
evas_gl_core.c \
evas_gl_private.h \
evas_gl_common.h \
evas_gl_context.c \

View File

@ -12,7 +12,6 @@
#include <sys/time.h>
#include <unistd.h>
#include <Eet.h>
#include "evas_gl_core.h"
#define GL_GLEXT_PROTOTYPES
@ -29,14 +28,14 @@
# else
# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
# if defined(GLES_VARIETY_S3C6410)
//# include <GLES2/gl2.h>
# include <GLES2/gl2.h>
# elif defined(GLES_VARIETY_SGX)
//# include <GLES2/gl2.h>
//# include <GLES2/gl2ext.h>
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
# endif
# else
//# include <GL/gl.h>
//# include <GL/glext.h>
# include <GL/gl.h>
# include <GL/glext.h>
# endif
# endif
#endif
@ -625,12 +624,29 @@ Filtered_Image *evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_
void evas_gl_common_image_filtered_free(Evas_GL_Image *im, Filtered_Image *);
#endif
extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);
extern void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e);
extern void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b);
extern void (*glsym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei *c, GLenum *d, void *e);
extern void (*glsym_glProgramBinary) (GLuint a, GLenum b, const void *c, GLint d);
extern void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d);
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
extern void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e);
extern unsigned int (*secsym_eglDestroyImage) (void *a, void *b);
extern void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b);
extern void *(*secsym_eglMapImageSEC) (void *a, void *b);
extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b);
extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d);
#endif
//#define GL_ERRORS 1
#ifdef GL_ERRORS
# define GLERR(fn, fl, ln, op) \
{ \
int __gl_err = glsym_glGetError(); \
int __gl_err = glGetError(); \
if (__gl_err != GL_NO_ERROR) glerr(__gl_err, fl, fn, ln, op); \
}
#else

View File

@ -9,10 +9,145 @@
#define PRG_INVALID 0xffffffff
#define GLPIPES 1
static int sym_done = 0;
int _evas_engine_GL_common_log_dom = -1;
typedef void (*glsym_func_void) ();
void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b) = NULL;
void (*glsym_glBindFramebuffer) (GLenum a, GLuint b) = NULL;
void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e) = NULL;
void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b) = NULL;
void (*glsym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei *c, GLenum *d, void *e) = NULL;
void (*glsym_glProgramBinary) (GLuint a, GLenum b, const void *c, GLint d) = NULL;
void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d) = NULL;
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
// just used for finding symbols :)
typedef void (*_eng_fn) (void);
typedef _eng_fn (*secsym_func_eng_fn) ();
typedef unsigned int (*secsym_func_uint) ();
typedef void *(*secsym_func_void_ptr) ();
static _eng_fn (*secsym_eglGetProcAddress) (const char *a) = NULL;
void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e) = NULL;
unsigned int (*secsym_eglDestroyImage) (void *a, void *b) = NULL;
void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
void *(*secsym_eglMapImageSEC) (void *a, void *b) = NULL;
unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b) = NULL;
unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d) = NULL;
#endif
static int dbgflushnum = -1;
static void
sym_missing(void)
{
ERR("GL symbols missing!");
}
static void
gl_symbols(void)
{
if (sym_done) return;
sym_done = 1;
/* FIXME: If using the SDL engine, we should use SDL_GL_GetProcAddress
* instead of dlsym
* if (!dst) dst = (typ)SDL_GL_GetProcAddress(sym)
*/
#define FINDSYM(dst, sym, typ) if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
#define FALLBAK(dst, typ) if (!dst) dst = (typ)sym_missing;
FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void);
FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffersEXT", glsym_func_void);
FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffersARB", glsym_func_void);
FALLBAK(glsym_glGenFramebuffers, glsym_func_void);
FINDSYM(glsym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void);
FINDSYM(glsym_glBindFramebuffer, "glBindFramebufferEXT", glsym_func_void);
FINDSYM(glsym_glBindFramebuffer, "glBindFramebufferARB", glsym_func_void);
FALLBAK(glsym_glBindFramebuffer, glsym_func_void);
FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2D", glsym_func_void);
FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2DEXT", glsym_func_void);
FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2DARB", glsym_func_void);
FALLBAK(glsym_glFramebufferTexture2D, glsym_func_void);
FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffers", glsym_func_void);
FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffersEXT", glsym_func_void);
FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffersARB", glsym_func_void);
FALLBAK(glsym_glDeleteFramebuffers, glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinary", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryEXT", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryARB", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryOES", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinary", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinaryEXT", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinaryARB", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteri", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteriEXT", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteriARB", glsym_func_void);
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
#undef FINDSYM
#define FINDSYM(dst, sym, typ) \
if ((!dst) && (secsym_eglGetProcAddress)) dst = (typ)secsym_eglGetProcAddress(sym); \
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
// yes - gl core looking for egl stuff. i know it's odd. a reverse-layer thing
// but it will work as the egl/glx layer calls gl core common stuff and thus
// these symbols will work. making the glx/egl + x11 layer do this kind-of is
// wrong as this is not x11 (output) layer specific like the native surface
// stuff. this is generic zero-copy textures for gl
FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddress", secsym_func_eng_fn);
FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddressEXT", secsym_func_eng_fn);
FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddressARB", secsym_func_eng_fn);
FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddressKHR", secsym_func_eng_fn);
FINDSYM(secsym_eglCreateImage, "eglCreateImage", secsym_func_void_ptr);
FINDSYM(secsym_eglCreateImage, "eglCreateImageEXT", secsym_func_void_ptr);
FINDSYM(secsym_eglCreateImage, "eglCreateImageARB", secsym_func_void_ptr);
FINDSYM(secsym_eglCreateImage, "eglCreateImageKHR", secsym_func_void_ptr);
FINDSYM(secsym_eglDestroyImage, "eglDestroyImage", secsym_func_uint);
FINDSYM(secsym_eglDestroyImage, "eglDestroyImageEXT", secsym_func_uint);
FINDSYM(secsym_eglDestroyImage, "eglDestroyImageARB", secsym_func_uint);
FINDSYM(secsym_eglDestroyImage, "eglDestroyImageKHR", secsym_func_uint);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinary", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryEXT", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryARB", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryOES", glsym_func_void);
FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryKHR", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinary", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinaryEXT", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinaryARB", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinaryOES", glsym_func_void);
FINDSYM(glsym_glProgramBinary, "glProgramBinaryKHR", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteri", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteriEXT", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteriARB", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteriOES", glsym_func_void);
FINDSYM(glsym_glProgramParameteri, "glProgramParameteriKHR", glsym_func_void);
FINDSYM(secsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", glsym_func_void);
FINDSYM(secsym_eglMapImageSEC, "eglMapImageSEC", secsym_func_void_ptr);
FINDSYM(secsym_eglUnmapImageSEC, "eglUnmapImageSEC", secsym_func_uint);
FINDSYM(secsym_eglGetImageAttribSEC, "eglGetImageAttribSEC", secsym_func_uint);
#endif
}
static void shader_array_flush(Evas_Engine_GL_Context *gc);
static Evas_Engine_GL_Context *_evas_gl_common_context = NULL;
@ -114,11 +249,11 @@ _evas_gl_common_version_check()
int minor;
/*
* glsym_glGetString returns a string describing the current GL connection.
* glGetString returns a string describing the current GL connection.
* GL_VERSION is used to get the version of the connection
*/
version = (char *)glsym_glGetString(GL_VERSION);
version = (char *)glGetString(GL_VERSION);
/*
* OpengL ES
@ -165,7 +300,7 @@ _evas_gl_common_version_check()
* version number and the vendor-specific information.
*/
/* glsym_glGetString() returns a static string, and we are going to */
/* glGetString() returns a static string, and we are going to */
/* modify it, so we get a copy first */
version = strdup(version);
if (!version)
@ -236,9 +371,9 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
if (foc == 0)
{
if ((rot == 0) || (rot == 180))
glsym_glViewport(0, 0, w, h);
glViewport(0, 0, w, h);
else
glsym_glViewport(0, 0, h, w);
glViewport(0, 0, h, w);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// std matrix
if (m == 1)
@ -301,9 +436,9 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
if (m == -1) ay = vy * 2;
if ((rot == 0) || (rot == 180))
glsym_glViewport(-2 * vx, -2 * vy, vw, vh);
glViewport(-2 * vx, -2 * vy, vw, vh);
else
glsym_glViewport(-2 * vy, -2 * vx, vh, vw);
glViewport(-2 * vy, -2 * vx, vh, vw);
if (m == 1)
matrix_ortho(proj, 0, vw, 0, vh,
-1000000.0, 1000000.0,
@ -320,15 +455,15 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
for (i = 0; i < SHADER_LAST; ++i)
{
glsym_glUseProgram(gc->shared->shader[i].prog);
glUseProgram(gc->shared->shader[i].prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glUniformMatrix4fv(glsym_glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->state.current.cur_prog == PRG_INVALID)
glsym_glUseProgram(gc->shared->shader[0].prog);
else glsym_glUseProgram(gc->state.current.cur_prog);
glUseProgram(gc->shared->shader[0].prog);
else glUseProgram(gc->state.current.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
@ -351,6 +486,8 @@ evas_gl_common_context_new(void)
gc = calloc(1, sizeof(Evas_Engine_GL_Context));
if (!gc) return NULL;
gl_symbols();
gc->references = 1;
_evas_gl_common_context = gc;
@ -363,7 +500,7 @@ evas_gl_common_context_new(void)
const GLubyte *ext;
shared = calloc(1, sizeof(Evas_GL_Shared));
ext = glsym_glGetString(GL_EXTENSIONS);
ext = glGetString(GL_EXTENSIONS);
if (ext)
{
if (getenv("EVAS_GL_INFO"))
@ -381,7 +518,7 @@ evas_gl_common_context_new(void)
shared->info.bin_program = 1;
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if ((strstr((char *)ext, "GL_EXT_texture_filter_anisotropic")))
glsym_glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
&(shared->info.anisotropic));
#endif
#ifdef GL_BGRA
@ -399,24 +536,24 @@ evas_gl_common_context_new(void)
{
// test for all needed symbols - be "conservative" and
// need all of it
if ((glsym_eglCreateImage) &&
(glsym_eglDestroyImage) &&
(glsym_glEGLImageTargetTexture2DOES) &&
(glsym_eglMapImageSEC) &&
(glsym_eglUnmapImageSEC) &&
(glsym_eglGetImageAttribSEC))
if ((secsym_eglCreateImage) &&
(secsym_eglDestroyImage) &&
(secsym_glEGLImageTargetTexture2DOES) &&
(secsym_eglMapImageSEC) &&
(secsym_eglUnmapImageSEC) &&
(secsym_eglGetImageAttribSEC))
shared->info.sec_image_map = 1;
}
#endif
}
glsym_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
&(shared->info.max_texture_units));
glsym_glGetIntegerv(GL_MAX_TEXTURE_SIZE,
glGetIntegerv(GL_MAX_TEXTURE_SIZE,
&(shared->info.max_texture_size));
shared->info.max_vertex_elements = 6 * 100000;
#ifdef GL_MAX_ELEMENTS_VERTICES
/* only applies to glsym_glDrawRangeElements. don't really need to get it.
glsym_glGetIntegerv(GL_MAX_ELEMENTS_VERTICES,
/* only applies to glDrawRangeElements. don't really need to get it.
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES,
&(shared->info.max_vertex_elements));
*/
#endif
@ -436,7 +573,7 @@ evas_gl_common_context_new(void)
shared->info.tune.atlas.slot_size = DEF_ATLAS_SLOT;
// per gpu hacks. based on impirical measurement of some known gpu's
s = (const char *)glsym_glGetString(GL_RENDERER);
s = (const char *)glGetString(GL_RENDERER);
if (s)
{
if (strstr(s, "PowerVR SGX 540"))
@ -509,47 +646,47 @@ evas_gl_common_context_new(void)
(int)shared->info.tune.atlas.slot_size
);
glsym_glDisable(GL_DEPTH_TEST);
glDisable(GL_DEPTH_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glEnable(GL_DITHER);
glEnable(GL_DITHER);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDisable(GL_BLEND);
glDisable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// no dest alpha
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glsym_glDepthMask(GL_FALSE);
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glDepthMask(GL_FALSE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if (shared->info.anisotropic > 0.0)
{
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glsym_glEnableVertexAttribArray(SHAD_VERTEX);
glEnableVertexAttribArray(SHAD_VERTEX);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glEnableVertexAttribArray(SHAD_COLOR);
glEnableVertexAttribArray(SHAD_COLOR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!evas_gl_common_shader_program_init(shared)) goto error;
#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \
glsym_glUseProgram(Shared->shader[SHADER_##Shader].prog); \
glUseProgram(Shared->shader[SHADER_##Shader].prog); \
GLERR(__FUNCTION__, __FILE__, __LINE__, ""); \
glsym_glUniform1i(glsym_glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
glUniform1i(glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
SHADER_TEXTURE_ADD(shared, YUV, tex);
@ -576,8 +713,8 @@ evas_gl_common_context_new(void)
SHADER_TEXTURE_ADD(shared, IMG_MASK, texm);
if (gc->state.current.cur_prog == PRG_INVALID)
glsym_glUseProgram(gc->shared->shader[0].prog);
else glsym_glUseProgram(gc->state.current.cur_prog);
glUseProgram(gc->shared->shader[0].prog);
else glUseProgram(gc->state.current.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
evas_gl_common_shader_program_init_done();
@ -586,8 +723,8 @@ evas_gl_common_context_new(void)
//
// in code:
// GLuint texes[8];
// GLint loc = glsym_glGetUniformLocation(prog, "tex");
// glsym_glUniform1iv(loc, 8, texes);
// GLint loc = glGetUniformLocation(prog, "tex");
// glUniform1iv(loc, 8, texes);
shared->native_pm_hash = eina_hash_int32_new(NULL);
shared->native_tex_hash = eina_hash_int32_new(NULL);
@ -726,53 +863,53 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
}
gc->change.size = 1;
glsym_glDisable(GL_SCISSOR_TEST);
glDisable(GL_SCISSOR_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glScissor(0, 0, 0, 0);
glScissor(0, 0, 0, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDisable(GL_DEPTH_TEST);
glDisable(GL_DEPTH_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glEnable(GL_DITHER);
glEnable(GL_DITHER);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDisable(GL_BLEND);
glDisable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// no dest alpha
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glsym_glDepthMask(GL_FALSE);
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glDepthMask(GL_FALSE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if (shared->info.anisotropic > 0.0)
{
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glsym_glEnableVertexAttribArray(SHAD_VERTEX);
glEnableVertexAttribArray(SHAD_VERTEX);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glEnableVertexAttribArray(SHAD_COLOR);
glEnableVertexAttribArray(SHAD_COLOR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (gc->state.current.cur_prog == PRG_INVALID)
glsym_glUseProgram(gc->shared->shader[0].prog);
else glsym_glUseProgram(gc->state.current.cur_prog);
glUseProgram(gc->shared->shader[0].prog);
else glUseProgram(gc->state.current.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_evas_gl_common_viewport_set(gc);
@ -2177,19 +2314,19 @@ scissor_rot(Evas_Engine_GL_Context *gc __UNUSED__,
switch (rot)
{
case 0: // UP this way: ^
glsym_glScissor(cx, cy, cw, ch);
glScissor(cx, cy, cw, ch);
break;
case 90: // UP this way: <
glsym_glScissor(gh - (cy + ch), cx, ch, cw);
glScissor(gh - (cy + ch), cx, ch, cw);
break;
case 180: // UP this way: v
glsym_glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch);
glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch);
break;
case 270: // UP this way: >
glsym_glScissor(cy, gw - (cx + cw), ch, cw);
glScissor(cy, gw - (cx + cw), ch, cw);
break;
default: // assume up is up
glsym_glScissor(cx, cy, cw, ch);
glScissor(cx, cy, cw, ch);
break;
}
}
@ -2218,7 +2355,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
GLERR(__FUNCTION__, __FILE__, __LINE__, "<flush err>");
if (gc->pipe[i].shader.cur_prog != gc->state.current.cur_prog)
{
glsym_glUseProgram(gc->pipe[i].shader.cur_prog);
glUseProgram(gc->pipe[i].shader.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
@ -2227,18 +2364,18 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#if 0
if (gc->pipe[i].shader.cur_tex)
{
glsym_glEnable(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_2D);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glsym_glDisable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_2D);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glsym_glActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->pipe[i].array.im)
@ -2246,7 +2383,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gc->pipe[i].array.im->tex->pt->dyn.img)
{
glsym_glEGLImageTargetTexture2DOES
secsym_glEGLImageTargetTexture2DOES
(GL_TEXTURE_2D, gc->pipe[i].array.im->tex->pt->dyn.img);
}
else
@ -2265,12 +2402,12 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
switch (gc->pipe[i].shader.render_op)
{
case EVAS_RENDER_BLEND: /**< default op: d = d*(1-sa) + s */
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
break;
case EVAS_RENDER_COPY: /**< d = s */
gc->pipe[i].shader.blend = 0;
glsym_glBlendFunc(GL_ONE, GL_ONE);
glBlendFunc(GL_ONE, GL_ONE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
break;
// FIXME: fix blend funcs below!
@ -2285,7 +2422,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
case EVAS_RENDER_MASK: /**< d = d*sa */
case EVAS_RENDER_MUL: /**< d = d*s */
default:
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
break;
}
@ -2294,12 +2431,12 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
{
if (gc->pipe[i].shader.blend)
{
glsym_glEnable(GL_BLEND);
glEnable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glsym_glDisable(GL_BLEND);
glDisable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -2311,17 +2448,17 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if (shared->info.anisotropic > 0.0)
{
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
@ -2329,17 +2466,17 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if (shared->info.anisotropic > 0.0)
{
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -2350,7 +2487,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
{
cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch;
if (fbo) cy = gc->pipe[i].shader.cy;
glsym_glEnable(GL_SCISSOR_TEST);
glEnable(GL_SCISSOR_TEST);
if (!fbo)
scissor_rot(gc, gc->rot, gw, gh,
gc->pipe[i].shader.cx,
@ -2358,14 +2495,14 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
gc->pipe[i].shader.cw,
gc->pipe[i].shader.ch);
else
glsym_glScissor(gc->pipe[i].shader.cx, cy,
glScissor(gc->pipe[i].shader.cx, cy,
gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
setclip = 1;
}
else
{
glsym_glDisable(GL_SCISSOR_TEST);
glsym_glScissor(0, 0, 0, 0);
glDisable(GL_SCISSOR_TEST);
glScissor(0, 0, 0, 0);
}
}
if ((gc->pipe[i].shader.clip) && (!setclip))
@ -2384,112 +2521,112 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
gc->pipe[i].shader.cw,
gc->pipe[i].shader.ch);
else
glsym_glScissor(gc->pipe[i].shader.cx, cy,
glScissor(gc->pipe[i].shader.cx, cy,
gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
}
}
glsym_glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, gc->pipe[i].array.vertex);
glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, gc->pipe[i].array.vertex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glVertexAttribPointer(SHAD_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, gc->pipe[i].array.color);
glVertexAttribPointer(SHAD_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, gc->pipe[i].array.color);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (gc->pipe[i].array.use_texuv)
{
glsym_glEnableVertexAttribArray(SHAD_TEXUV);
glEnableVertexAttribArray(SHAD_TEXUV);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv);
glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glsym_glDisableVertexAttribArray(SHAD_TEXUV);
glDisableVertexAttribArray(SHAD_TEXUV);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->pipe[i].array.line)
{
glsym_glDisableVertexAttribArray(SHAD_TEXUV);
glDisableVertexAttribArray(SHAD_TEXUV);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDisableVertexAttribArray(SHAD_TEXUV2);
glDisableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDisableVertexAttribArray(SHAD_TEXUV3);
glDisableVertexAttribArray(SHAD_TEXUV3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
if (gc->pipe[i].array.use_texm)
{
glsym_glEnableVertexAttribArray(SHAD_TEXM);
glEnableVertexAttribArray(SHAD_TEXM);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texm);
glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texm);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glActiveTexture(GL_TEXTURE1);
glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glsym_glDisableVertexAttribArray(SHAD_TEXM);
glDisableVertexAttribArray(SHAD_TEXM);
}
if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3))
{
glsym_glEnableVertexAttribArray(SHAD_TEXUV2);
glEnableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glEnableVertexAttribArray(SHAD_TEXUV3);
glEnableVertexAttribArray(SHAD_TEXUV3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv3);
glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glActiveTexture(GL_TEXTURE1);
glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gc->pipe[i].shader.cur_texu_dyn)
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
#endif
glsym_glActiveTexture(GL_TEXTURE2);
glActiveTexture(GL_TEXTURE2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gc->pipe[i].shader.cur_texv_dyn)
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
#endif
glsym_glActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else if (gc->pipe[i].array.use_texuv2)
{
glsym_glEnableVertexAttribArray(SHAD_TEXUV2);
glEnableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glActiveTexture(GL_TEXTURE1);
glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gc->pipe[i].shader.cur_texu_dyn)
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
#endif
glsym_glActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glsym_glDisableVertexAttribArray(SHAD_TEXUV2);
glDisableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDisableVertexAttribArray(SHAD_TEXUV3);
glDisableVertexAttribArray(SHAD_TEXUV3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (dbgflushnum)
@ -2507,7 +2644,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
types[gc->pipe[i].region.type]
);
}
glsym_glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->pipe[i].array.im)
@ -2566,8 +2703,6 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
Eina_Bool
evas_gl_common_module_open(void)
{
if (!init_gl()) return EINA_FALSE;
if (_evas_engine_GL_common_log_dom < 0)
_evas_engine_GL_common_log_dom = eina_log_domain_register
("evas-gl_common", EVAS_DEFAULT_LOG_COLOR);
@ -2582,8 +2717,6 @@ evas_gl_common_module_open(void)
void
evas_gl_common_module_close(void)
{
free_gl();
if (_evas_engine_GL_common_log_dom < 0) return;
eina_log_domain_unregister(_evas_engine_GL_common_log_dom);
_evas_engine_GL_common_log_dom = -1;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
r = g = b = a = 255;
}
glsym_glFlush();
glFlush();
c = gc->dc->clip.use;
cx = gc->dc->clip.x; cy = gc->dc->clip.y;

View File

@ -770,26 +770,26 @@ gl_compile_link_error(GLuint target, const char *action)
char *logtxt;
/* Shader info log */
glsym_glGetShaderiv(target, GL_INFO_LOG_LENGTH, &loglen);
glGetShaderiv(target, GL_INFO_LOG_LENGTH, &loglen);
if (loglen > 0)
{
logtxt = calloc(loglen, sizeof(char));
if (logtxt)
{
glsym_glGetShaderInfoLog(target, loglen, &chars, logtxt);
glGetShaderInfoLog(target, loglen, &chars, logtxt);
ERR("Failed to %s: %s", action, logtxt);
free(logtxt);
}
}
/* Program info log */
glsym_glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
if (loglen > 0)
{
logtxt = calloc(loglen, sizeof(char));
if (logtxt)
{
glsym_glGetProgramInfoLog(target, loglen, &chars, logtxt);
glGetProgramInfoLog(target, loglen, &chars, logtxt);
ERR("Failed to %s: %s", action, logtxt);
free(logtxt);
}
@ -885,9 +885,9 @@ _evas_gl_shader_file_check(const char *bin_shader_dir, char *bin_shader_file, in
char *driver = NULL;
char *version = NULL;
vendor = (char *)glsym_glGetString(GL_VENDOR);
driver = (char *)glsym_glGetString(GL_RENDERER);
version = (char *)glsym_glGetString(GL_VERSION);
vendor = (char *)glGetString(GL_VENDOR);
driver = (char *)glGetString(GL_RENDERER);
version = (char *)glGetString(GL_VERSION);
new_path_len = snprintf(before_name, sizeof(before_name), "%s::%s::%s::%s::binary_shader.eet", vendor, version, driver, MODULE_ARCH);
@ -922,27 +922,27 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
data = eet_read(ef, pname, &length);
if ((!data) || (length <= 0)) goto finish;
glsym_glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
if (num <= 0) goto finish;
formats = calloc(num, sizeof(int));
if (!formats) goto finish;
glsym_glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats);
glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats);
if (!formats[0]) goto finish;
p->prog = glsym_glCreateProgram();
p->prog = glCreateProgram();
glsym_glProgramBinary(p->prog, formats[0], data, length);
glsym_glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
glsym_glBindAttribLocation(p->prog, SHAD_COLOR, "color");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
glsym_glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
glBindAttribLocation(p->prog, SHAD_COLOR, "color");
glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
glsym_glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!ok)
{
@ -958,7 +958,7 @@ finish:
if (data) free(data);
if ((!res) && (p->prog))
{
glsym_glDeleteProgram(p->prog);
glDeleteProgram(p->prog);
p->prog = 0;
}
return res;
@ -975,7 +975,7 @@ _evas_gl_common_shader_program_binary_save(Evas_GL_Program *p,
if (!glsym_glGetProgramBinary) return 0;
glsym_glGetProgramiv(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
glGetProgramiv(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (length <= 0) return 0;
@ -1008,21 +1008,21 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
{
GLint ok;
p->vert = glsym_glCreateShader(GL_VERTEX_SHADER);
p->frag = glsym_glCreateShader(GL_FRAGMENT_SHADER);
p->vert = glCreateShader(GL_VERTEX_SHADER);
p->frag = glCreateShader(GL_FRAGMENT_SHADER);
#if defined (GLES_VARIETY_S3C6410)
glsym_glShaderBinary(1, &(p->vert), 0, vert->bin, vert->bin_size);
glShaderBinary(1, &(p->vert), 0, vert->bin, vert->bin_size);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glShaderBinary(1, &(p->frag), 0, frag->bin, frag->bin_size);
glShaderBinary(1, &(p->frag), 0, frag->bin, frag->bin_size);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#else
glsym_glShaderSource(p->vert, 1,
glShaderSource(p->vert, 1,
(const char **)&(vert->src), NULL);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glCompileShader(p->vert);
glCompileShader(p->vert);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
ok = 0;
glsym_glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok);
glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!ok)
{
@ -1030,13 +1030,13 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
ERR("Abort compile of shader vert (%s): %s", name, vert->src);
return 0;
}
glsym_glShaderSource(p->frag, 1,
glShaderSource(p->frag, 1,
(const char **)&(frag->src), NULL);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glCompileShader(p->frag);
glCompileShader(p->frag);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
ok = 0;
glsym_glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok);
glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!ok)
{
@ -1045,35 +1045,35 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
return 0;
}
#endif
p->prog = glsym_glCreateProgram();
p->prog = glCreateProgram();
#if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
#else
if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri))
glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
GL_TRUE);
#endif
glsym_glAttachShader(p->prog, p->vert);
glAttachShader(p->prog, p->vert);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glAttachShader(p->prog, p->frag);
glAttachShader(p->prog, p->frag);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindAttribLocation(p->prog, SHAD_COLOR, "color");
glBindAttribLocation(p->prog, SHAD_COLOR, "color");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glLinkProgram(p->prog);
glLinkProgram(p->prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
ok = 0;
glsym_glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!ok)
{
@ -1249,14 +1249,14 @@ void
evas_gl_common_shader_program_init_done(void)
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_glReleaseShaderCompiler();
glReleaseShaderCompiler();
#endif
}
void
evas_gl_common_shader_program_shutdown(Evas_GL_Program *p)
{
if (p->vert) glsym_glDeleteShader(p->vert);
if (p->frag) glsym_glDeleteShader(p->frag);
if (p->prog) glsym_glDeleteProgram(p->prog);
if (p->vert) glDeleteShader(p->vert);
if (p->frag) glDeleteShader(p->frag);
if (p->prog) glDeleteProgram(p->prog);
}

View File

@ -112,7 +112,7 @@ _tex_2d(int intfmt, int w, int h, int fmt, int type)
#ifdef GL_TEXTURE_INTERNAL_FORMAT
int intfmtret = -1;
#endif
glsym_glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_TEXTURE_INTERNAL_FORMAT
// this is not in opengles!!! hrrrm
@ -129,7 +129,7 @@ _tex_2d(int intfmt, int w, int h, int fmt, int type)
static void
_tex_sub_2d(int x, int y, int w, int h, int fmt, int type, const void *pix)
{
glsym_glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
@ -168,20 +168,20 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum fo
_print_tex_count();
glsym_glGenTextures(1, &(pt->texture));
glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, pt->texture);
glBindTexture(GL_TEXTURE_2D, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
return pt;
}
@ -384,17 +384,17 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
_print_tex_count();
glsym_glGenTextures(1, &(pt->texture));
glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, pt->texture);
glBindTexture(GL_TEXTURE_2D, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
@ -407,7 +407,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
return pt;
}
@ -444,9 +444,9 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
_print_tex_count();
glsym_glGenTextures(1, &(pt->texture));
glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(im->native.target, pt->texture);
glBindTexture(im->native.target, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
@ -458,17 +458,17 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
}
#endif
glsym_glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(im->native.target, 0);
glBindTexture(im->native.target, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
return pt;
}
@ -524,17 +524,17 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
_print_tex_count();
glsym_glGenTextures(1, &(pt->texture));
glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, pt->texture);
glBindTexture(GL_TEXTURE_2D, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
egldisplay = pt->gc->egldisp;
@ -544,45 +544,45 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
// FIXME: seems a bit slower than i'd like - maybe too many flushes?
// FIXME: YCbCr no support as yet
pt->dyn.img = glsym_eglCreateImage(egldisplay,
pt->dyn.img = secsym_eglCreateImage(egldisplay,
EGL_NO_CONTEXT,
EGL_MAP_GL_TEXTURE_2D_SEC,
0, attr);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!pt->dyn.img)
{
glsym_glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_2D, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDeleteTextures(1, &(pt->texture));
glDeleteTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
free(pt);
return NULL;
}
if (glsym_eglGetImageAttribSEC(egldisplay,
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_WIDTH_SEC,
&(pt->dyn.w)) != EGL_TRUE) goto error;
if (glsym_eglGetImageAttribSEC(egldisplay,
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_HEIGHT_SEC,
&(pt->dyn.h)) != EGL_TRUE) goto error;
if (glsym_eglGetImageAttribSEC(egldisplay,
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC,
&(pt->dyn.stride)) != EGL_TRUE) goto error;
if (glsym_eglGetImageAttribSEC(egldisplay,
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_FORMAT_SEC,
&(fmt)) != EGL_TRUE) goto error;
if (glsym_eglGetImageAttribSEC(egldisplay,
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC,
&(pixtype)) != EGL_TRUE) goto error;
if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC) goto error;
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#else
gc = NULL;
@ -596,12 +596,12 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
/* ERROR HANDLING */
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
error:
glsym_eglDestroyImage(egldisplay, pt->dyn.img);
secsym_eglDestroyImage(egldisplay, pt->dyn.img);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
pt->dyn.img = NULL;
glsym_glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_2D, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glDeleteTextures(1, &(pt->texture));
glDeleteTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
free(pt);
return NULL;
@ -650,8 +650,8 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
if (pt->dyn.img)
{
if (pt->dyn.checked_out > 0)
glsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img);
glsym_eglDestroyImage(pt->gc->egldisp, pt->dyn.img);
secsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img);
secsym_eglDestroyImage(pt->gc->egldisp, pt->dyn.img);
pt->dyn.img = NULL;
pt->dyn.data = NULL;
pt->dyn.w = 0;
@ -661,7 +661,7 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
}
#endif
glsym_glDeleteTextures(1, &(pt->texture));
glDeleteTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (pt->fb)
{
@ -853,13 +853,13 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
if (!im->image.data) return;
fmt = tex->pt->format;
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_UNPACK_ROW_LENGTH
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#endif
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
@ -948,7 +948,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
#endif
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
{
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1032,19 +1032,19 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
unsigned int w, unsigned int h, int fh __UNUSED__)
{
if (!tex->pt) return;
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_UNPACK_ROW_LENGTH
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#endif
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
pixels);
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
{
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1111,32 +1111,32 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
if (!tex->pt) return;
// FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
#ifdef GL_UNPACK_ROW_LENGTH
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
_tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat);
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
#else
unsigned int y;
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
if ((rows[1] - rows[0]) == (int)w)
@ -1147,7 +1147,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
_tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
}
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat);
if ((rows[h + 1] - rows[h]) == (int)(w / 2))
@ -1158,7 +1158,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
_tex_sub_2d(0, y, w / 2, 1, tex->ptu->format, tex->ptu->dataformat, rows[h + y]);
}
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
@ -1171,7 +1171,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
#endif
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
{
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1318,9 +1318,9 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
if ((rows[1] - rows[0]) == (int)w * 4)
@ -1331,7 +1331,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
_tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
}
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat);
#if 0
@ -1350,7 +1350,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
{
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1366,26 +1366,26 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
// FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
#ifdef GL_UNPACK_ROW_LENGTH
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
_tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
#else
unsigned int y;
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
if ((rows[1] - rows[0]) == (int)w)
@ -1396,7 +1396,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
_tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
}
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
if ((rows[h + 1] - rows[h]) == (int)(w / 2))
@ -1409,7 +1409,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
#endif
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
{
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1435,7 +1435,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
char *texture_addr;
char *tmp;
texture_addr = glsym_eglMapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
/* Iterate each Y macroblock like we do in evas_convert_yuv.c */
for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
@ -1490,9 +1490,9 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
}
}
glsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
texture_addr = glsym_eglMapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
/* Iterate each UV macroblock like we do in evas_convert_yuv.c */
base_h = (mb_h >> 1) + (mb_h & 0x1);
@ -1557,15 +1557,15 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
}
}
glsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
return ;
}
#endif
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// We are telling the driver to not swizzle back the buffer as we are going to replace all pixel
@ -1612,7 +1612,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
_tex_sub_2d(x, ry, 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
}
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat);

View File

@ -110,18 +110,50 @@ static Eina_TLS resource_key;
static Eina_List *resource_list;
LK(resource_lock);
typedef void (*_eng_fn) (void);
typedef _eng_fn (*glsym_func_eng_fn) ();
typedef void (*glsym_func_void) ();
typedef void *(*glsym_func_void_ptr) ();
typedef int (*glsym_func_int) ();
typedef unsigned int (*glsym_func_uint) ();
typedef unsigned char (*glsym_func_uchar) ();
typedef unsigned char *(*glsym_func_uchar_ptr) ();
typedef const char *(*glsym_func_const_char_ptr) ();
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
#ifndef EGL_NATIVE_PIXMAP_KHR
# define EGL_NATIVE_PIXMAP_KHR 0x30b0
#endif
_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL;
void (*glsym_eglBindTexImage) (EGLDisplay a, EGLSurface b, int c) = NULL;
void (*glsym_eglReleaseTexImage) (EGLDisplay a, EGLSurface b, int c) = NULL;
void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e) = NULL;
void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
void (*glsym_glEGLImageTargetRenderbufferStorageOES) (int a, void *b) = NULL;
void *(*glsym_eglMapImageSEC) (void *a, void *b) = NULL;
unsigned int (*glsym_eglUnmapImageSEC) (void *a, void *b) = NULL;
const char *(*glsym_eglQueryString) (EGLDisplay a, int name) = NULL;
unsigned int (*glsym_eglLockSurface) (EGLDisplay a, EGLSurface b, const int *attrib_list) = NULL;
unsigned int (*glsym_eglUnlockSurface) (EGLDisplay a, EGLSurface b) = NULL;
#else
typedef XID (*glsym_func_xid) ();
_eng_fn (*glsym_glXGetProcAddress) (const char *a) = NULL;
void (*glsym_glXBindTexImage) (Display *a, GLXDrawable b, int c, int *d) = NULL;
void (*glsym_glXReleaseTexImage) (Display *a, GLXDrawable b, int c) = NULL;
int (*glsym_glXGetVideoSync) (unsigned int *a) = NULL;
int (*glsym_glXWaitVideoSync) (int a, int b, unsigned int *c) = NULL;
XID (*glsym_glXCreatePixmap) (Display *a, void *b, Pixmap c, const int *d) = NULL;
void (*glsym_glXDestroyPixmap) (Display *a, XID b) = NULL;
void (*glsym_glXQueryDrawable) (Display *a, XID b, int c, unsigned int *d) = NULL;
int (*glsym_glXSwapIntervalSGI) (int a) = NULL;
void (*glsym_glXSwapIntervalEXT) (Display *s, GLXDrawable b, int c) = NULL;
const char *(*glsym_glXQueryExtensionsString) (Display *a, int screen) = NULL;
#endif
// GLES2 Extensions
@ -295,10 +327,90 @@ _sym_init(void)
#define FINDSYM(dst, sym, typ) \
if ((!dst) && (glsym_eglGetProcAddress)) dst = (typ)glsym_eglGetProcAddress(sym); \
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddress", glsym_func_eng_fn);
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressEXT", glsym_func_eng_fn);
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressARB", glsym_func_eng_fn);
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressKHR", glsym_func_eng_fn);
FINDSYM(glsym_eglBindTexImage, "eglBindTexImage", glsym_func_void);
FINDSYM(glsym_eglBindTexImage, "eglBindTexImageEXT", glsym_func_void);
FINDSYM(glsym_eglBindTexImage, "eglBindTexImageARB", glsym_func_void);
FINDSYM(glsym_eglBindTexImage, "eglBindTexImageKHR", glsym_func_void);
FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImage", glsym_func_void);
FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImageEXT", glsym_func_void);
FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImageARB", glsym_func_void);
FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImageKHR", glsym_func_void);
FINDSYM(glsym_eglCreateImage, "eglCreateImage", glsym_func_void_ptr);
FINDSYM(glsym_eglCreateImage, "eglCreateImageEXT", glsym_func_void_ptr);
FINDSYM(glsym_eglCreateImage, "eglCreateImageARB", glsym_func_void_ptr);
FINDSYM(glsym_eglCreateImage, "eglCreateImageKHR", glsym_func_void_ptr);
FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", glsym_func_void);
FINDSYM(glsym_eglDestroyImage, "eglDestroyImageEXT", glsym_func_void);
FINDSYM(glsym_eglDestroyImage, "eglDestroyImageARB", glsym_func_void);
FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", glsym_func_void);
FINDSYM(glsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", glsym_func_void);
FINDSYM(glsym_glEGLImageTargetRenderbufferStorageOES, "glEGLImageTargetRenderbufferStorageOES", glsym_func_void);
FINDSYM(glsym_eglMapImageSEC, "eglMapImageSEC", glsym_func_void_ptr);
FINDSYM(glsym_eglUnmapImageSEC, "eglUnmapImageSEC", glsym_func_uint);
FINDSYM(glsym_eglQueryString, "eglQueryString", glsym_func_const_char_ptr);
FINDSYM(glsym_eglLockSurface, "eglLockSurface", glsym_func_uint);
FINDSYM(glsym_eglLockSurface, "eglLockSurfaceEXT", glsym_func_uint);
FINDSYM(glsym_eglLockSurface, "eglLockSurfaceARB", glsym_func_uint);
FINDSYM(glsym_eglLockSurface, "eglLockSurfaceKHR", glsym_func_uint);
FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurface", glsym_func_uint);
FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurfaceEXT", glsym_func_uint);
FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurfaceARB", glsym_func_uint);
FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurfaceKHR", glsym_func_uint);
#else
#define FINDSYM(dst, sym, typ) \
if ((!dst) && (glsym_glXGetProcAddress)) dst = (typ)glsym_glXGetProcAddress(sym); \
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddress", glsym_func_eng_fn);
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddressEXT", glsym_func_eng_fn);
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddressARB", glsym_func_eng_fn);
FINDSYM(glsym_glXBindTexImage, "glXBindTexImage", glsym_func_void);
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageEXT", glsym_func_void);
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageARB", glsym_func_void);
FINDSYM(glsym_glXReleaseTexImage, "glXReleaseTexImage", glsym_func_void);
FINDSYM(glsym_glXReleaseTexImage, "glXReleaseTexImageEXT", glsym_func_void);
FINDSYM(glsym_glXReleaseTexImage, "glXReleaseTexImageARB", glsym_func_void);
FINDSYM(glsym_glXGetVideoSync, "glXGetVideoSyncSGI", glsym_func_int);
FINDSYM(glsym_glXWaitVideoSync, "glXWaitVideoSyncSGI", glsym_func_int);
FINDSYM(glsym_glXCreatePixmap, "glXCreatePixmap", glsym_func_xid);
FINDSYM(glsym_glXCreatePixmap, "glXCreatePixmapEXT", glsym_func_xid);
FINDSYM(glsym_glXCreatePixmap, "glXCreatePixmapARB", glsym_func_xid);
FINDSYM(glsym_glXDestroyPixmap, "glXDestroyPixmap", glsym_func_void);
FINDSYM(glsym_glXDestroyPixmap, "glXDestroyPixmapEXT", glsym_func_void);
FINDSYM(glsym_glXDestroyPixmap, "glXDestroyPixmapARB", glsym_func_void);
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawable", glsym_func_void);
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableEXT", glsym_func_void);
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableARB", glsym_func_void);
FINDSYM(glsym_glXSwapIntervalSGI, "glXSwapIntervalMESA", glsym_func_int);
FINDSYM(glsym_glXSwapIntervalSGI, "glXSwapIntervalSGI", glsym_func_int);
FINDSYM(glsym_glXSwapIntervalEXT, "glXSwapIntervalEXT", glsym_func_void);
FINDSYM(glsym_glXQueryExtensionsString, "glXQueryExtensionsString", glsym_func_const_char_ptr);
#endif
//----------- GLES 2.0 Extensions ------------//
@ -453,7 +565,7 @@ _extensions_init(Render_Engine *re)
memset(_evasgl_ext_string, 0, 1024);
// GLES 2.0 Extensions
glexts = (const char*)glsym_glGetString(GL_EXTENSIONS);
glexts = (const char*)glGetString(GL_EXTENSIONS);
DBG("--------GLES 2.0 Extensions--------");
for (i = 0; _gl_ext_entries[i].name != NULL; i++)
@ -474,7 +586,7 @@ _extensions_init(Render_Engine *re)
// EGL Extensions
evasglexts = glsym_eglQueryString(re->win->egl_disp, EGL_EXTENSIONS);
#else
evasglexts = glsym_glXQueryExtensionsString(re->info->info.display,
evasglexts = glXQueryExtensionsString(re->info->info.display,
re->info->info.screen);
#endif
@ -608,7 +720,7 @@ _create_internal_glue_resources(void *data)
context_attrs[2] = EGL_NONE;
// Create resource surface for EGL
rsc->surface = glsym_eglCreateWindowSurface(re->win->egl_disp,
rsc->surface = eglCreateWindowSurface(re->win->egl_disp,
re->win->egl_config,
(EGLNativeWindowType)DefaultRootWindow(re->info->info.display),
NULL);
@ -620,7 +732,7 @@ _create_internal_glue_resources(void *data)
}
// Create a resource context for EGL
rsc->context = glsym_eglCreateContext(re->win->egl_disp,
rsc->context = eglCreateContext(re->win->egl_disp,
re->win->egl_config,
re->win->egl_context[0], // Evas' GL Context
context_attrs);
@ -646,7 +758,7 @@ _create_internal_glue_resources(void *data)
#else
// GLX
rsc->context = glsym_glXCreateContext(re->info->info.display,
rsc->context = glXCreateContext(re->info->info.display,
re->win->visualinfo,
re->win->context, // Evas' GL Context
1);
@ -689,8 +801,8 @@ _destroy_internal_glue_resources(void *data)
LKL(resource_lock);
EINA_LIST_FOREACH(resource_list, l, rsc)
{
if (rsc->surface) glsym_eglDestroySurface(re->win->egl_disp, rsc->surface);
if (rsc->context) glsym_eglDestroyContext(re->win->egl_disp, rsc->context);
if (rsc->surface) eglDestroySurface(re->win->egl_disp, rsc->surface);
if (rsc->context) eglDestroyContext(re->win->egl_disp, rsc->context);
free(rsc);
}
eina_list_free(resource_list);
@ -706,7 +818,7 @@ _destroy_internal_glue_resources(void *data)
{
if (rsc)
{
glsym_glXDestroyContext(re->info->info.display, rsc->context);
glXDestroyContext(re->info->info.display, rsc->context);
free(rsc);
}
}
@ -735,7 +847,7 @@ eng_setup(Evas *e, void *in)
#else
int eb, evb;
if (!glsym_glXQueryExtension(info->info.display, &eb, &evb)) return 0;
if (!glXQueryExtension(info->info.display, &eb, &evb)) return 0;
#endif
re = calloc(1, sizeof(Render_Engine));
if (!re) return 0;
@ -950,6 +1062,17 @@ eng_output_free(void *data)
// NOTE: XrmGetDatabase() result is shared per connection, do not free it.
// if (re->xrdb) XrmDestroyDatabase(re->xrdb);
#if 0
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
// Destroy the resource surface
// Only required for EGL case
if (re->surface)
eglDestroySurface(re->win->egl_disp, re->surface);
#endif
// Destroy the resource context
_destroy_internal_context(re, context);
#endif
if (re->win)
{
if ((initted == 1) && (gl_wins == 1))
@ -1155,7 +1278,7 @@ eng_output_redraws_next_update_push(void *data, void *surface __UNUSED__, int x
if (s) safe_native = atoi(s);
else
{
s = (const char *)glsym_glGetString(GL_RENDERER);
s = (const char *)glGetString(GL_RENDERER);
if (s)
{
if (strstr(s, "PowerVR SGX 540") ||
@ -1173,19 +1296,19 @@ eng_output_redraws_next_update_push(void *data, void *surface __UNUSED__, int x
pt = t0;
#endif
// previous rendering should be done and swapped
if (!safe_native) glsym_eglWaitNative(EGL_CORE_NATIVE_ENGINE);
if (!safe_native) eglWaitNative(EGL_CORE_NATIVE_ENGINE);
#ifdef FRAMECOUNT
double t1 = get_time();
tb = t1 - t0;
printf("... %1.5f -> %1.5f | ", ta, tb);
#endif
// if (glsym_eglGetError() != EGL_SUCCESS)
// if (eglGetError() != EGL_SUCCESS)
// {
// printf("Error: glsym_eglWaitNative(EGL_CORE_NATIVE_ENGINE) fail.\n");
// printf("Error: eglWaitNative(EGL_CORE_NATIVE_ENGINE) fail.\n");
// }
#else
// previous rendering should be done and swapped
if (!safe_native) glsym_glXWaitX();
if (!safe_native) glXWaitX();
#endif
//x// printf("frame -> push\n");
}
@ -1208,16 +1331,16 @@ eng_output_flush(void *data)
#endif
if (!re->vsync)
{
if (re->info->vsync) glsym_eglSwapInterval(re->win->egl_disp, 1);
else glsym_eglSwapInterval(re->win->egl_disp, 0);
if (re->info->vsync) eglSwapInterval(re->win->egl_disp, 1);
else eglSwapInterval(re->win->egl_disp, 0);
re->vsync = 1;
}
if (re->info->callback.pre_swap)
{
re->info->callback.pre_swap(re->info->callback.data, re->evas);
}
glsym_eglSwapBuffers(re->win->egl_disp, re->win->egl_surface[0]);
if (!safe_native) glsym_eglWaitGL();
eglSwapBuffers(re->win->egl_disp, re->win->egl_surface[0]);
if (!safe_native) eglWaitGL();
if (re->info->callback.post_swap)
{
re->info->callback.post_swap(re->info->callback.data, re->evas);
@ -1226,9 +1349,9 @@ eng_output_flush(void *data)
double t1 = get_time();
printf("%1.5f\n", t1 - t0);
#endif
// if (glsym_eglGetError() != EGL_SUCCESS)
// if (eglGetError() != EGL_SUCCESS)
// {
// printf("Error: glsym_eglSwapBuffers() fail.\n");
// printf("Error: eglSwapBuffers() fail.\n");
// }
#else
#ifdef VSYNC_TO_SCREEN
@ -1277,8 +1400,8 @@ eng_output_flush(void *data)
)
*/
{
glsym_glXSwapBuffers(re->win->disp, re->win->win);
if (!safe_native) glsym_glXWaitGL();
glXSwapBuffers(re->win->disp, re->win->win);
if (!safe_native) glXWaitGL();
}
/*
else
@ -1623,7 +1746,7 @@ _native_bind_cb(void *data, void *image)
if (glsym_glEGLImageTargetTexture2DOES)
{
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->egl_surface);
if (glsym_eglGetError() != EGL_SUCCESS)
if (eglGetError() != EGL_SUCCESS)
ERR("glEGLImageTargetTexture2DOES() failed.");
}
else
@ -1646,7 +1769,7 @@ _native_bind_cb(void *data, void *image)
}
else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
{
glsym_glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
return;
@ -1680,7 +1803,7 @@ _native_unbind_cb(void *data, void *image)
}
else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
{
glsym_glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_2D, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
return;
@ -1706,11 +1829,11 @@ _native_free_cb(void *data, void *image)
{
glsym_eglDestroyImage(re->win->egl_disp,
n->egl_surface);
if (glsym_eglGetError() != EGL_SUCCESS)
ERR("glsym_eglDestroyImage() failed.");
if (eglGetError() != EGL_SUCCESS)
ERR("eglDestroyImage() failed.");
}
else
ERR("Try glsym_eglDestroyImage on EGL with no support");
ERR("Try eglDestroyImage on EGL with no support");
}
#else
# ifdef GLX_BIND_TO_TEXTURE_TARGETS_EXT
@ -1850,6 +1973,7 @@ eng_image_native_set(void *data, void *image, void *native)
return im2;
}
}
}
im2 = evas_gl_common_image_new_from_data(re->win->gl_context,
im->w, im->h, NULL, im->alpha,
@ -1888,9 +2012,9 @@ eng_image_native_set(void *data, void *image, void *native)
config_attrs[i++] = EGL_PIXMAP_BIT;
config_attrs[i++] = EGL_NONE;
if (!glsym_eglChooseConfig(re->win->egl_disp, config_attrs,
if (!eglChooseConfig(re->win->egl_disp, config_attrs,
&egl_config, 1, &num_config))
ERR("glsym_eglChooseConfig() failed for pixmap 0x%x, num_config = %i", (unsigned int)pm, num_config);
ERR("eglChooseConfig() failed for pixmap 0x%x, num_config = %i", (unsigned int)pm, num_config);
memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
n->pixmap = pm;
n->visual = vis;
@ -1901,9 +2025,9 @@ eng_image_native_set(void *data, void *image, void *native)
(void *)pm,
NULL);
else
ERR("Try glsym_eglCreateImage on EGL with no support");
ERR("Try eglCreateImage on EGL with no support");
if (!n->egl_surface)
ERR("glsym_eglCreatePixmapSurface() for 0x%x failed", (unsigned int)pm);
ERR("eglCreatePixmapSurface() for 0x%x failed", (unsigned int)pm);
im->native.yinvert = 1;
im->native.loose = 0;
im->native.data = n;
@ -2729,15 +2853,15 @@ _create_rt_buffers(Render_Engine *data __UNUSED__,
Render_Engine_GL_Surface *sfc)
{
// Render Target texture
glsym_glGenTextures(1, &sfc->rt_tex );
glGenTextures(1, &sfc->rt_tex );
// Depth RenderBuffer - Create storage here...
if (sfc->depth_bits != EVAS_GL_DEPTH_NONE)
glsym_glGenRenderbuffers(1, &sfc->rb_depth);
glGenRenderbuffers(1, &sfc->rb_depth);
// Stencil RenderBuffer - Create Storage here...
if (sfc->stencil_bits != EVAS_GL_STENCIL_NONE)
glsym_glGenRenderbuffers(1, &sfc->rb_stencil);
glGenRenderbuffers(1, &sfc->rb_stencil);
return 1;
}
@ -2750,45 +2874,45 @@ _attach_fbo_surface(Render_Engine *data __UNUSED__,
int fb_status;
// Initialize Texture
glsym_glBindTexture(GL_TEXTURE_2D, sfc->rt_tex );
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sfc->w, sfc->h, 0,
glBindTexture(GL_TEXTURE_2D, sfc->rt_tex );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sfc->w, sfc->h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glsym_glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_2D, 0);
// Attach texture to FBO
glsym_glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo);
glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, sfc->rt_tex, 0);
// Depth RenderBuffer - Attach it to FBO
if (sfc->depth_bits != EVAS_GL_DEPTH_NONE)
{
glsym_glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_depth);
glsym_glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_depth_fmt,
glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_depth);
glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_depth_fmt,
sfc->w, sfc->h);
glsym_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GL_RENDERBUFFER, sfc->rb_depth);
glsym_glBindRenderbuffer(GL_RENDERBUFFER, 0);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
}
// Stencil RenderBuffer - Attach it to FBO
if (sfc->stencil_bits != EVAS_GL_STENCIL_NONE)
{
glsym_glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_stencil);
glsym_glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_stencil_fmt,
glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_stencil);
glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_stencil_fmt,
sfc->w, sfc->h);
glsym_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GL_RENDERBUFFER, sfc->rb_stencil);
glsym_glBindRenderbuffer(GL_RENDERBUFFER, 0);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
}
// Check FBO for completeness
fb_status = glsym_glCheckFramebufferStatus(GL_FRAMEBUFFER);
fb_status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (fb_status != GL_FRAMEBUFFER_COMPLETE)
{
ERR("FBO not complete!");
@ -2849,9 +2973,9 @@ eng_gl_surface_create(void *data, void *config, int w, int h)
// make_current called, the user can't call native_surface_get() right
// after the surface is created. hence this is done here using evas' context.
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
ret = glsym_eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface, rsc->context);
ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface, rsc->context);
#else
ret = glsym_glXMakeCurrent(re->info->info.display, re->win->win, rsc->context);
ret = glXMakeCurrent(re->info->info.display, re->win->win, rsc->context);
#endif
if (!ret)
{
@ -2869,9 +2993,9 @@ eng_gl_surface_create(void *data, void *config, int w, int h)
}
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
ret = glsym_eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
#else
ret = glsym_glXMakeCurrent(re->info->info.display, None, NULL);
ret = glXMakeCurrent(re->info->info.display, None, NULL);
#endif
if (!ret)
{
@ -2899,9 +3023,9 @@ eng_gl_surface_destroy(void *data, void *surface)
if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0;
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
ret = glsym_eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface, rsc->context);
ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface, rsc->context);
#else
ret = glsym_glXMakeCurrent(re->info->info.display, re->win->win, rsc->context);
ret = glXMakeCurrent(re->info->info.display, re->win->win, rsc->context);
#endif
if (!ret)
{
@ -2911,18 +3035,18 @@ eng_gl_surface_destroy(void *data, void *surface)
// Delete FBO/RBO and Texture here
if (sfc->rt_tex)
glsym_glDeleteTextures(1, &sfc->rt_tex);
glDeleteTextures(1, &sfc->rt_tex);
if (sfc->rb_depth)
glsym_glDeleteRenderbuffers(1, &sfc->rb_depth);
glDeleteRenderbuffers(1, &sfc->rb_depth);
if (sfc->rb_stencil)
glsym_glDeleteRenderbuffers(1, &sfc->rb_stencil);
glDeleteRenderbuffers(1, &sfc->rb_stencil);
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
ret = glsym_eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
#else
ret = glsym_glXMakeCurrent(re->info->info.display, None, NULL);
ret = glXMakeCurrent(re->info->info.display, None, NULL);
#endif
if (!ret)
{
@ -2964,14 +3088,14 @@ eng_gl_context_create(void *data, void *share_context)
if (share_ctx)
{
ctx->context = glsym_eglCreateContext(re->win->egl_disp,
ctx->context = eglCreateContext(re->win->egl_disp,
re->win->egl_config,
share_ctx->context, // Share Context
context_attrs);
}
else
{
ctx->context = glsym_eglCreateContext(re->win->egl_disp,
ctx->context = eglCreateContext(re->win->egl_disp,
re->win->egl_config,
re->win->egl_context[0], // Evas' GL Context
context_attrs);
@ -2979,21 +3103,21 @@ eng_gl_context_create(void *data, void *share_context)
if (!ctx->context)
{
ERR("glsym_eglCreateContext() fail. code=%#x", glsym_eglGetError());
ERR("eglCreateContext() fail. code=%#x", eglGetError());
return NULL;
}
#else
// GLX
if (share_context)
{
ctx->context = glsym_glXCreateContext(re->info->info.display,
ctx->context = glXCreateContext(re->info->info.display,
re->win->visualinfo,
share_ctx->context, // Share Context
1);
}
else
{
ctx->context = glsym_glXCreateContext(re->info->info.display,
ctx->context = glXCreateContext(re->info->info.display,
re->win->visualinfo,
re->win->context, // Evas' GL Context
1);
@ -3030,10 +3154,10 @@ eng_gl_context_destroy(void *data, void *context)
// 1. Do a make current with the given context
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
ret = glsym_eglMakeCurrent(re->win->egl_disp, rsc->surface,
ret = eglMakeCurrent(re->win->egl_disp, rsc->surface,
rsc->surface, ctx->context);
#else
ret = glsym_glXMakeCurrent(re->info->info.display, re->win->win,
ret = glXMakeCurrent(re->info->info.display, re->win->win,
ctx->context);
#endif
if (!ret)
@ -3044,22 +3168,22 @@ eng_gl_context_destroy(void *data, void *context)
// 2. Delete the FBO
if (ctx->context_fbo)
glsym_glDeleteFramebuffers(1, &ctx->context_fbo);
glDeleteFramebuffers(1, &ctx->context_fbo);
// 3. Destroy the Context
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_eglDestroyContext(re->win->egl_disp, ctx->context);
eglDestroyContext(re->win->egl_disp, ctx->context);
ctx->context = EGL_NO_CONTEXT;
ret = glsym_eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
#else
glsym_glXDestroyContext(re->info->info.display, ctx->context);
glXDestroyContext(re->info->info.display, ctx->context);
ctx->context = 0;
ret = glsym_glXMakeCurrent(re->info->info.display, None, NULL);
ret = glXMakeCurrent(re->info->info.display, None, NULL);
#endif
if (!ret)
{
@ -3092,10 +3216,10 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
if ((!sfc) || (!ctx))
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
ret = glsym_eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
#else
ret = glsym_glXMakeCurrent(re->info->info.display, None, NULL);
ret = glXMakeCurrent(re->info->info.display, None, NULL);
#endif
if (!ret)
{
@ -3113,15 +3237,15 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0;
if ((glsym_eglGetCurrentContext() != ctx->context) ||
(glsym_eglGetCurrentSurface(EGL_READ) != rsc->surface) ||
(glsym_eglGetCurrentSurface(EGL_DRAW) != rsc->surface) )
if ((eglGetCurrentContext() != ctx->context) ||
(eglGetCurrentSurface(EGL_READ) != rsc->surface) ||
(eglGetCurrentSurface(EGL_DRAW) != rsc->surface) )
{
// Flush remainder of what's in Evas' pipeline
if (re->win) eng_window_use(NULL);
// Do a make current
ret = glsym_eglMakeCurrent(re->win->egl_disp, rsc->surface,
ret = eglMakeCurrent(re->win->egl_disp, rsc->surface,
rsc->surface, ctx->context);
if (!ret)
{
@ -3130,14 +3254,14 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
}
}
#else
if ((glsym_glXGetCurrentContext() != ctx->context) ||
(glsym_glXGetCurrentDrawable() != re->win->win) )
if ((glXGetCurrentContext() != ctx->context) ||
(glXGetCurrentDrawable() != re->win->win) )
{
// Flush remainder of what's in Evas' pipeline
if (re->win) eng_window_use(NULL);
// Do a make current
ret = glsym_glXMakeCurrent(re->info->info.display, re->win->win, ctx->context);
ret = glXMakeCurrent(re->info->info.display, re->win->win, ctx->context);
if (!ret)
{
ERR("xxxMakeCurrent() failed!");
@ -3149,7 +3273,7 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
// Create FBO if not already created
if (!ctx->initialized)
{
glsym_glGenFramebuffers(1, &ctx->context_fbo);
glGenFramebuffers(1, &ctx->context_fbo);
ctx->initialized = 1;
}
@ -3164,10 +3288,10 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
if (ctx->current_fbo)
// Bind to the previously bound buffer
glsym_glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo);
else
// Bind FBO
glsym_glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo);
sfc->fbo_attached = 1;
}
@ -3233,7 +3357,7 @@ evgl_glGetString(GLenum name)
if (name == GL_EXTENSIONS)
return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS);
else
return glsym_glGetString(name);
return glGetString(name);
}
static void
@ -3246,13 +3370,13 @@ evgl_glBindFramebuffer(GLenum target, GLuint framebuffer)
{
if (ctx)
{
glsym_glBindFramebuffer(target, ctx->context_fbo);
glBindFramebuffer(target, ctx->context_fbo);
ctx->current_fbo = 0;
}
}
else
{
glsym_glBindFramebuffer(target, framebuffer);
glBindFramebuffer(target, framebuffer);
// Save this for restore when doing make current
if (ctx)
@ -3265,16 +3389,16 @@ evgl_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
{
// Add logic to take care when renderbuffer=0
// On a second thought we don't need this
glsym_glBindRenderbuffer(target, renderbuffer);
glBindRenderbuffer(target, renderbuffer);
}
static void
evgl_glClearDepthf(GLclampf depth)
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_glClearDepthf(depth);
glClearDepthf(depth);
#else
glsym_glClearDepthf(depth);
glClearDepth(depth);
#endif
}
@ -3282,9 +3406,9 @@ static void
evgl_glDepthRangef(GLclampf zNear, GLclampf zFar)
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_glDepthRangef(zNear, zFar);
glDepthRangef(zNear, zFar);
#else
glsym_glDepthRangef(zNear, zFar);
glDepthRange(zNear, zFar);
#endif
}
@ -3292,7 +3416,7 @@ static void
evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
#else
if (range)
{
@ -3312,7 +3436,7 @@ static void
evgl_glReleaseShaderCompiler(void)
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_glReleaseShaderCompiler();
glReleaseShaderCompiler();
#else
#endif
}
@ -3321,7 +3445,7 @@ static void
evgl_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_glShaderBinary(n, shaders, binaryformat, binary, length);
glShaderBinary(n, shaders, binaryformat, binary, length);
#else
// FIXME: need to dlsym/getprocaddress for this
return;
@ -3383,7 +3507,7 @@ eng_gl_api_get(void *data)
gl_funcs.version = EVAS_GL_API_VERSION;
#define ORD(f) EVAS_API_OVERRIDE(f, &gl_funcs, glsym_)
#define ORD(f) EVAS_API_OVERRIDE(f, &gl_funcs, )
// GLES 2.0
ORD(glActiveTexture);
ORD(glAttachShader);

View File

@ -12,8 +12,8 @@
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
# if defined(GLES_VARIETY_S3C6410)
//# include <EGL/egl.h>
//# include <GLES2/gl2.h>
# include <EGL/egl.h>
# include <GLES2/gl2.h>
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
@ -21,9 +21,9 @@
# include <X11/Xresource.h> // xres - dpi
# elif defined(GLES_VARIETY_SGX)
# define SUPPORT_X11 1
//# include <EGL/egl.h>
//# include <GLES2/gl2.h>
//# include <GLES2/gl2ext.h>
# include <EGL/egl.h>
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
@ -36,9 +36,9 @@
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# include <X11/Xresource.h> // xres - dpi
//# include <GL/gl.h>
//# include <GL/glext.h>
//# include <GL/glx.h>
# include <GL/gl.h>
# include <GL/glext.h>
# include <GL/glx.h>
#endif
extern int _evas_engine_GL_X11_log_dom ;

View File

@ -156,68 +156,68 @@ eng_window_new(Display *disp,
config_attrs[n++] = EGL_NONE;
# endif
gw->egl_disp = glsym_eglGetDisplay((EGLNativeDisplayType)(gw->disp));
gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)(gw->disp));
if (!gw->egl_disp)
{
ERR("glsym_eglGetDisplay() fail. code=%#x", glsym_eglGetError());
ERR("eglGetDisplay() fail. code=%#x", eglGetError());
eng_window_free(gw);
return NULL;
}
if (!glsym_eglInitialize(gw->egl_disp, &major_version, &minor_version))
if (!eglInitialize(gw->egl_disp, &major_version, &minor_version))
{
ERR("glsym_eglInitialize() fail. code=%#x", glsym_eglGetError());
ERR("eglInitialize() fail. code=%#x", eglGetError());
eng_window_free(gw);
return NULL;
}
glsym_eglBindAPI(EGL_OPENGL_ES_API);
if (glsym_eglGetError() != EGL_SUCCESS)
eglBindAPI(EGL_OPENGL_ES_API);
if (eglGetError() != EGL_SUCCESS)
{
ERR("glsym_eglBindAPI() fail. code=%#x", glsym_eglGetError());
ERR("eglBindAPI() fail. code=%#x", eglGetError());
eng_window_free(gw);
return NULL;
}
num_config = 0;
if (!glsym_eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config,
if (!eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config,
1, &num_config) || (num_config != 1))
{
ERR("glsym_eglChooseConfig() fail. code=%#x", glsym_eglGetError());
ERR("eglChooseConfig() fail. code=%#x", eglGetError());
eng_window_free(gw);
return NULL;
}
gw->egl_surface[0] = glsym_eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);
if (gw->egl_surface[0] == EGL_NO_SURFACE)
{
ERR("glsym_eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, glsym_eglGetError());
ERR("eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, eglGetError());
eng_window_free(gw);
return NULL;
}
if (context == EGL_NO_CONTEXT)
context = glsym_eglCreateContext(gw->egl_disp, gw->egl_config, NULL,
context = eglCreateContext(gw->egl_disp, gw->egl_config, NULL,
context_attrs);
gw->egl_context[0] = context;
if (gw->egl_context[0] == EGL_NO_CONTEXT)
{
ERR("glsym_eglCreateContext() fail. code=%#x", glsym_eglGetError());
ERR("eglCreateContext() fail. code=%#x", eglGetError());
eng_window_free(gw);
return NULL;
}
if (glsym_eglMakeCurrent(gw->egl_disp,
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("glsym_eglMakeCurrent() fail. code=%#x", glsym_eglGetError());
ERR("eglMakeCurrent() fail. code=%#x", eglGetError());
eng_window_free(gw);
return NULL;
}
vendor = glsym_glGetString(GL_VENDOR);
renderer = glsym_glGetString(GL_RENDERER);
version = glsym_glGetString(GL_VERSION);
vendor = glGetString(GL_VENDOR);
renderer = glGetString(GL_RENDERER);
version = glGetString(GL_VERSION);
if (!vendor) vendor = (unsigned char *)"-UNKNOWN-";
if (!renderer) renderer = (unsigned char *)"-UNKNOWN-";
if (!version) version = (unsigned char *)"-UNKNOWN-";
@ -233,36 +233,36 @@ eng_window_new(Display *disp,
{
#ifdef NEWGL
if (indirect)
context = glsym_glXCreateNewContext(gw->disp, fbconf,
context = glXCreateNewContext(gw->disp, fbconf,
GLX_RGBA_TYPE, NULL,
GL_FALSE);
else
context = glsym_glXCreateNewContext(gw->disp, fbconf,
context = glXCreateNewContext(gw->disp, fbconf,
GLX_RGBA_TYPE, NULL,
GL_TRUE);
#else
if (indirect)
context = glsym_glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_FALSE);
context = glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_FALSE);
else
context = glsym_glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_TRUE);
context = glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_TRUE);
#endif
}
#ifdef NEWGL
if ((gw->alpha) && (!rgba_context))
{
if (indirect)
rgba_context = glsym_glXCreateNewContext(gw->disp, rgba_fbconf,
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
GLX_RGBA_TYPE, context,
GL_FALSE);
else
rgba_context = glsym_glXCreateNewContext(gw->disp, rgba_fbconf,
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
GLX_RGBA_TYPE, context,
GL_TRUE);
}
if (gw->alpha)
gw->glxwin = glsym_glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
gw->glxwin = glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
else
gw->glxwin = glsym_glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
gw->glxwin = glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
if (!gw->glxwin)
{
eng_window_free(gw);
@ -288,19 +288,19 @@ eng_window_new(Display *disp,
if (gw->glxwin)
{
if (!glsym_glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
printf("Error: glsym_glXMakeContextCurrent(%p, %p, %p, %p)\n", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
printf("Error: glXMakeContextCurrent(%p, %p, %p, %p)\n", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
eng_window_free(gw);
return NULL;
}
}
else
{
if (!glsym_glXMakeCurrent(gw->disp, gw->win, gw->context))
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{
printf("Error: glsym_glXMakeCurrent(%p, 0x%x, %p) failed\n", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
printf("Error: glXMakeCurrent(%p, 0x%x, %p) failed\n", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
eng_window_free(gw);
return NULL;
}
@ -308,9 +308,9 @@ eng_window_new(Display *disp,
// FIXME: move this up to context creation
vendor = glsym_glGetString(GL_VENDOR);
renderer = glsym_glGetString(GL_RENDERER);
version = glsym_glGetString(GL_VERSION);
vendor = glGetString(GL_VENDOR);
renderer = glGetString(GL_RENDERER);
version = glGetString(GL_VERSION);
if (getenv("EVAS_GL_INFO"))
{
fprintf(stderr, "vendor: %s\n", vendor);
@ -416,10 +416,10 @@ eng_window_new(Display *disp,
// noothing yet. add more cases and options over time
}
fbc = glsym_glXGetFBConfigs(gw->disp, screen, &num);
fbc = glXGetFBConfigs(gw->disp, screen, &num);
if (!fbc)
{
ERR("glsym_glXGetFBConfigs() returned no fb configs");
ERR("glXGetFBConfigs() returned no fb configs");
eng_window_free(gw);
return NULL;
}
@ -432,15 +432,15 @@ eng_window_new(Display *disp,
int alph, val, dbuf, stencil, tdepth;
int rgba;
vi = glsym_glXGetVisualFromFBConfig(gw->disp, fbc[j]);
vi = glXGetVisualFromFBConfig(gw->disp, fbc[j]);
if (!vi) continue;
vd = vi->depth;
XFree(vi);
if (vd != i) continue;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BUFFER_SIZE, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BUFFER_SIZE, &val);
if ((val != i) && ((val - alph) != i)) continue;
@ -449,7 +449,7 @@ eng_window_new(Display *disp,
if (i == 32)
{
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
if (val)
{
rgba = 1;
@ -459,34 +459,34 @@ eng_window_new(Display *disp,
if (!val)
{
if (rgba) continue;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
if (!val) continue;
gw->depth_cfg[i].tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
}
dbuf = 0x7fff;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
if (val > dbuf) continue;
dbuf = val;
stencil = 0x7fff;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
if (val > stencil) continue;
stencil = val;
tdepth = 0x7fff;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
if (val > tdepth) continue;
tdepth = val;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
if (val < 0) continue;
gw->depth_cfg[i].mipmap = val;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
gw->depth_cfg[i].yinvert = val;
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &val);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &val);
gw->depth_cfg[i].tex_target = val;
gw->depth_cfg[i].fbc = fbc[j];
@ -530,20 +530,20 @@ eng_window_free(Evas_GL_X11_Window *gw)
}
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gw->egl_surface[0] != EGL_NO_SURFACE)
glsym_eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
if (ref == 0)
{
if (context) glsym_eglDestroyContext(gw->egl_disp, context);
glsym_eglTerminate(gw->egl_disp);
if (context) eglDestroyContext(gw->egl_disp, context);
eglTerminate(gw->egl_disp);
context = EGL_NO_CONTEXT;
}
glsym_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
#else
if (gw->glxwin) glsym_glXDestroyWindow(gw->disp, gw->glxwin);
if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin);
if (ref == 0)
{
if (context) glsym_glXDestroyContext(gw->disp, context);
if (rgba_context) glsym_glXDestroyContext(gw->disp, rgba_context);
if (context) glXDestroyContext(gw->disp, context);
if (rgba_context) glXDestroyContext(gw->disp, rgba_context);
context = 0;
rgba_context = 0;
fbconf = 0;
@ -561,18 +561,18 @@ eng_window_use(Evas_GL_X11_Window *gw)
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (_evas_gl_x11_window)
{
if ((glsym_eglGetCurrentContext() !=
if ((eglGetCurrentContext() !=
_evas_gl_x11_window->egl_context[0]) ||
(glsym_eglGetCurrentSurface(EGL_READ) !=
(eglGetCurrentSurface(EGL_READ) !=
_evas_gl_x11_window->egl_surface[0]) ||
(glsym_eglGetCurrentSurface(EGL_DRAW) !=
(eglGetCurrentSurface(EGL_DRAW) !=
_evas_gl_x11_window->egl_surface[0]))
force_use = EINA_TRUE;
}
#else
if (_evas_gl_x11_window)
{
if (glsym_glXGetCurrentContext() != _evas_gl_x11_window->context)
if (glXGetCurrentContext() != _evas_gl_x11_window->context)
force_use = EINA_TRUE;
}
#endif
@ -590,29 +590,29 @@ eng_window_use(Evas_GL_X11_Window *gw)
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gw->egl_surface[0] != EGL_NO_SURFACE)
{
if (glsym_eglMakeCurrent(gw->egl_disp,
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("glsym_eglMakeCurrent() failed!");
ERR("eglMakeCurrent() failed!");
}
}
// GLX
#else
if (gw->glxwin)
{
if (!glsym_glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
ERR("glsym_glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
}
}
else
{
if (!glsym_glXMakeCurrent(gw->disp, gw->win, gw->context))
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glsym_glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
}
#endif
@ -633,16 +633,16 @@ eng_window_unsurf(Evas_GL_X11_Window *gw)
evas_gl_common_context_flush(_evas_gl_x11_window->gl_context);
if (_evas_gl_x11_window == gw)
{
glsym_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (gw->egl_surface[0] != EGL_NO_SURFACE)
glsym_eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
gw->egl_surface[0] = EGL_NO_SURFACE;
_evas_gl_x11_window = NULL;
}
#else
if (gw->glxwin)
{
glsym_glXDestroyWindow(gw->disp, gw->glxwin);
glXDestroyWindow(gw->disp, gw->glxwin);
}
else
{
@ -658,37 +658,37 @@ eng_window_resurf(Evas_GL_X11_Window *gw)
if (getenv("EVAS_GL_INFO"))
printf("resurf %p\n", gw);
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
gw->egl_surface[0] = glsym_eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);
if (gw->egl_surface[0] == EGL_NO_SURFACE)
{
ERR("glsym_eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, glsym_eglGetError());
ERR("eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, eglGetError());
return;
}
if (glsym_eglMakeCurrent(gw->egl_disp,
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("glsym_eglMakeCurrent() failed!");
ERR("eglMakeCurrent() failed!");
}
#else
#ifdef NEWGL
if (gw->alpha)
gw->glxwin = glsym_glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
gw->glxwin = glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
else
gw->glxwin = glsym_glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
if (!glsym_glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->glxwin = glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
ERR("glsym_glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
}
#else
if (!glsym_glXMakeCurrent(gw->disp, gw->win, gw->context))
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glsym_glXMakeCurrent(%p, 0x%x, %p) failed", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
#endif
#endif
@ -794,12 +794,12 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
config_attrs[i++] = GLX_NONE;//GLX_NONE;//GLX_TRANSPARENT_INDEX//GLX_TRANSPARENT_RGB;
config_attrs[i++] = 0;
configs = glsym_glXChooseFBConfig(einfo->info.display,
configs = glXChooseFBConfig(einfo->info.display,
einfo->info.screen,
config_attrs, &num);
if ((!configs) || (num < 1))
{
ERR("glsym_glXChooseFBConfig returned no configs");
ERR("glXChooseFBConfig returned no configs");
return NULL;
}
for (i = 0; i < num; i++)
@ -807,7 +807,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
XVisualInfo *visinfo;
XRenderPictFormat *format = NULL;
visinfo = glsym_glXGetVisualFromFBConfig(einfo->info.display,
visinfo = glXGetVisualFromFBConfig(einfo->info.display,
configs[i]);
if (!visinfo) continue;
if (!alpha)