summaryrefslogtreecommitdiff
path: root/legacy/evas
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-10-13 09:00:35 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-10-13 09:00:35 +0000
commit82a183ffde3918c561fb4c82d5bda13769b9c4c1 (patch)
tree71e45d36aa5bc1a80406913eb96957027f34a0a4 /legacy/evas
parentdf079ad4da2335c586af54590561c2671d4a7577 (diff)
evas/gl_context - --whitespaces;
SVN revision: 77953
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_context.c134
1 files changed, 67 insertions, 67 deletions
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
index 4f5f1d61ad..38115fc7f8 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
@@ -110,7 +110,7 @@ gl_symbols(void)
110 FINDSYM(glsym_glMapBuffer, "glMapBufferARB", glsym_func_void_ptr); 110 FINDSYM(glsym_glMapBuffer, "glMapBufferARB", glsym_func_void_ptr);
111 FINDSYM(glsym_glMapBuffer, "glMapBufferOES", glsym_func_void_ptr); 111 FINDSYM(glsym_glMapBuffer, "glMapBufferOES", glsym_func_void_ptr);
112 FINDSYM(glsym_glMapBuffer, "glMapBufferKHR", glsym_func_void_ptr); 112 FINDSYM(glsym_glMapBuffer, "glMapBufferKHR", glsym_func_void_ptr);
113 113
114 FINDSYM(glsym_glUnmapBuffer, "glUnmapBuffer", glsym_func_boolean); 114 FINDSYM(glsym_glUnmapBuffer, "glUnmapBuffer", glsym_func_boolean);
115 FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferEXT", glsym_func_boolean); 115 FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferEXT", glsym_func_boolean);
116 FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferARB", glsym_func_boolean); 116 FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferARB", glsym_func_boolean);
@@ -713,7 +713,7 @@ evas_gl_common_context_new(void)
713 glEnableVertexAttribArray(SHAD_COLOR); 713 glEnableVertexAttribArray(SHAD_COLOR);
714 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 714 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
715 715
716 if (!evas_gl_common_shader_program_init(shared)) goto error; 716 if (!evas_gl_common_shader_program_init(shared)) goto error;
717 717
718#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \ 718#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \
719 glUseProgram(Shared->shader[SHADER_##Shader].prog); \ 719 glUseProgram(Shared->shader[SHADER_##Shader].prog); \
@@ -803,7 +803,7 @@ evas_gl_common_context_free(Evas_Engine_GL_Context *gc)
803 if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3); 803 if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
804 } 804 }
805 } 805 }
806 806
807 while (gc->font_glyph_textures) 807 while (gc->font_glyph_textures)
808 evas_gl_common_texture_free(gc->font_glyph_textures->data); 808 evas_gl_common_texture_free(gc->font_glyph_textures->data);
809 809
@@ -1148,10 +1148,10 @@ vertex_array_size_check(Evas_Engine_GL_Context *gc, int pn, int n)
1148 1148
1149static inline Evas_GL_Shader 1149static inline Evas_GL_Shader
1150evas_gl_common_shader_choice(int npoints __UNUSED__, 1150evas_gl_common_shader_choice(int npoints __UNUSED__,
1151 RGBA_Map_Point *p, 1151 RGBA_Map_Point *p,
1152 int r, int g, int b, int a, 1152 int r, int g, int b, int a,
1153 Evas_GL_Shader nomul, 1153 Evas_GL_Shader nomul,
1154 Evas_GL_Shader mul) 1154 Evas_GL_Shader mul)
1155{ 1155{
1156 if ((a == 255) && (r == 255) && (g == 255) && (b == 255)) 1156 if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
1157 { 1157 {
@@ -1218,8 +1218,8 @@ _evas_gl_common_context_push(int rtype,
1218 shader_array_flush(gc); 1218 shader_array_flush(gc);
1219 goto again; 1219 goto again;
1220 } 1220 }
1221 gc->state.top_pipe = pn; 1221 gc->state.top_pipe = pn;
1222 } 1222 }
1223 } 1223 }
1224 if ((tex) && (((tex->im) && (tex->im->native.data)) || tex->pt->dyn.img)) 1224 if ((tex) && (((tex->im) && (tex->im->native.data)) || tex->pt->dyn.img))
1225 { 1225 {
@@ -1328,17 +1328,17 @@ evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
1328 1328
1329 if (gc->dc->mask.mask) 1329 if (gc->dc->mask.mask)
1330 { 1330 {
1331 RGBA_Draw_Context *dc; 1331 RGBA_Draw_Context *dc;
1332 dc = gc->dc; 1332 dc = gc->dc;
1333 Evas_GL_Image *im; 1333 Evas_GL_Image *im;
1334 im = (void *)dc->mask.mask; 1334 im = (void *)dc->mask.mask;
1335 evas_gl_common_context_font_push(gc, im->tex, 1335 evas_gl_common_context_font_push(gc, im->tex,
1336 x - dc->mask.x, 1336 x - dc->mask.x,
1337 y - dc->mask.y, 1337 y - dc->mask.y,
1338 dc->mask.w, dc->mask.h, 1338 dc->mask.w, dc->mask.h,
1339 x, y, w, h, 1339 x, y, w, h,
1340 r, g, b, a); 1340 r, g, b, a);
1341 return; 1341 return;
1342 } 1342 }
1343 1343
1344 if (a < 255) blend = 1; 1344 if (a < 255) blend = 1;
@@ -1660,7 +1660,7 @@ evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
1660 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w; 1660 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
1661 ty2 = ((double)(tex->y) + sy) / (double)tex->pt->h; 1661 ty2 = ((double)(tex->y) + sy) / (double)tex->pt->h;
1662 1662
1663 txm1 = ((double)(texm->x) + sxm) / (double)texm->pt->w; 1663 txm1 = ((double)(texm->x) + sxm) / (double)texm->pt->w;
1664 tym1 = ((double)(texm->y) + sym + shm) / (double)texm->pt->h; 1664 tym1 = ((double)(texm->y) + sym + shm) / (double)texm->pt->h;
1665 txm2 = ((double)(texm->x) + sxm + swm) / (double)texm->pt->w; 1665 txm2 = ((double)(texm->x) + sxm + swm) / (double)texm->pt->w;
1666 tym2 = ((double)(texm->y) + sym) / (double)texm->pt->h; 1666 tym2 = ((double)(texm->y) + sym) / (double)texm->pt->h;
@@ -1727,12 +1727,12 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
1727 int pn = 0; 1727 int pn = 0;
1728 1728
1729 pn = _evas_gl_common_context_push(RTYPE_FONT, 1729 pn = _evas_gl_common_context_push(RTYPE_FONT,
1730 gc, tex, NULL, 1730 gc, tex, NULL,
1731 prog, 1731 prog,
1732 x, y, w, h, 1732 x, y, w, h,
1733 1, 1733 1,
1734 0, 1734 0,
1735 0, 0, 0, 0, 0); 1735 0, 0, 0, 0, 0);
1736 1736
1737 gc->pipe[pn].region.type = RTYPE_FONT; 1737 gc->pipe[pn].region.type = RTYPE_FONT;
1738 gc->pipe[pn].shader.cur_tex = tex->pt->texture; 1738 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
@@ -1816,12 +1816,12 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
1816 SHADER_YUV_NOMUL, SHADER_YUV)].prog; 1816 SHADER_YUV_NOMUL, SHADER_YUV)].prog;
1817 1817
1818 pn = _evas_gl_common_context_push(RTYPE_YUV, 1818 pn = _evas_gl_common_context_push(RTYPE_YUV,
1819 gc, tex, NULL, 1819 gc, tex, NULL,
1820 prog, 1820 prog,
1821 x, y, w, h, 1821 x, y, w, h,
1822 blend, 1822 blend,
1823 smooth, 1823 smooth,
1824 0, 0, 0, 0, 0); 1824 0, 0, 0, 0, 0);
1825 1825
1826 gc->pipe[pn].region.type = RTYPE_YUV; 1826 gc->pipe[pn].region.type = RTYPE_YUV;
1827 gc->pipe[pn].shader.cur_tex = tex->pt->texture; 1827 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
@@ -1901,11 +1901,11 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
1901 1901
1902void 1902void
1903evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc, 1903evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
1904 Evas_GL_Texture *tex, 1904 Evas_GL_Texture *tex,
1905 double sx, double sy, double sw, double sh, 1905 double sx, double sy, double sw, double sh,
1906 int x, int y, int w, int h, 1906 int x, int y, int w, int h,
1907 int r, int g, int b, int a, 1907 int r, int g, int b, int a,
1908 Eina_Bool smooth) 1908 Eina_Bool smooth)
1909{ 1909{
1910 int pnum, nv, nc, nu, nu2, nu3, nt, i; 1910 int pnum, nv, nc, nu, nu2, nu3, nt, i;
1911 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; 1911 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
@@ -1919,12 +1919,12 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
1919 SHADER_YUY2_NOMUL, SHADER_YUY2)].prog; 1919 SHADER_YUY2_NOMUL, SHADER_YUY2)].prog;
1920 1920
1921 pn = _evas_gl_common_context_push(RTYPE_YUY2, 1921 pn = _evas_gl_common_context_push(RTYPE_YUY2,
1922 gc, tex, NULL, 1922 gc, tex, NULL,
1923 prog, 1923 prog,
1924 x, y, w, h, 1924 x, y, w, h,
1925 blend, 1925 blend,
1926 smooth, 1926 smooth,
1927 0, 0, 0, 0, 0); 1927 0, 0, 0, 0, 0);
1928 1928
1929 gc->pipe[pn].region.type = RTYPE_YUY2; 1929 gc->pipe[pn].region.type = RTYPE_YUY2;
1930 gc->pipe[pn].shader.cur_tex = tex->pt->texture; 1930 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
@@ -1995,11 +1995,11 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
1995 1995
1996void 1996void
1997evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc, 1997evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
1998 Evas_GL_Texture *tex, 1998 Evas_GL_Texture *tex,
1999 double sx, double sy, double sw, double sh, 1999 double sx, double sy, double sw, double sh,
2000 int x, int y, int w, int h, 2000 int x, int y, int w, int h,
2001 int r, int g, int b, int a, 2001 int r, int g, int b, int a,
2002 Eina_Bool smooth) 2002 Eina_Bool smooth)
2003{ 2003{
2004 int pnum, nv, nc, nu, nu2, nu3, nt, i; 2004 int pnum, nv, nc, nu, nu2, nu3, nt, i;
2005 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; 2005 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
@@ -2013,12 +2013,12 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
2013 SHADER_NV12_NOMUL, SHADER_NV12)].prog; 2013 SHADER_NV12_NOMUL, SHADER_NV12)].prog;
2014 2014
2015 pn = _evas_gl_common_context_push(RTYPE_NV12, 2015 pn = _evas_gl_common_context_push(RTYPE_NV12,
2016 gc, tex, NULL, 2016 gc, tex, NULL,
2017 prog, 2017 prog,
2018 x, y, w, h, 2018 x, y, w, h,
2019 blend, 2019 blend,
2020 smooth, 2020 smooth,
2021 0, 0, 0, 0, 0); 2021 0, 0, 0, 0, 0);
2022 2022
2023 gc->pipe[pn].region.type = RTYPE_NV12; 2023 gc->pipe[pn].region.type = RTYPE_NV12;
2024 gc->pipe[pn].shader.cur_tex = tex->pt->texture; 2024 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
@@ -2225,7 +2225,7 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
2225 if (flat) 2225 if (flat)
2226 { 2226 {
2227 int nx = x, ny = y, nw = w, nh = h; 2227 int nx = x, ny = y, nw = w, nh = h;
2228 2228
2229 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, cx, cy, cw, ch); 2229 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, cx, cy, cw, ch);
2230 if ((nx == x) && (ny == y) && (nw == w) && (nh == h)) 2230 if ((nx == x) && (ny == y) && (nw == w) && (nh == h))
2231 { 2231 {
@@ -2581,18 +2581,18 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2581 gc->pipe[i].shader.cw, gc->pipe[i].shader.ch); 2581 gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
2582 } 2582 }
2583 } 2583 }
2584 2584
2585 unsigned char *vertex_ptr = NULL; 2585 unsigned char *vertex_ptr = NULL;
2586 unsigned char *color_ptr = NULL; 2586 unsigned char *color_ptr = NULL;
2587 unsigned char *texuv_ptr = NULL; 2587 unsigned char *texuv_ptr = NULL;
2588 unsigned char *texuv2_ptr = NULL; 2588 unsigned char *texuv2_ptr = NULL;
2589 unsigned char *texuv3_ptr = NULL; 2589 unsigned char *texuv3_ptr = NULL;
2590 unsigned char *texm_ptr = NULL; 2590 unsigned char *texm_ptr = NULL;
2591 2591
2592 if (glsym_glMapBuffer && glsym_glUnmapBuffer) 2592 if (glsym_glMapBuffer && glsym_glUnmapBuffer)
2593 { 2593 {
2594 unsigned char *x; 2594 unsigned char *x;
2595 2595
2596# define VERTEX_SIZE (gc->pipe[i].array.alloc * sizeof(GLshort) * 3) 2596# define VERTEX_SIZE (gc->pipe[i].array.alloc * sizeof(GLshort) * 3)
2597# define COLOR_SIZE (gc->pipe[i].array.alloc * sizeof(GLubyte) * 4) 2597# define COLOR_SIZE (gc->pipe[i].array.alloc * sizeof(GLubyte) * 4)
2598# define TEX_SIZE (gc->pipe[i].array.alloc * sizeof(GLfloat) * 2) 2598# define TEX_SIZE (gc->pipe[i].array.alloc * sizeof(GLfloat) * 2)
@@ -2606,7 +2606,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2606 2606
2607 glBindBuffer(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer); 2607 glBindBuffer(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer);
2608 if ((gc->pipe[i].array.buffer_alloc < (long)END_POINTER) || 2608 if ((gc->pipe[i].array.buffer_alloc < (long)END_POINTER) ||
2609 2609
2610 (gc->pipe[i].array.buffer_use >= (ARRAY_BUFFER_USE + ARRAY_BUFFER_USE_SHIFT * i))) 2610 (gc->pipe[i].array.buffer_use >= (ARRAY_BUFFER_USE + ARRAY_BUFFER_USE_SHIFT * i)))
2611 { 2611 {
2612 glBufferData(GL_ARRAY_BUFFER, (long)END_POINTER, NULL, GL_STATIC_DRAW); 2612 glBufferData(GL_ARRAY_BUFFER, (long)END_POINTER, NULL, GL_STATIC_DRAW);
@@ -2614,7 +2614,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2614 gc->pipe[i].array.buffer_use = 0; 2614 gc->pipe[i].array.buffer_use = 0;
2615 } 2615 }
2616 gc->pipe[i].array.buffer_use++; 2616 gc->pipe[i].array.buffer_use++;
2617 2617
2618 x = glsym_glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); 2618 x = glsym_glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
2619 if (x) 2619 if (x)
2620 { 2620 {
@@ -2686,11 +2686,11 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2686 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2686 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2687 glActiveTexture(GL_TEXTURE0); 2687 glActiveTexture(GL_TEXTURE0);
2688 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2688 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2689 } 2689 }
2690 else 2690 else
2691 { 2691 {
2692 glDisableVertexAttribArray(SHAD_TEXM); 2692 glDisableVertexAttribArray(SHAD_TEXM);
2693 } 2693 }
2694 if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3)) 2694 if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3))
2695 { 2695 {
2696 glEnableVertexAttribArray(SHAD_TEXUV2); 2696 glEnableVertexAttribArray(SHAD_TEXUV2);
@@ -2708,16 +2708,16 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2708 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2708 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2709#ifdef GL_GLES 2709#ifdef GL_GLES
2710 if (gc->pipe[i].shader.cur_texu_dyn) 2710 if (gc->pipe[i].shader.cur_texu_dyn)
2711 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn); 2711 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
2712#endif 2712#endif
2713 2713
2714 glActiveTexture(GL_TEXTURE2); 2714 glActiveTexture(GL_TEXTURE2);
2715 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2715 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2716 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv); 2716 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
2717 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2717 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2718#ifdef GL_GLES 2718#ifdef GL_GLES
2719 if (gc->pipe[i].shader.cur_texv_dyn) 2719 if (gc->pipe[i].shader.cur_texv_dyn)
2720 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn); 2720 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
2721#endif 2721#endif
2722 glActiveTexture(GL_TEXTURE0); 2722 glActiveTexture(GL_TEXTURE0);
2723 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2723 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
@@ -2734,8 +2734,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2734 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu); 2734 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
2735 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 2735 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2736#ifdef GL_GLES 2736#ifdef GL_GLES
2737 if (gc->pipe[i].shader.cur_texu_dyn) 2737 if (gc->pipe[i].shader.cur_texu_dyn)
2738 secsym_glEGLImageTargetTexture2DOES 2738 secsym_glEGLImageTargetTexture2DOES
2739 (GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn); 2739 (GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
2740#endif 2740#endif
2741 glActiveTexture(GL_TEXTURE0); 2741 glActiveTexture(GL_TEXTURE0);
@@ -2809,7 +2809,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2809 { 2809 {
2810 glBindBuffer(GL_ARRAY_BUFFER, 0); 2810 glBindBuffer(GL_ARRAY_BUFFER, 0);
2811 } 2811 }
2812 2812
2813 gc->pipe[i].region.x = 0; 2813 gc->pipe[i].region.x = 0;
2814 gc->pipe[i].region.y = 0; 2814 gc->pipe[i].region.y = 0;
2815 gc->pipe[i].region.w = 0; 2815 gc->pipe[i].region.w = 0;