I'm attaching a patch for the initial version of the GL Fastpath

addition to evas gl backend.

Working on different mobile devices, we've noticed that the cost of context
switch (MakeCurrent) in GL can be very expensive depending on the driver
implementation.  To minimize the poorly written driver's context switch
overhead, I've implemented a state tracking layer on top of the driver
implemented GL.

Essentially, this layer wraps all the GL/Glue(GLX/EGL) APIs and manages its own
state changes.  Internally, only one real GL context is created and logical
contexts are created every time a user requests context creation.  The logical
contexts keep track of its states and sets only the necessary states
(the ones that are different than the current ones)
when there is a MakeCurrent request.  The real MakeCurrent gets called when
there is a Surface/Window change request.

The GL library is dlopened and all the APIs are dlsym'ed and wrapped
accordingly.  All the GL functions are in evas_gl_core.{h,c}.

Here's a very simply flow of the code.
   - all the APIs are exported as function pointers (*glsym_glBegin),
     (*glsm_eglCreatContext), and etc.
   - all the native GL/Glue(GLX/EGL) APIs are dlsym'ed as _sym_glBegin,
     _sym_eglCreateContext, and etc.
   - all the fastpath APIs are implmemnted as fpgl_glBegin,
     fpgl_eglCreateContext, and etc.
   - if faspath is seletected, the exported APIs are set accordingly
     ie. glsym_glBegin = fpgl_glBegin;
   - default mode is the regular gl symbols are directly set.
     ie. glsym_glBegin = _sym_glBegin;
             
I have an Environment variable where you can set it to three different Modes

EVAS_GL_FASTPATH = 0    // Default mode. Regular GL symbols are directly loaded
EVAS_GL_FASTPATH = 1    // Fastpath mode. Takes the path described above.
EVAS_GL_FASTPATH = 2    // Wrapped mode.  All the regular GL functions are
                           wrapped once.  This can be used for various
purposes

Since all the GL symbols are now loaded in this library, I took out all
the gl symbol loading parts in the evas gl backend as you'll see in the patch.
The changes to the engine and the backend itself is pretty minor.

There are still some known issues to hammer out but I thought we're at a good
place for an initial version so that my source doesn't diverge too much.

Known Issues and To Do's
* Current GL Fastpath version doesn't support multiple threads. Instead of
  having one global real context, I would need to do it for each thread. I'll
  get on this soon.
  
  * Issues running Evas GL on certain conditions.  When running the elementary
  test (with gl engine), if you run ELMGLview test that runs in ON_DEMAND mode,
  everything works fine. BUT, when you run the ELMGLView test in ALWAYS
    mode, the subsequent elm tests shows blank screen. When you destroy the
  GLView window, everything else comes on fine.
  
  * Resource protection code.  This actually applies to Evas GL code in general
  as well. Since all the resources are shared among all the contexts that get
  created, I would like to eventually have a resource protecting mechanism that
  prevents access to resources outside of its context unless specifically
  specified.
  
  I'm attaching three files
     - evas_gl_core.h, evas_gl_core.c, fastpath.patch
     
  To get the code running...
     - copy evas_gl_core.{c,h} to src/modules/engine/gl_common/
     - apply the fastpath.patch
     - compile/install evas
     - to run with fastpath GL (ie. % EVAS_GL_FASTPATH=1 ./evasgl_sample1)



SVN revision: 65891
This commit is contained in:
Carsten Haitzler 2011-12-05 08:54:14 +00:00
parent 39467c29b6
commit 5967841988
11 changed files with 8010 additions and 1377 deletions

View File

@ -14,6 +14,8 @@ 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,6 +12,7 @@
#include <sys/time.h>
#include <unistd.h>
#include <Eet.h>
#include "evas_gl_core.h"
#define GL_GLEXT_PROTOTYPES
@ -28,14 +29,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
@ -624,29 +625,12 @@ 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 = glGetError(); \
int __gl_err = glsym_glGetError(); \
if (__gl_err != GL_NO_ERROR) glerr(__gl_err, fl, fn, ln, op); \
}
#else

View File

