1 #ifndef EVAS_GL_COMMON_H
2 #define EVAS_GL_COMMON_H
4 #include "evas_common.h"
5 #include "evas_private.h"
16 #define GL_GLEXT_PROTOTYPES
18 #ifdef BUILD_ENGINE_GL_QUARTZ
19 # include <OpenGL/gl.h>
20 # include <OpenGL/glext.h>
22 # ifdef _EVAS_ENGINE_SDL_H
23 # if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
24 # include <SDL/SDL_opengles.h>
26 # include <SDL/SDL_opengl.h>
29 # if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
30 # if defined(GLES_VARIETY_S3C6410)
31 # include <GLES2/gl2.h>
32 # elif defined(GLES_VARIETY_SGX)
33 # include <GLES2/gl2.h>
34 # include <GLES2/gl2ext.h>
38 # include <GL/glext.h>
43 #ifndef GL_TEXTURE_RECTANGLE_NV
44 # define GL_TEXTURE_RECTANGLE_NV 0x84F5
47 # define GL_BGRA 0x80E1
50 #ifndef EGL_NO_CONTEXT
51 # define EGL_NO_CONTEXT 0
54 # define EGL_NONE 0x3038
63 #ifndef EGL_MAP_GL_TEXTURE_2D_SEC
64 # define EGL_MAP_GL_TEXTURE_2D_SEC 0x3201
66 #ifndef EGL_MAP_GL_TEXTURE_HEIGHT_SEC
67 # define EGL_MAP_GL_TEXTURE_HEIGHT_SEC 0x3202
69 #ifndef EGL_MAP_GL_TEXTURE_WIDTH_SEC
70 # define EGL_MAP_GL_TEXTURE_WIDTH_SEC 0x3203
72 #ifndef EGL_MAP_GL_TEXTURE_FORMAT_SEC
73 # define EGL_MAP_GL_TEXTURE_FORMAT_SEC 0x3204
75 #ifndef EGL_MAP_GL_TEXTURE_RGB_SEC
76 # define EGL_MAP_GL_TEXTURE_RGB_SEC 0x3205
78 #ifndef EGL_MAP_GL_TEXTURE_RGBA_SEC
79 # define EGL_MAP_GL_TEXTURE_RGBA_SEC 0x3206
81 #ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_SEC
82 # define EGL_MAP_GL_TEXTURE_LUMINANCE_SEC 0x3207
84 #ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC
85 # define EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC 0x3208
87 #ifndef EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC
88 # define EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC 0x3209
90 #ifndef EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC
91 # define EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC 0x3210
93 #ifndef EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC
94 # define EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC 0x3211
96 #ifndef GL_PROGRAM_BINARY_LENGTH
97 # define GL_PROGRAM_BINARY_LENGTH 0x8741
99 #ifndef GL_NUM_PROGRAM_BINARY_FORMATS
100 # define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
102 #ifndef GL_PROGRAM_BINARY_FORMATS
103 # define GL_PROGRAM_BINARY_FORMATS 0x87FF
105 #ifndef GL_PROGRAM_BINARY_RETRIEVABLE_HINT
106 # define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
109 #define SHAD_VERTEX 0
112 #define SHAD_TEXUV2 3
113 #define SHAD_TEXUV3 4
116 typedef struct _Evas_GL_Program Evas_GL_Program;
117 typedef struct _Evas_GL_Program_Source Evas_GL_Program_Source;
118 typedef struct _Evas_GL_Shared Evas_GL_Shared;
119 typedef struct _Evas_Engine_GL_Context Evas_Engine_GL_Context;
120 typedef struct _Evas_GL_Texture_Pool Evas_GL_Texture_Pool;
121 typedef struct _Evas_GL_Texture Evas_GL_Texture;
122 typedef struct _Evas_GL_Image Evas_GL_Image;
123 typedef struct _Evas_GL_Font_Texture Evas_GL_Font_Texture;
124 typedef struct _Evas_GL_Polygon Evas_GL_Polygon;
125 typedef struct _Evas_GL_Polygon_Point Evas_GL_Polygon_Point;
133 SHADER_IMG_BGRA_NOMUL,
143 SHADER_FILTER_INVERT,
144 SHADER_FILTER_INVERT_NOMUL,
145 SHADER_FILTER_INVERT_BGRA,
146 SHADER_FILTER_INVERT_BGRA_NOMUL,
147 SHADER_FILTER_GREYSCALE,
148 SHADER_FILTER_GREYSCALE_NOMUL,
149 SHADER_FILTER_GREYSCALE_BGRA,
150 SHADER_FILTER_GREYSCALE_BGRA_NOMUL,
152 SHADER_FILTER_SEPIA_NOMUL,
153 SHADER_FILTER_SEPIA_BGRA,
154 SHADER_FILTER_SEPIA_BGRA_NOMUL,
155 /* SHADER_FILTER_BLUR, */
156 /* SHADER_FILTER_BLUR_NOMUL, */
157 /* SHADER_FILTER_BLUR_BGRA, */
158 /* SHADER_FILTER_BLUR_BGRA_NOMUL, */
162 struct _Evas_GL_Program
164 GLuint vert, frag, prog;
169 struct _Evas_GL_Program_Source
172 const unsigned int *bin;
176 struct _Evas_GL_Shared
183 GLint max_texture_units;
184 GLint max_texture_size;
185 GLint max_vertex_elements;
189 Eina_Bool tex_npo2 : 1;
190 Eina_Bool tex_rect : 1;
191 Eina_Bool sec_image_map : 1;
192 Eina_Bool bin_program : 1;
193 // tuning params - per gpu/cpu combo?
194 #define MAX_CUTOUT 512
195 #define DEF_CUTOUT 512
197 // FIXME bug with pipes > 1 right now, should default to 32
198 #define MAX_PIPES 128
200 #define DEF_PIPES_SGX_540 32
201 #define DEF_PIPES_TEGRA_2 1
203 #define MIN_ATLAS_ALLOC 16
204 #define MAX_ATLAS_ALLOC 1024
205 #define DEF_ATLAS_ALLOC 1024
207 #define MIN_ATLAS_ALLOC_ALPHA 16
208 #define MAX_ATLAS_ALLOC_ALPHA 4096
209 #define DEF_ATLAS_ALLOC_ALPHA 4096
211 #define MAX_ATLAS_W 512
212 #define DEF_ATLAS_W 512
214 #define MAX_ATLAS_H 512
215 #define DEF_ATLAS_H 512
217 #define MIN_ATLAS_SLOT 16
218 #define MAX_ATLAS_SLOT 512
219 #define DEF_ATLAS_SLOT 16
230 int max_alloc_alpha_size;
240 Eina_List *atlas[33][3];
243 Eina_Hash *native_pm_hash;
244 Eina_Hash *native_tex_hash;
246 Evas_GL_Program shader[SHADER_LAST];
258 #define RTYPE_IMAGE 2
261 #define RTYPE_MAP 5 /* need to merge with image */
262 #define RTYPE_IMASK 6
266 struct _Evas_Engine_GL_Context
272 RGBA_Draw_Context *dc;
274 Evas_GL_Shared *shared;
281 GLuint cur_tex, cur_texu, cur_texv;
282 GLuint cur_texm, cur_texmu, cur_texmv;
298 Eina_Bool active : 1;
301 Evas_GL_Image *surface;
303 GLuint cur_tex, cur_texu, cur_texv, cur_texm;
304 void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn;
320 Eina_Bool use_vertex : 1;
321 Eina_Bool use_color : 1;
322 Eina_Bool use_texuv : 1;
323 Eina_Bool use_texuv2 : 1;
324 Eina_Bool use_texuv3 : 1;
325 Eina_Bool use_texm : 1;
334 Eina_Bool havestuff : 1;
336 Evas_GL_Image *def_surface;
338 /* If this is set: Force drawing with a particular filter */
341 #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
342 // FIXME: hack. expose egl display to gl core for egl image sec extn.
347 struct _Evas_GL_Texture_Pool
349 Evas_Engine_GL_Context *gc;
351 GLuint intformat, format, dataformat;
361 Eina_List *allocations;
363 Eina_Bool render : 1;
364 Eina_Bool native : 1;
365 Eina_Bool dynamic : 1;
368 struct _Evas_GL_Texture
370 Evas_Engine_GL_Context *gc;
372 Evas_GL_Texture_Pool *pt, *ptu, *ptv, *ptuv;
374 double sx1, sy1, sx2, sy2;
379 Evas_GL_Texture_Pool *pt[2], *ptuv[2];
387 struct _Evas_GL_Image
389 Evas_Engine_GL_Context *gc;
391 Evas_GL_Texture *tex;
392 RGBA_Image_Loadopts load_opts;
394 // if im->im == NULL, it's a render-surface so these here are used
399 unsigned char no_free : 1;
405 void (*bind) (void *data, void *image);
406 void (*unbind) (void *data, void *image);
407 void (*free) (void *data, void *image);
413 unsigned char loose : 1;
416 int scale_hint, content_hint;
421 unsigned char dirty : 1;
422 unsigned char cached : 1;
423 unsigned char alpha : 1;
424 unsigned char tex_only : 1;
427 struct _Evas_GL_Font_Texture
429 Evas_GL_Texture *tex;
432 struct _Evas_GL_Polygon
435 Eina_Bool changed : 1;
438 struct _Evas_GL_Polygon_Point
444 extern Evas_GL_Program_Source shader_rect_frag_src;
445 extern Evas_GL_Program_Source shader_rect_vert_src;
446 extern Evas_GL_Program_Source shader_font_frag_src;
447 extern Evas_GL_Program_Source shader_font_vert_src;
449 extern Evas_GL_Program_Source shader_img_frag_src;
450 extern Evas_GL_Program_Source shader_img_vert_src;
451 extern Evas_GL_Program_Source shader_img_nomul_frag_src;
452 extern Evas_GL_Program_Source shader_img_nomul_vert_src;
453 extern Evas_GL_Program_Source shader_img_bgra_frag_src;
454 extern Evas_GL_Program_Source shader_img_bgra_vert_src;
455 extern Evas_GL_Program_Source shader_img_bgra_nomul_frag_src;
456 extern Evas_GL_Program_Source shader_img_bgra_nomul_vert_src;
457 extern Evas_GL_Program_Source shader_img_mask_frag_src;
458 extern Evas_GL_Program_Source shader_img_mask_vert_src;
460 extern Evas_GL_Program_Source shader_yuv_frag_src;
461 extern Evas_GL_Program_Source shader_yuv_vert_src;
462 extern Evas_GL_Program_Source shader_yuv_nomul_frag_src;
463 extern Evas_GL_Program_Source shader_yuv_nomul_vert_src;
465 extern Evas_GL_Program_Source shader_yuy2_frag_src;
466 extern Evas_GL_Program_Source shader_yuy2_vert_src;
467 extern Evas_GL_Program_Source shader_yuy2_nomul_frag_src;
468 extern Evas_GL_Program_Source shader_yuy2_nomul_vert_src;
470 extern Evas_GL_Program_Source shader_tex_frag_src;
471 extern Evas_GL_Program_Source shader_tex_vert_src;
472 extern Evas_GL_Program_Source shader_tex_nomul_frag_src;
473 extern Evas_GL_Program_Source shader_tex_nomul_vert_src;
475 extern Evas_GL_Program_Source shader_filter_invert_frag_src;
476 extern Evas_GL_Program_Source shader_filter_invert_nomul_frag_src;
477 extern Evas_GL_Program_Source shader_filter_invert_bgra_frag_src;
478 extern Evas_GL_Program_Source shader_filter_invert_bgra_nomul_frag_src;
479 extern Evas_GL_Program_Source shader_filter_sepia_frag_src;
480 extern Evas_GL_Program_Source shader_filter_sepia_nomul_frag_src;
481 extern Evas_GL_Program_Source shader_filter_sepia_bgra_frag_src;
482 extern Evas_GL_Program_Source shader_filter_sepia_bgra_nomul_frag_src;
483 extern Evas_GL_Program_Source shader_filter_greyscale_frag_src;
484 extern Evas_GL_Program_Source shader_filter_greyscale_nomul_frag_src;
485 extern Evas_GL_Program_Source shader_filter_greyscale_bgra_frag_src;
486 extern Evas_GL_Program_Source shader_filter_greyscale_bgra_nomul_frag_src;
487 /* blur (annoyingly) needs (aka is faster with) a vertex shader */
488 extern Evas_GL_Program_Source shader_filter_blur_vert_src;
489 extern Evas_GL_Program_Source shader_filter_blur_frag_src;
490 extern Evas_GL_Program_Source shader_filter_blur_nomul_frag_src;
491 extern Evas_GL_Program_Source shader_filter_blur_bgra_frag_src;
492 extern Evas_GL_Program_Source shader_filter_blur_bgra_nomul_frag_src;
495 void glerr(int err, const char *file, const char *func, int line, const char *op);
497 Evas_Engine_GL_Context *evas_gl_common_context_new(void);
498 void evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
499 void evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
500 void evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc);
501 void evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot);
502 void evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, Evas_GL_Image *surface);
504 void evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
505 int x1, int y1, int x2, int y2,
506 int clip, int cx, int cy, int cw, int ch,
507 int r, int g, int b, int a);
508 void evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
509 int x, int y, int w, int h,
510 int r, int g, int b, int a);
511 void evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
512 Evas_GL_Texture *tex,
513 double sx, double sy, double sw, double sh,
514 int x, int y, int w, int h,
515 int r, int g, int b, int a,
516 Eina_Bool smooth, Eina_Bool tex_only);
517 void evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
518 Evas_GL_Texture *tex,
519 Evas_GL_Texture *texm,
520 double sx, double sy, double sw, double sh,
521 double sxm, double sym, double swm, double shm,
522 int x, int y, int w, int h,
523 int r, int g, int b, int a,
527 void evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
528 Evas_GL_Texture *tex,
529 double sx, double sy, double sw, double sh,
530 int x, int y, int w, int h,
531 int r, int g, int b, int a);
532 void evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
533 Evas_GL_Texture *tex,
534 double sx, double sy, double sw, double sh,
535 int x, int y, int w, int h,
536 int r, int g, int b, int a,
538 void evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
539 Evas_GL_Texture *tex,
540 double sx, double sy, double sw, double sh,
541 int x, int y, int w, int h,
542 int r, int g, int b, int a,
544 void evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
545 Evas_GL_Texture *tex,
546 double sx, double sy, double sw, double sh,
547 int x, int y, int w, int h,
548 int r, int g, int b, int a,
550 void evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
551 Evas_GL_Texture *tex,
554 int clip, int cx, int cy, int cw, int ch,
555 int r, int g, int b, int a,
558 Evas_Colorspace cspace);
559 void evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
561 int evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
562 void evas_gl_common_shader_program_init_done(void);
563 void evas_gl_common_shader_program_shutdown(Evas_GL_Program *p);
565 void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
567 void evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt);
568 Evas_GL_Texture *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im);
569 Evas_GL_Texture *evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im);
570 Evas_GL_Texture *evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
571 Evas_GL_Texture *evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
572 void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im);
573 void evas_gl_common_texture_free(Evas_GL_Texture *tex);
574 Evas_GL_Texture *evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
575 void evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
576 Evas_GL_Texture *evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
577 void evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
578 Evas_GL_Texture *evas_gl_common_texture_yuy2_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
579 void evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
580 Evas_GL_Texture *evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
581 void evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
582 Evas_GL_Texture *evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
583 void evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
585 void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc);
587 void evas_gl_common_image_ref(Evas_GL_Image *im);
588 void evas_gl_common_image_unref(Evas_GL_Image *im);
589 Evas_GL_Image *evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
590 Evas_GL_Image *evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
591 Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
592 Evas_GL_Image *evas_gl_common_image_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace);
593 Evas_GL_Image *evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha);
594 void evas_gl_common_image_native_enable(Evas_GL_Image *im);
595 void evas_gl_common_image_native_disable(Evas_GL_Image *im);
596 void evas_gl_common_image_scale_hint_set(Evas_GL_Image *im, int hint);
597 void evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint);
598 void evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc);
599 void evas_gl_common_image_free(Evas_GL_Image *im);
600 Evas_GL_Image *evas_gl_common_image_surface_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
601 void evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
602 void evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
603 void evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int npoints, RGBA_Map_Point *p, int smooth, int level);
604 void evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
606 void *evas_gl_font_texture_new(void *gc, RGBA_Font_Glyph *fg);
607 void evas_gl_font_texture_free(void *);
608 void evas_gl_font_texture_draw(void *gc, void *surface, void *dc, RGBA_Font_Glyph *fg, int x, int y);
610 Evas_GL_Polygon *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
611 Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
612 void evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
614 void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
616 #if 0 // filtering disabled
617 void evas_gl_common_filter_draw(Evas_Engine_GL_Context *context, Evas_GL_Image *im, Evas_Filter_Info *filter);
618 Filtered_Image *evas_gl_common_image_filtered_get(Evas_GL_Image *im, uint8_t *key, size_t keylen);
619 Filtered_Image *evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_Image *fimage, uint8_t *key, size_t keylen);
620 void evas_gl_common_image_filtered_free(Evas_GL_Image *im, Filtered_Image *);
623 extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
624 extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);
625 extern void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e);
626 extern void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b);
627 extern void (*glsym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei *c, GLenum *d, void *e);
628 extern void (*glsym_glProgramBinary) (GLuint a, GLenum b, const void *c, GLint d);
629 extern void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d);
631 #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
632 extern void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e);
633 extern unsigned int (*secsym_eglDestroyImage) (void *a, void *b);
634 extern void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b);
635 extern void *(*secsym_eglMapImageSEC) (void *a, void *b);
636 extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b);
637 extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d);
643 # define GLERR(fn, fl, ln, op) \
645 int __gl_err = glGetError(); \
646 if (__gl_err != GL_NO_ERROR) glerr(__gl_err, fl, fn, ln, op); \
649 # define GLERR(fn, fl, ln, op)
652 Eina_Bool evas_gl_common_module_open(void);
653 void evas_gl_common_module_close(void);