summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-12-17 18:04:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-01-05 15:43:44 +0900
commitdc4790e08ba8bd239e499227881ba8b7c95c127e (patch)
tree31ddc62791570ebffb26c686188378dff5f0947c /src/modules/evas/engines/gl_common
parenteda13b729851605615032a4af400de9b820e2d63 (diff)
Ector GL: Add skeletton for Evas.Ector.GL.Image.Buffer
This is an ector buffer backed by an existing Evas_GL_Image
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h9
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c15
2 files changed, 24 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 24a5c3a122..09b4cb54fd 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -18,6 +18,8 @@
18# define MESA_EGL_NO_X11_HEADERS 18# define MESA_EGL_NO_X11_HEADERS
19#endif 19#endif
20 20
21#ifndef EVAS_GL_NO_HEADERS
22
21#ifdef BUILD_ENGINE_GL_COCOA 23#ifdef BUILD_ENGINE_GL_COCOA
22# include <OpenGL/gl.h> 24# include <OpenGL/gl.h>
23# include <OpenGL/glext.h> 25# include <OpenGL/glext.h>
@@ -41,6 +43,8 @@
41# endif 43# endif
42#endif 44#endif
43 45
46#endif
47
44#include "evas_gl_define.h" 48#include "evas_gl_define.h"
45 49
46#define EVAS_GL_TILE_SIZE 16 50#define EVAS_GL_TILE_SIZE 16
@@ -649,6 +653,7 @@ Evas_GL_Texture *evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *g
649void evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h); 653void evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
650Evas_GL_Texture *evas_gl_common_texture_rgb_a_pair_new(Evas_Engine_GL_Context *gc, RGBA_Image *im); 654Evas_GL_Texture *evas_gl_common_texture_rgb_a_pair_new(Evas_Engine_GL_Context *gc, RGBA_Image *im);
651void evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex, RGBA_Image *im); 655void evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex, RGBA_Image *im);
656Evas_Colorspace evas_gl_common_gl_format_to_colorspace(GLuint f);
652 657
653void evas_gl_common_image_alloc_ensure(Evas_GL_Image *im); 658void evas_gl_common_image_alloc_ensure(Evas_GL_Image *im);
654Evas_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); 659Evas_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);
@@ -864,6 +869,8 @@ __evas_gl_errdyn(int err, const char *file, const char *func, int line, const ch
864Eina_Bool evas_gl_common_module_open(void); 869Eina_Bool evas_gl_common_module_open(void);
865void evas_gl_common_module_close(void); 870void evas_gl_common_module_close(void);
866 871
872#ifndef EVAS_GL_NO_HEADERS
873
867static inline void 874static inline void
868_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int type, const void *pix) 875_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int type, const void *pix)
869{ 876{
@@ -880,6 +887,8 @@ _comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt
880 glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, imgsize, pix); 887 glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, imgsize, pix);
881} 888}
882 889
890#endif
891
883#include "evas_gl_3d_common.h" 892#include "evas_gl_3d_common.h"
884 893
885#undef EAPI 894#undef EAPI
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 9c31dda89a..f72a3e8cf9 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -161,6 +161,21 @@ _evas_gl_texture_search_format(Eina_Bool alpha, Eina_Bool bgra, Evas_Colorspace
161 return -1; 161 return -1;
162} 162}
163 163
164Evas_Colorspace
165evas_gl_common_gl_format_to_colorspace(GLuint f)
166{
167 unsigned i;
168
169 for (i = 0; i < sizeof(matching_format) / sizeof(matching_format[0]); i++)
170 {
171 if (*matching_format[i].format == f)
172 return matching_format[i].cspace;
173 }
174
175 ERR("Unknown texture format!");
176 return EVAS_COLORSPACE_ARGB8888;
177}
178
164static void 179static void
165_print_tex_count(void) 180_print_tex_count(void)
166{ 181{