@ -12,142 +12,8 @@
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;
@ -249,11 +115,11 @@ _evas_gl_common_version_check()
int minor;
/*
* glGetString returns a string describing the current GL connection.
* glsym_glGetString returns a string describing the current GL connection.
* GL_VERSION is used to get the version of the connection
*/
version = (char *)glGetString(GL_VERSION);
version = (char *)glsym_glGetString(GL_VERSION);
/*
* OpengL ES
@ -300,7 +166,7 @@ _evas_gl_common_version_check()
* version number and the vendor-specific information.
*/
/* glGetString() returns a static string, and we are going to */
/* glsym_glGetString() returns a static string, and we are going to */
/* modify it, so we get a copy first */
version = strdup(version);
if (!version)
@ -371,9 +237,9 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
if (foc == 0)
{
if ((rot == 0) || (rot == 180))
glViewport(0, 0, w, h);
glsym_glViewport(0, 0, w, h);
else
glViewport(0, 0, h, w);
glsym_glViewport(0, 0, h, w);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// std matrix
if (m == 1)
@ -436,9 +302,9 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
if (m == -1) ay = vy * 2;
if ((rot == 0) || (rot == 180))
glViewport(-2 * vx, -2 * vy, vw, vh);
glsym_glViewport(-2 * vx, -2 * vy, vw, vh);
else
glViewport(-2 * vy, -2 * vx, vh, vw);
glsym_glViewport(-2 * vy, -2 * vx, vh, vw);
if (m == 1)
matrix_ortho(proj, 0, vw, 0, vh,
-1000000.0, 1000000.0,
@ -455,15 +321,15 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
for (i = 0; i < SHADER_LAST; ++i)
{
glUseProgram(gc->shared->shader[i].prog);
glsym_glUseProgram(gc->shared->shader[i].prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
glsym_glUniformMatrix4fv(glsym_glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->state.current.cur_prog == PRG_INVALID)
glUseProgram(gc->shared->shader[0].prog);
else glUseProgram(gc->state.current.cur_prog);
glsym_glUseProgram(gc->shared->shader[0].prog);
else glsym_glUseProgram(gc->state.current.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
@ -486,8 +352,6 @@ 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;
@ -500,7 +364,7 @@ evas_gl_common_context_new(void)
const GLubyte *ext;
shared = calloc(1, sizeof(Evas_GL_Shared));
ext = glGetString(GL_EXTENSIONS);
ext = glsym_glGetString(GL_EXTENSIONS);
if (ext)
{
if (getenv("EVAS_GL_INFO"))
@ -518,7 +382,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")))
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
glsym_glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
&(shared->info.anisotropic));
#endif
#ifdef GL_BGRA
@ -536,24 +400,24 @@ evas_gl_common_context_new(void)
{
// test for all needed symbols - be "conservative" and
// need all of it
if ((secsym_eglCreateImage) &&
(secsym_eglDestroyImage) &&
(secsym_glEGLImageTargetTexture2DOES) &&
(secsym_eglMapImageSEC) &&
(secsym_eglUnmapImageSEC) &&
(secsym_eglGetImageAttribSEC))
if ((glsym_eglCreateImage) &&
(glsym_eglDestroyImage) &&
(glsym_glEGLImageTargetTexture2DOES) &&
(glsym_eglMapImageSEC) &&
(glsym_eglUnmapImageSEC) &&
(glsym_eglGetImageAttribSEC))
shared->info.sec_image_map = 1;
}
#endif
}
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
glsym_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
&(shared->info.max_texture_units));
glGetIntegerv(GL_MAX_TEXTURE_SIZE,
glsym_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 glDrawRangeElements. don't really need to get it.
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES,
/* only applies to glsym_glDrawRangeElements. don't really need to get it.
glsym_glGetIntegerv(GL_MAX_ELEMENTS_VERTICES,
&(shared->info.max_vertex_elements));
*/
#endif
@ -573,7 +437,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 *)glGetString(GL_RENDERER);
s = (const char *)glsym_glGetString(GL_RENDERER);
if (s)
{
if (strstr(s, "PowerVR SGX 540"))
@ -646,47 +510,47 @@ evas_gl_common_context_new(void)
(int)shared->info.tune.atlas.slot_size
);
glDisable(GL_DEPTH_TEST);
glsym_glDisable(GL_DEPTH_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glEnable(GL_DITHER);
glsym_glEnable(GL_DITHER);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDisable(GL_BLEND);
glsym_glDisable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// no dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glDepthMask(GL_FALSE);
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glsym_glDepthMask(GL_FALSE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_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)
{
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glEnableVertexAttribArray(SHAD_VERTEX);
glsym_glEnableVertexAttribArray(SHAD_VERTEX);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glEnableVertexAttribArray(SHAD_COLOR);
glsym_glEnableVertexAttribArray(SHAD_COLOR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!evas_gl_common_shader_program_init(shared)) goto error;
#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \
glUseProgram(Shared->shader[SHADER_##Shader].prog); \
glsym_glUseProgram(Shared->shader[SHADER_##Shader].prog); \
GLERR(__FUNCTION__, __FILE__, __LINE__, ""); \
glUniform1i(glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
glsym_glUniform1i(glsym_glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
SHADER_TEXTURE_ADD(shared, YUV, tex);
@ -713,8 +577,8 @@ evas_gl_common_context_new(void)
SHADER_TEXTURE_ADD(shared, IMG_MASK, texm);
if (gc->state.current.cur_prog == PRG_INVALID)
glUseProgram(gc->shared->shader[0].prog);
else glUseProgram(gc->state.current.cur_prog);
glsym_glUseProgram(gc->shared->shader[0].prog);
else glsym_glUseProgram(gc->state.current.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
evas_gl_common_shader_program_init_done();
@ -723,8 +587,8 @@ evas_gl_common_context_new(void)
//
// in code:
// GLuint texes[8];
// GLint loc = glGetUniformLocation(prog, "tex");
// glUniform1iv(loc, 8, texes);
// GLint loc = glsym_glGetUniformLocation(prog, "tex");
// glsym_glUniform1iv(loc, 8, texes);
shared->native_pm_hash = eina_hash_int32_new(NULL);
shared->native_tex_hash = eina_hash_int32_new(NULL);
@ -863,53 +727,53 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
}
gc->change.size = 1;
glDisable(GL_SCISSOR_TEST);
glsym_glDisable(GL_SCISSOR_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glScissor(0, 0, 0, 0);
glsym_glScissor(0, 0, 0, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDisable(GL_DEPTH_TEST);
glsym_glDisable(GL_DEPTH_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glEnable(GL_DITHER);
glsym_glEnable(GL_DITHER);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDisable(GL_BLEND);
glsym_glDisable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// no dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glDepthMask(GL_FALSE);
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
// glsym_glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glsym_glDepthMask(GL_FALSE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_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)
{
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glEnableVertexAttribArray(SHAD_VERTEX);
glsym_glEnableVertexAttribArray(SHAD_VERTEX);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glEnableVertexAttribArray(SHAD_COLOR);
glsym_glEnableVertexAttribArray(SHAD_COLOR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (gc->state.current.cur_prog == PRG_INVALID)
glUseProgram(gc->shared->shader[0].prog);
else glUseProgram(gc->state.current.cur_prog);
glsym_glUseProgram(gc->shared->shader[0].prog);
else glsym_glUseProgram(gc->state.current.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glActiveTexture(GL_TEXTURE0);
glsym_glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_evas_gl_common_viewport_set(gc);
@ -2314,19 +2178,19 @@ scissor_rot(Evas_Engine_GL_Context *gc __UNUSED__,
switch (rot)
{
case 0: // UP this way: ^
glScissor(cx, cy, cw, ch);
glsym_glScissor(cx, cy, cw, ch);
break;
case 90: // UP this way: <
glScissor(gh - (cy + ch), cx, ch, cw);
glsym_glScissor(gh - (cy + ch), cx, ch, cw);
break;
case 180: // UP this way: v
glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch);
glsym_glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch);
break;
case 270: // UP this way: >
glScissor(cy, gw - (cx + cw), ch, cw);
glsym_glScissor(cy, gw - (cx + cw), ch, cw);
break;
default: // assume up is up
glScissor(cx, cy, cw, ch);
glsym_glScissor(cx, cy, cw, ch);
break;
}
}
@ -2355,7 +2219,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)
{
glUseProgram(gc->pipe[i].shader.cur_prog);
glsym_glUseProgram(gc->pipe[i].shader.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
@ -2364,18 +2228,18 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#if 0
if (gc->pipe[i].shader.cur_tex)
{
glEnable(GL_TEXTURE_2D);
glsym_glEnable(GL_TEXTURE_2D);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glDisable(GL_TEXTURE_2D);
glsym_glDisable(GL_TEXTURE_2D);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glActiveTexture(GL_TEXTURE0);
glsym_glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->pipe[i].array.im)
@ -2383,7 +2247,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)
{
secsym_glEGLImageTargetTexture2DOES
glsym_glEGLImageTargetTexture2DOES
(GL_TEXTURE_2D, gc->pipe[i].array.im->tex->pt->dyn.img);
}
else
@ -2402,12 +2266,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 */
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glsym_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;
glBlendFunc(GL_ONE, GL_ONE);
glsym_glBlendFunc(GL_ONE, GL_ONE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
break;
// FIXME: fix blend funcs below!
@ -2422,7 +2286,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
case EVAS_RENDER_MASK: /**< d = d*sa */
case EVAS_RENDER_MUL: /**< d = d*s */
default:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glsym_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
break;
}
@ -2431,12 +2295,12 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
{
if (gc->pipe[i].shader.blend)
{
glEnable(GL_BLEND);
glsym_glEnable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glDisable(GL_BLEND);
glsym_glDisable(GL_BLEND);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -2448,17 +2312,17 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if (shared->info.anisotropic > 0.0)
{
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
@ -2466,17 +2330,17 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
if (shared->info.anisotropic > 0.0)
{
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
glsym_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -2487,7 +2351,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;
glEnable(GL_SCISSOR_TEST);
glsym_glEnable(GL_SCISSOR_TEST);
if (!fbo)
scissor_rot(gc, gc->rot, gw, gh,
gc->pipe[i].shader.cx,
@ -2495,14 +2359,14 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
gc->pipe[i].shader.cw,
gc->pipe[i].shader.ch);
else
glScissor(gc->pipe[i].shader.cx, cy,
glsym_glScissor(gc->pipe[i].shader.cx, cy,
gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
setclip = 1;
}
else
{
glDisable(GL_SCISSOR_TEST);
glScissor(0, 0, 0, 0);
glsym_glDisable(GL_SCISSOR_TEST);
glsym_glScissor(0, 0, 0, 0);
}
}
if ((gc->pipe[i].shader.clip) && (!setclip))
@ -2521,112 +2385,112 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
gc->pipe[i].shader.cw,
gc->pipe[i].shader.ch);
else
glScissor(gc->pipe[i].shader.cx, cy,
glsym_glScissor(gc->pipe[i].shader.cx, cy,
gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
}
}
glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, gc->pipe[i].array.vertex);
glsym_glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, gc->pipe[i].array.vertex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, gc->pipe[i].array.color);
glsym_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)
{
glEnableVertexAttribArray(SHAD_TEXUV);
glsym_glEnableVertexAttribArray(SHAD_TEXUV);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv);
glsym_glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glDisableVertexAttribArray(SHAD_TEXUV);
glsym_glDisableVertexAttribArray(SHAD_TEXUV);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->pipe[i].array.line)
{
glDisableVertexAttribArray(SHAD_TEXUV);
glsym_glDisableVertexAttribArray(SHAD_TEXUV);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDisableVertexAttribArray(SHAD_TEXUV2);
glsym_glDisableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDisableVertexAttribArray(SHAD_TEXUV3);
glsym_glDisableVertexAttribArray(SHAD_TEXUV3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
glsym_glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
if (gc->pipe[i].array.use_texm)
{
glEnableVertexAttribArray(SHAD_TEXM);
glsym_glEnableVertexAttribArray(SHAD_TEXM);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texm);
glsym_glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texm);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glActiveTexture(GL_TEXTURE1);
glsym_glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glActiveTexture(GL_TEXTURE0);
glsym_glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glDisableVertexAttribArray(SHAD_TEXM);
glsym_glDisableVertexAttribArray(SHAD_TEXM);
}
if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3))
{
glEnableVertexAttribArray(SHAD_TEXUV2);
glsym_glEnableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glEnableVertexAttribArray(SHAD_TEXUV3);
glsym_glEnableVertexAttribArray(SHAD_TEXUV3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
glsym_glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv3);
glsym_glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glActiveTexture(GL_TEXTURE1);
glsym_glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
glsym_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)
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
#endif
glActiveTexture(GL_TEXTURE2);
glsym_glActiveTexture(GL_TEXTURE2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
glsym_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)
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
#endif
glActiveTexture(GL_TEXTURE0);
glsym_glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else if (gc->pipe[i].array.use_texuv2)
{
glEnableVertexAttribArray(SHAD_TEXUV2);
glsym_glEnableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
glsym_glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glActiveTexture(GL_TEXTURE1);
glsym_glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
glsym_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)
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
#endif
glActiveTexture(GL_TEXTURE0);
glsym_glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
else
{
glDisableVertexAttribArray(SHAD_TEXUV2);
glsym_glDisableVertexAttribArray(SHAD_TEXUV2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDisableVertexAttribArray(SHAD_TEXUV3);
glsym_glDisableVertexAttribArray(SHAD_TEXUV3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (dbgflushnum)
@ -2644,7 +2508,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
types[gc->pipe[i].region.type]
);
}
glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
glsym_glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
if (gc->pipe[i].array.im)
@ -2703,6 +2567,8 @@ 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);
@ -2717,6 +2583,8 @@ 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;
}
glFlush();
glsym_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 */
glGetShaderiv(target, GL_INFO_LOG_LENGTH, &loglen);
glsym_glGetShaderiv(target, GL_INFO_LOG_LENGTH, &loglen);
if (loglen > 0)
{
logtxt = calloc(loglen, sizeof(char));
if (logtxt)
{
glGetShaderInfoLog(target, loglen, &chars, logtxt);
glsym_glGetShaderInfoLog(target, loglen, &chars, logtxt);
ERR("Failed to %s: %s", action, logtxt);
free(logtxt);
}
}
/* Program info log */
glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
glsym_glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
if (loglen > 0)
{
logtxt = calloc(loglen, sizeof(char));
if (logtxt)
{
glGetProgramInfoLog(target, loglen, &chars, logtxt);
glsym_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 *)glGetString(GL_VENDOR);
driver = (char *)glGetString(GL_RENDERER);
version = (char *)glGetString(GL_VERSION);
vendor = (char *)glsym_glGetString(GL_VENDOR);
driver = (char *)glsym_glGetString(GL_RENDERER);
version = (char *)glsym_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;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
glsym_glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
if (num <= 0) goto finish;
formats = calloc(num, sizeof(int));
if (!formats) goto finish;
glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats);
glsym_glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats);
if (!formats[0]) goto finish;
p->prog = glCreateProgram();
p->prog = glsym_glCreateProgram();
glsym_glProgramBinary(p->prog, formats[0], data, length);
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_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");
glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
glsym_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))
{
glDeleteProgram(p->prog);
glsym_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;
glGetProgramiv(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
glsym_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 = glCreateShader(GL_VERTEX_SHADER);
p->frag = glCreateShader(GL_FRAGMENT_SHADER);
p->vert = glsym_glCreateShader(GL_VERTEX_SHADER);
p->frag = glsym_glCreateShader(GL_FRAGMENT_SHADER);
#if defined (GLES_VARIETY_S3C6410)
glShaderBinary(1, &(p->vert), 0, vert->bin, vert->bin_size);
glsym_glShaderBinary(1, &(p->vert), 0, vert->bin, vert->bin_size);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glShaderBinary(1, &(p->frag), 0, frag->bin, frag->bin_size);
glsym_glShaderBinary(1, &(p->frag), 0, frag->bin, frag->bin_size);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#else
glShaderSource(p->vert, 1,
glsym_glShaderSource(p->vert, 1,
(const char **)&(vert->src), NULL);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glCompileShader(p->vert);
glsym_glCompileShader(p->vert);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
ok = 0;
glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok);
glsym_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;
}
glShaderSource(p->frag, 1,
glsym_glShaderSource(p->frag, 1,
(const char **)&(frag->src), NULL);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glCompileShader(p->frag);
glsym_glCompileShader(p->frag);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
ok = 0;
glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok);
glsym_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 = glCreateProgram();
p->prog = glsym_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
glAttachShader(p->prog, p->vert);
glsym_glAttachShader(p->prog, p->vert);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glAttachShader(p->prog, p->frag);
glsym_glAttachShader(p->prog, p->frag);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
glsym_glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindAttribLocation(p->prog, SHAD_COLOR, "color");
glsym_glBindAttribLocation(p->prog, SHAD_COLOR, "color");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
glsym_glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
glsym_glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glLinkProgram(p->prog);
glsym_glLinkProgram(p->prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
ok = 0;
glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
glsym_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)
glReleaseShaderCompiler();
glsym_glReleaseShaderCompiler();
#endif
}
void
evas_gl_common_shader_program_shutdown(Evas_GL_Program *p)
{
if (p->vert) glDeleteShader(p->vert);
if (p->frag) glDeleteShader(p->frag);
if (p->prog) glDeleteProgram(p->prog);
if (p->vert) glsym_glDeleteShader(p->vert);
if (p->frag) glsym_glDeleteShader(p->frag);
if (p->prog) glsym_glDeleteProgram(p->prog);
}

View File

@ -110,7 +110,7 @@ static void
_tex_2d(int intfmt, int w, int h, int fmt, int type)
{
int intfmtret = -1;
glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
glsym_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
@ -127,7 +127,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)
{
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
glsym_glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
@ -166,20 +166,20 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum fo
_print_tex_count();
glGenTextures(1, &(pt->texture));
glsym_glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, pt->texture);
glsym_glBindTexture(GL_TEXTURE_2D, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_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);
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
return pt;
}
@ -382,17 +382,17 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
_print_tex_count();
glGenTextures(1, &(pt->texture));
glsym_glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, pt->texture);
glsym_glBindTexture(GL_TEXTURE_2D, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_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);
@ -405,7 +405,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__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
return pt;
}
@ -442,9 +442,9 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
_print_tex_count();
glGenTextures(1, &(pt->texture));
glsym_glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(im->native.target, pt->texture);
glsym_glBindTexture(im->native.target, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
@ -456,17 +456,17 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
}
#endif
glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(im->native.target, 0);
glsym_glBindTexture(im->native.target, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
return pt;
}
@ -522,17 +522,17 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
_print_tex_count();
glGenTextures(1, &(pt->texture));
glsym_glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, pt->texture);
glsym_glBindTexture(GL_TEXTURE_2D, pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glsym_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
egldisplay = pt->gc->egldisp;
@ -542,45 +542,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 = secsym_eglCreateImage(egldisplay,
pt->dyn.img = glsym_eglCreateImage(egldisplay,
EGL_NO_CONTEXT,
EGL_MAP_GL_TEXTURE_2D_SEC,
0, attr);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!pt->dyn.img)
{
glBindTexture(GL_TEXTURE_2D, 0);
glsym_glBindTexture(GL_TEXTURE_2D, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDeleteTextures(1, &(pt->texture));
glsym_glDeleteTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
free(pt);
return NULL;
}
if (secsym_eglGetImageAttribSEC(egldisplay,
if (glsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_WIDTH_SEC,
&(pt->dyn.w)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
if (glsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_HEIGHT_SEC,
&(pt->dyn.h)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
if (glsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC,
&(pt->dyn.stride)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
if (glsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_FORMAT_SEC,
&(fmt)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
if (glsym_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;
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#else
gc = NULL;
@ -594,12 +594,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:
secsym_eglDestroyImage(egldisplay, pt->dyn.img);
glsym_eglDestroyImage(egldisplay, pt->dyn.img);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
pt->dyn.img = NULL;
glBindTexture(GL_TEXTURE_2D, 0);
glsym_glBindTexture(GL_TEXTURE_2D, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glDeleteTextures(1, &(pt->texture));
glsym_glDeleteTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
free(pt);
return NULL;
@ -648,8 +648,8 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
if (pt->dyn.img)
{
if (pt->dyn.checked_out > 0)
secsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img);
secsym_eglDestroyImage(pt->gc->egldisp, pt->dyn.img);
glsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img);
glsym_eglDestroyImage(pt->gc->egldisp, pt->dyn.img);
pt->dyn.img = NULL;
pt->dyn.data = NULL;
pt->dyn.w = 0;
@ -659,7 +659,7 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
}
#endif
glDeleteTextures(1, &(pt->texture));
glsym_glDeleteTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (pt->fb)
{
@ -851,13 +851,13 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
if (!im->image.data) return;
fmt = tex->pt->format;
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_UNPACK_ROW_LENGTH
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
@ -946,7 +946,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)
{
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1030,19 +1030,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;
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_UNPACK_ROW_LENGTH
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glsym_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)
{
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1109,32 +1109,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
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_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]);
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
glsym_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]);
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
glsym_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;
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_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)
@ -1145,7 +1145,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]);
}
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
glsym_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))
@ -1156,7 +1156,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]);
}
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
glsym_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))
@ -1169,7 +1169,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)
{
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1316,9 +1316,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];
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_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)
@ -1329,7 +1329,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]);
}
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glsym_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
@ -1348,7 +1348,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)
{
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1364,26 +1364,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
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
glsym_glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_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]);
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
glsym_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;
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_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)
@ -1394,7 +1394,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]);
}
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glsym_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))
@ -1407,7 +1407,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)
{
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
glsym_glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
@ -1433,7 +1433,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
char *texture_addr;
char *tmp;
texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
texture_addr = glsym_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++)
@ -1488,9 +1488,9 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
}
}
secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
glsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
texture_addr = glsym_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);
@ -1555,15 +1555,15 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
}
}
secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
glsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
return ;
}
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glsym_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
glsym_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
@ -1610,7 +1610,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);
}
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
glsym_glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
_tex_2d(tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat);

File diff suppressed because it is too large Load Diff

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

@ -24,13 +24,13 @@ static int win_count = 0;
Evas_GL_X11_Window *
eng_window_new(Display *disp,
Window win,
int screen,
Visual *vis,
Colormap cmap,
int depth,
int w,
int h,
Window win,
int screen,
Visual *vis,
Colormap cmap,
int depth,
int w,
int h,
int indirect,
int alpha,
int rot)
@ -71,17 +71,17 @@ eng_window_new(Display *disp,
vi_use = _evas_gl_x11_rgba_vi;
}
#else
//#ifdef NEWGL
//#ifdef NEWGL
if (_evas_gl_x11_rgba_vi)
{
vi_use = _evas_gl_x11_rgba_vi;
}
//#endif
//#endif
#endif
}
gw->visualinfo = vi_use;
// EGL / GLES
// EGL / GLES
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
context_attrs[1] = 2;
@ -130,14 +130,14 @@ eng_window_new(Display *disp,
config_attrs[n++] = EGL_RENDERABLE_TYPE;
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
#if 0
// FIXME: n900 - omap3 sgx libs break here
// FIXME: n900 - omap3 sgx libs break here
config_attrs[n++] = EGL_RED_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_GREEN_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_BLUE_SIZE;
config_attrs[n++] = 1;
// FIXME: end n900 breakage
// FIXME: end n900 breakage
#endif
if (gw->alpha)
{
@ -156,68 +156,68 @@ eng_window_new(Display *disp,
config_attrs[n++] = EGL_NONE;
# endif
gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)(gw->disp));
gw->egl_disp = glsym_eglGetDisplay((EGLNativeDisplayType)(gw->disp));
if (!gw->egl_disp)
{
ERR("eglGetDisplay() fail. code=%#x", eglGetError());
eng_window_free(gw);
ERR("glsym_eglGetDisplay() fail. code=%#x", glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
if (!eglInitialize(gw->egl_disp, &major_version, &minor_version))
if (!glsym_eglInitialize(gw->egl_disp, &major_version, &minor_version))
{
ERR("eglInitialize() fail. code=%#x", eglGetError());
eng_window_free(gw);
ERR("glsym_eglInitialize() fail. code=%#x", glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
eglBindAPI(EGL_OPENGL_ES_API);
if (eglGetError() != EGL_SUCCESS)
glsym_eglBindAPI(EGL_OPENGL_ES_API);
if (glsym_eglGetError() != EGL_SUCCESS)
{
ERR("eglBindAPI() fail. code=%#x", eglGetError());
eng_window_free(gw);
ERR("glsym_eglBindAPI() fail. code=%#x", glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
num_config = 0;
if (!eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config,
1, &num_config) || (num_config != 1))
if (!glsym_eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config,
1, &num_config) || (num_config != 1))
{
ERR("eglChooseConfig() fail. code=%#x", eglGetError());
eng_window_free(gw);
ERR("glsym_eglChooseConfig() fail. code=%#x", glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);
gw->egl_surface[0] = glsym_eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);
if (gw->egl_surface[0] == EGL_NO_SURFACE)
{
ERR("eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, eglGetError());
eng_window_free(gw);
ERR("glsym_eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
if (context == EGL_NO_CONTEXT)
context = eglCreateContext(gw->egl_disp, gw->egl_config, NULL,
context_attrs);
context = glsym_eglCreateContext(gw->egl_disp, gw->egl_config, NULL,
context_attrs);
gw->egl_context[0] = context;
if (gw->egl_context[0] == EGL_NO_CONTEXT)
{
ERR("eglCreateContext() fail. code=%#x", eglGetError());
eng_window_free(gw);
ERR("glsym_eglCreateContext() fail. code=%#x", glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
if (glsym_eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("eglMakeCurrent() fail. code=%#x", eglGetError());
eng_window_free(gw);
ERR("glsym_eglMakeCurrent() fail. code=%#x", glsym_eglGetError());
eng_window_free(gw);
return NULL;
}
vendor = glGetString(GL_VENDOR);
renderer = glGetString(GL_RENDERER);
version = glGetString(GL_VERSION);
vendor = glsym_glGetString(GL_VENDOR);
renderer = glsym_glGetString(GL_RENDERER);
version = glsym_glGetString(GL_VERSION);
if (!vendor) vendor = (unsigned char *)"-UNKNOWN-";
if (!renderer) renderer = (unsigned char *)"-UNKNOWN-";
if (!version) version = (unsigned char *)"-UNKNOWN-";
@ -227,45 +227,45 @@ eng_window_new(Display *disp,
fprintf(stderr, "renderer: %s\n", renderer);
fprintf(stderr, "version: %s\n", version);
}
// GLX
// GLX
#else
if (!context)
{
#ifdef NEWGL
if (indirect)
context = glXCreateNewContext(gw->disp, fbconf,
GLX_RGBA_TYPE, NULL,
GL_FALSE);
context = glsym_glXCreateNewContext(gw->disp, fbconf,
GLX_RGBA_TYPE, NULL,
GL_FALSE);
else
context = glXCreateNewContext(gw->disp, fbconf,
GLX_RGBA_TYPE, NULL,
GL_TRUE);
context = glsym_glXCreateNewContext(gw->disp, fbconf,
GLX_RGBA_TYPE, NULL,
GL_TRUE);
#else
if (indirect)
context = glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_FALSE);
context = glsym_glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_FALSE);
else
context = glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_TRUE);
context = glsym_glXCreateContext(gw->disp, gw->visualinfo, NULL, GL_TRUE);
#endif
}
#ifdef NEWGL
if ((gw->alpha) && (!rgba_context))
{
if (indirect)
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
GLX_RGBA_TYPE, context,
GL_FALSE);
rgba_context = glsym_glXCreateNewContext(gw->disp, rgba_fbconf,
GLX_RGBA_TYPE, context,
GL_FALSE);
else
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
GLX_RGBA_TYPE, context,
GL_TRUE);
rgba_context = glsym_glXCreateNewContext(gw->disp, rgba_fbconf,
GLX_RGBA_TYPE, context,
GL_TRUE);
}
if (gw->alpha)
gw->glxwin = glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
gw->glxwin = glsym_glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
else
gw->glxwin = glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
gw->glxwin = glsym_glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
if (!gw->glxwin)
{
eng_window_free(gw);
eng_window_free(gw);
return NULL;
}
@ -277,7 +277,7 @@ eng_window_new(Display *disp,
if (!gw->context)
{
eng_window_free(gw);
eng_window_free(gw);
return NULL;
}
if (gw->context)
@ -288,19 +288,19 @@ eng_window_new(Display *disp,
if (gw->glxwin)
{
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
if (!glsym_glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
printf("Error: glXMakeContextCurrent(%p, %p, %p, %p)\n", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
printf("Error: glsym_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 (!glXMakeCurrent(gw->disp, gw->win, gw->context))
if (!glsym_glXMakeCurrent(gw->disp, gw->win, gw->context))
{
printf("Error: glXMakeCurrent(%p, 0x%x, %p) failed\n", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
printf("Error: glsym_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 = glGetString(GL_VENDOR);
renderer = glGetString(GL_RENDERER);
version = glGetString(GL_VERSION);
vendor = glsym_glGetString(GL_VENDOR);
renderer = glsym_glGetString(GL_RENDERER);
version = glsym_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 = glXGetFBConfigs(gw->disp, screen, &num);
fbc = glsym_glXGetFBConfigs(gw->disp, screen, &num);
if (!fbc)
{
ERR("glXGetFBConfigs() returned no fb configs");
ERR("glsym_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 = glXGetVisualFromFBConfig(gw->disp, fbc[j]);
vi = glsym_glXGetVisualFromFBConfig(gw->disp, fbc[j]);
if (!vi) continue;
vd = vi->depth;
XFree(vi);
if (vd != i) continue;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BUFFER_SIZE, &val);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
glsym_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)
{
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
glsym_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;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
glsym_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;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
if (val > dbuf) continue;
dbuf = val;
stencil = 0x7fff;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
if (val > stencil) continue;
stencil = val;
tdepth = 0x7fff;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
if (val > tdepth) continue;
tdepth = val;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
if (val < 0) continue;
gw->depth_cfg[i].mipmap = val;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
glsym_glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
gw->depth_cfg[i].yinvert = val;
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &val);
glsym_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];
@ -503,8 +503,8 @@ eng_window_new(Display *disp,
gw->gl_context = evas_gl_common_context_new();
if (!gw->gl_context)
{
eng_window_free(gw);
return NULL;
eng_window_free(gw);
return NULL;
}
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
gw->gl_context->egldisp = gw->egl_disp;
@ -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)
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
glsym_eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
if (ref == 0)
{
if (context) eglDestroyContext(gw->egl_disp, context);
eglTerminate(gw->egl_disp);
if (context) glsym_eglDestroyContext(gw->egl_disp, context);
glsym_eglTerminate(gw->egl_disp);
context = EGL_NO_CONTEXT;
}
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
glsym_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
#else
if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin);
if (gw->glxwin) glsym_glXDestroyWindow(gw->disp, gw->glxwin);
if (ref == 0)
{
if (context) glXDestroyContext(gw->disp, context);
if (rgba_context) glXDestroyContext(gw->disp, rgba_context);
if (context) glsym_glXDestroyContext(gw->disp, context);
if (rgba_context) glsym_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 ((eglGetCurrentContext() !=
if ((glsym_eglGetCurrentContext() !=
_evas_gl_x11_window->egl_context[0]) ||
(eglGetCurrentSurface(EGL_READ) !=
_evas_gl_x11_window->egl_surface[0]) ||
(eglGetCurrentSurface(EGL_DRAW) !=
_evas_gl_x11_window->egl_surface[0]))
(glsym_eglGetCurrentSurface(EGL_READ) !=
_evas_gl_x11_window->egl_surface[0]) ||
(glsym_eglGetCurrentSurface(EGL_DRAW) !=
_evas_gl_x11_window->egl_surface[0]))
force_use = EINA_TRUE;
}
#else
if (_evas_gl_x11_window)
{
if (glXGetCurrentContext() != _evas_gl_x11_window->context)
if (glsym_glXGetCurrentContext() != _evas_gl_x11_window->context)
force_use = EINA_TRUE;
}
#endif
@ -586,35 +586,35 @@ eng_window_use(Evas_GL_X11_Window *gw)
_evas_gl_x11_window = gw;
if (gw)
{
// EGL / GLES
// EGL / GLES
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gw->egl_surface[0] != EGL_NO_SURFACE)
{
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("eglMakeCurrent() failed!");
}
}
// GLX
if (gw->egl_surface[0] != EGL_NO_SURFACE)
{
if (glsym_eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("glsym_eglMakeCurrent() failed!");
}
}
// GLX
#else
if (gw->glxwin)
{
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
}
}
else
{
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
}
if (gw->glxwin)
{
if (!glsym_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);
}
}
else
{
if (!glsym_glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glsym_glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
}
#endif
}
}
@ -633,17 +633,17 @@ 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)
{
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
glsym_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (gw->egl_surface[0] != EGL_NO_SURFACE)
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
glsym_eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
gw->egl_surface[0] = EGL_NO_SURFACE;
_evas_gl_x11_window = NULL;
}
#else
if (gw->glxwin)
{
glXDestroyWindow(gw->disp, gw->glxwin);
}
{
glsym_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] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);
gw->egl_surface[0] = glsym_eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);
if (gw->egl_surface[0] == EGL_NO_SURFACE)
{
ERR("eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, eglGetError());
ERR("glsym_eglCreateWindowSurface() fail for %#x. code=%#x",
(unsigned int)gw->win, glsym_eglGetError());
return;
}
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
if (glsym_eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("eglMakeCurrent() failed!");
ERR("glsym_eglMakeCurrent() failed!");
}
#else
#ifdef NEWGL
if (gw->alpha)
gw->glxwin = glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
gw->glxwin = glsym_glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
else
gw->glxwin = glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
gw->glxwin = glsym_glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
if (!glsym_glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
ERR("glsym_glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->glxwin, (void *)gw->glxwin, (void *)gw->context);
}
#else
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
if (!glsym_glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
ERR("glsym_glXMakeCurrent(%p, 0x%x, %p) failed", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
#endif
#endif
@ -704,7 +704,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
{
int alpha;
// EGL / GLES
// EGL / GLES
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
for (alpha = 0; alpha < 2; alpha++)
{
@ -733,10 +733,10 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
(fmt->direct.alphaMask))
{
_evas_gl_x11_rgba_vi =
calloc(1, sizeof(XVisualInfo));
calloc(1, sizeof(XVisualInfo));
if (_evas_gl_x11_rgba_vi)
memcpy(_evas_gl_x11_rgba_vi,
&(xvi[i]), sizeof(XVisualInfo));
memcpy(_evas_gl_x11_rgba_vi,
&(xvi[i]), sizeof(XVisualInfo));
break;
}
}
@ -751,7 +751,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
_evas_gl_x11_vi);
}
}
// GLX
// GLX
#else
for (alpha = 0; alpha < 2; alpha++)
{
@ -793,13 +793,13 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
config_attrs[i++] = GLX_TRANSPARENT_TYPE;
config_attrs[i++] = GLX_NONE;//GLX_NONE;//GLX_TRANSPARENT_INDEX//GLX_TRANSPARENT_RGB;
config_attrs[i++] = 0;
configs = glXChooseFBConfig(einfo->info.display,
einfo->info.screen,
config_attrs, &num);
configs = glsym_glXChooseFBConfig(einfo->info.display,
einfo->info.screen,
config_attrs, &num);
if ((!configs) || (num < 1))
{
ERR("glXChooseFBConfig returned no configs");
ERR("glsym_glXChooseFBConfig returned no configs");
return NULL;
}
for (i = 0; i < num; i++)
@ -807,8 +807,8 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
XVisualInfo *visinfo;
XRenderPictFormat *format = NULL;
visinfo = glXGetVisualFromFBConfig(einfo->info.display,
configs[i]);
visinfo = glsym_glXGetVisualFromFBConfig(einfo->info.display,
configs[i]);
if (!visinfo) continue;
if (!alpha)
{
@ -822,7 +822,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
else
{
format = XRenderFindVisualFormat
(einfo->info.display, visinfo->visual);
(einfo->info.display, visinfo->visual);
if (!format)
{
XFree(visinfo);
@ -846,13 +846,13 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
if (!_evas_gl_x11_vi) return NULL;
if (einfo->info.destination_alpha)
{
// EGL / GLES
// EGL / GLES
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (_evas_gl_x11_rgba_vi) return _evas_gl_x11_rgba_vi->visual;
#else
//# ifdef NEWGL
//# ifdef NEWGL
if (_evas_gl_x11_rgba_vi) return _evas_gl_x11_rgba_vi->visual;
//# endif
//# endif
#endif
}
return _evas_gl_x11_vi->visual;
@ -868,21 +868,21 @@ eng_best_colormap_get(Evas_Engine_Info_GL_X11 *einfo)
if (einfo->info.destination_alpha)
{
if (!_evas_gl_x11_rgba_cmap)
_evas_gl_x11_rgba_cmap =
XCreateColormap(einfo->info.display,
RootWindow(einfo->info.display,
einfo->info.screen),
_evas_gl_x11_rgba_vi->visual,
0);
_evas_gl_x11_rgba_cmap =
XCreateColormap(einfo->info.display,
RootWindow(einfo->info.display,
einfo->info.screen),
_evas_gl_x11_rgba_vi->visual,
0);
return _evas_gl_x11_rgba_cmap;
}
if (!_evas_gl_x11_cmap)
_evas_gl_x11_cmap =
XCreateColormap(einfo->info.display,
RootWindow(einfo->info.display,
einfo->info.screen),
_evas_gl_x11_vi->visual,
0);
_evas_gl_x11_cmap =
XCreateColormap(einfo->info.display,
RootWindow(einfo->info.display,
einfo->info.screen),
_evas_gl_x11_vi->visual,
0);
return _evas_gl_x11_cmap;
}