summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2009-11-06 11:32:23 +0000
committerCarsten Haitzler <raster@rasterman.com>2009-11-06 11:32:23 +0000
commit3fa19065148eec0ed5d27de09aeb1eedfdbd8d37 (patch)
tree00125e3a1f00fbece614113b2acaa9ce25dc4d8a
parent9b56603875fa614f342e8ac27d500ace9b1b294c (diff)
better text perf - less geometry data for complex text drawing.
simpler yuv with matrix. SVN revision: 43487
-rw-r--r--legacy/evas/src/modules/engines/gl_common/Makefile.am1
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_common.h21
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_context.c42
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c219
-rw-r--r--legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.h19
-rw-r--r--legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.shd19
-rw-r--r--legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h49
-rw-r--r--legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm46
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/evas_engine.c25
9 files changed, 232 insertions, 209 deletions
diff --git a/legacy/evas/src/modules/engines/gl_common/Makefile.am b/legacy/evas/src/modules/engines/gl_common/Makefile.am
index 49c4e15057..adb3e3005b 100644
--- a/legacy/evas/src/modules/engines/gl_common/Makefile.am
+++ b/legacy/evas/src/modules/engines/gl_common/Makefile.am
@@ -62,4 +62,5 @@ shader/font_frag.shd \
62shader/font_frag_s3c6410.asm \ 62shader/font_frag_s3c6410.asm \
63shader/font_vert.shd \ 63shader/font_vert.shd \
64shader/yuv_frag.shd \ 64shader/yuv_frag.shd \
65shader/yuv_frag_s3c6410.asm \
65shader/yuv_vert.shd 66shader/yuv_vert.shd
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h
index e16df6fa72..5b6a25926d 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h
@@ -104,26 +104,11 @@ struct _Evas_GL_Context
104 RGBA_Draw_Context *dc; 104 RGBA_Draw_Context *dc;
105 105
106 Evas_GL_Shared *shared; 106 Evas_GL_Shared *shared;
107/*
108 Eina_List *images;
109
110 struct {
111 Eina_List *whole;
112 Eina_List *atlas[33][3];
113 } tex;
114 struct {
115 GLint max_texture_units;
116 GLint max_texture_size;
117 Eina_Bool tex_npo2 : 1;
118 Eina_Bool tex_rect : 1;
119 } info;
120 */
121 struct { 107 struct {
122 int x, y, w, h; 108 int x, y, w, h;
123 Eina_Bool active : 1; 109 Eina_Bool active : 1;
124 } clip; 110 } clip;
125 struct { 111 struct {
126/* Evas_GL_Program rect, img, font, yuv;*/
127 GLuint cur_prog; 112 GLuint cur_prog;
128 GLuint cur_tex, cur_texu, cur_texv; 113 GLuint cur_tex, cur_texu, cur_texv;
129 Eina_Bool smooth : 1; 114 Eina_Bool smooth : 1;
@@ -138,8 +123,8 @@ struct _Evas_GL_Context
138 struct { 123 struct {
139 int num; 124 int num;
140 int alloc; 125 int alloc;
141 GLint *vertex; 126 GLshort *vertex;
142 GLfloat *color; 127 GLubyte *color;
143 GLfloat *texuv; 128 GLfloat *texuv;
144 GLfloat *texuv2; 129 GLfloat *texuv2;
145 GLfloat *texuv3; 130 GLfloat *texuv3;
@@ -153,7 +138,7 @@ struct _Evas_GL_Texture_Pool
153{ 138{
154 Evas_GL_Context *gc; 139 Evas_GL_Context *gc;
155 GLuint texture; 140 GLuint texture;
156 GLuint format; 141 GLuint intformat, format, dataformat;
157 int w, h; 142 int w, h;
158 int references; 143 int references;
159 int slot, fslot; 144 int slot, fslot;
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 57a3a5bee1..44ffbd9fc3 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
@@ -177,12 +177,6 @@ evas_gl_common_context_new(void)
177 &(shader_font_vert_src), 177 &(shader_font_vert_src),
178 &(shader_font_frag_src), 178 &(shader_font_frag_src),
179 "font"); 179 "font");
180//#if defined (GLES_VARIETY_S3C6410)
181// evas_gl_common_shader_program_init(&(shared->shader.yuv),
182// &(shader_img_vert_src),
183// &(shader_img_frag_src),
184// "yuv");
185//#else
186 evas_gl_common_shader_program_init(&(shared->shader.yuv), 180 evas_gl_common_shader_program_init(&(shared->shader.yuv),
187 &(shader_yuv_vert_src), 181 &(shader_yuv_vert_src),
188 &(shader_yuv_frag_src), 182 &(shader_yuv_frag_src),
@@ -191,7 +185,6 @@ evas_gl_common_context_new(void)
191 glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "tex"), 0); 185 glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "tex"), 0);
192 glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texu"), 1); 186 glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texu"), 1);
193 glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texv"), 2); 187 glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texv"), 2);
194//#endif
195 // in shader: 188 // in shader:
196 // uniform sampler2D tex[8]; 189 // uniform sampler2D tex[8];
197 // 190 //
@@ -235,7 +228,6 @@ evas_gl_common_context_free(Evas_GL_Context *gc)
235 } 228 }
236 free(gc->shared); 229 free(gc->shared);
237 shared = NULL; 230 shared = NULL;
238 // FIXME: free shader.rect.prog etc. etc.
239 } 231 }
240 232
241 free(gc->array.vertex); 233 free(gc->array.vertex);
@@ -284,11 +276,6 @@ evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h)
284#define PUSH_TEXUV3(u, v) \ 276#define PUSH_TEXUV3(u, v) \
285 gc->array.texuv3[nu3++] = u; \ 277 gc->array.texuv3[nu3++] = u; \
286 gc->array.texuv3[nu3++] = v 278 gc->array.texuv3[nu3++] = v
287#define COLOR_FLOAT(r, g, b, a, fr, fg, fb, fa) \
288 fr = ((GLfloat)(r)) / 255.0; \
289 fg = ((GLfloat)(g)) / 255.0; \
290 fb = ((GLfloat)(b)) / 255.0; \
291 fa = ((GLfloat)(a)) / 255.0
292 279
293static inline void 280static inline void
294_evas_gl_common_context_array_alloc(Evas_GL_Context *gc) 281_evas_gl_common_context_array_alloc(Evas_GL_Context *gc)
@@ -296,9 +283,9 @@ _evas_gl_common_context_array_alloc(Evas_GL_Context *gc)
296 if (gc->array.num <= gc->array.alloc) return; 283 if (gc->array.num <= gc->array.alloc) return;
297 gc->array.alloc += 6 * 1024; 284 gc->array.alloc += 6 * 1024;
298 gc->array.vertex = realloc(gc->array.vertex, 285 gc->array.vertex = realloc(gc->array.vertex,
299 gc->array.alloc * sizeof(GLint) * 3); 286 gc->array.alloc * sizeof(GLshort) * 3);
300 gc->array.color = realloc(gc->array.color, 287 gc->array.color = realloc(gc->array.color,
301 gc->array.alloc * sizeof(GLfloat) * 4); 288 gc->array.alloc * sizeof(GLubyte) * 4);
302 gc->array.texuv = realloc(gc->array.texuv, 289 gc->array.texuv = realloc(gc->array.texuv,
303 gc->array.alloc * sizeof(GLfloat) * 2); 290 gc->array.alloc * sizeof(GLfloat) * 2);
304 gc->array.texuv2 = realloc(gc->array.texuv2, 291 gc->array.texuv2 = realloc(gc->array.texuv2,
@@ -313,7 +300,6 @@ evas_gl_common_context_rectangle_push(Evas_GL_Context *gc,
313 int r, int g, int b, int a) 300 int r, int g, int b, int a)
314{ 301{
315 int pnum, nv, nc, nu, nt, i; 302 int pnum, nv, nc, nu, nt, i;
316 GLfloat rr, gg, bb, aa;
317 Eina_Bool blend = 0; 303 Eina_Bool blend = 0;
318 304
319 if (a < 255) blend = 1; 305 if (a < 255) blend = 1;
@@ -345,10 +331,9 @@ evas_gl_common_context_rectangle_push(Evas_GL_Context *gc,
345 { 331 {
346 PUSH_TEXUV(0.0, 0.0); 332 PUSH_TEXUV(0.0, 0.0);
347 } 333 }
348 COLOR_FLOAT(r, g, b, a, rr, gg, bb, aa);
349 for (i = 0; i < 6; i++) 334 for (i = 0; i < 6; i++)
350 { 335 {
351 PUSH_COLOR(rr, gg, bb, aa); 336 PUSH_COLOR(r, g, b, a);
352 } 337 }
353} 338}
354 339
@@ -361,7 +346,7 @@ evas_gl_common_context_image_push(Evas_GL_Context *gc,
361 Eina_Bool smooth) 346 Eina_Bool smooth)
362{ 347{
363 int pnum, nv, nc, nu, nt, i; 348 int pnum, nv, nc, nu, nt, i;
364 GLfloat rr, gg, bb, aa, tx1, tx2, ty1, ty2; 349 GLfloat tx1, tx2, ty1, ty2;
365 Eina_Bool blend = 1; 350 Eina_Bool blend = 1;
366 351
367 if (tex->pt->format == GL_RGB) blend = 0; 352 if (tex->pt->format == GL_RGB) blend = 0;
@@ -406,10 +391,9 @@ evas_gl_common_context_image_push(Evas_GL_Context *gc,
406 PUSH_TEXUV(tx2, ty2); 391 PUSH_TEXUV(tx2, ty2);
407 PUSH_TEXUV(tx1, ty2); 392 PUSH_TEXUV(tx1, ty2);
408 393
409 COLOR_FLOAT(r, g, b, a, rr, gg, bb, aa);
410 for (i = 0; i < 6; i++) 394 for (i = 0; i < 6; i++)
411 { 395 {
412 PUSH_COLOR(rr, gg, bb, aa); 396 PUSH_COLOR(r, g, b, a);
413 } 397 }
414} 398}
415 399
@@ -421,7 +405,7 @@ evas_gl_common_context_font_push(Evas_GL_Context *gc,
421 int r, int g, int b, int a) 405 int r, int g, int b, int a)
422{ 406{
423 int pnum, nv, nc, nu, nt, i; 407 int pnum, nv, nc, nu, nt, i;
424 GLfloat rr, gg, bb, aa, tx1, tx2, ty1, ty2; 408 GLfloat tx1, tx2, ty1, ty2;
425 409
426 if ((gc->shader.cur_tex != tex->pt->texture) 410 if ((gc->shader.cur_tex != tex->pt->texture)
427 || (gc->shader.cur_prog != gc->shared->shader.font.prog) 411 || (gc->shader.cur_prog != gc->shared->shader.font.prog)
@@ -472,10 +456,9 @@ evas_gl_common_context_font_push(Evas_GL_Context *gc,
472 PUSH_TEXUV(tx2, ty2); 456 PUSH_TEXUV(tx2, ty2);
473 PUSH_TEXUV(tx1, ty2); 457 PUSH_TEXUV(tx1, ty2);
474 458
475 COLOR_FLOAT(r, g, b, a, rr, gg, bb, aa);
476 for (i = 0; i < 6; i++) 459 for (i = 0; i < 6; i++)
477 { 460 {
478 PUSH_COLOR(rr, gg, bb, aa); 461 PUSH_COLOR(r, g, b, a);
479 } 462 }
480} 463}
481 464
@@ -488,7 +471,7 @@ evas_gl_common_context_yuv_push(Evas_GL_Context *gc,
488 Eina_Bool smooth) 471 Eina_Bool smooth)
489{ 472{
490 int pnum, nv, nc, nu, nu2, nu3, nt, i; 473 int pnum, nv, nc, nu, nu2, nu3, nt, i;
491 GLfloat rr, gg, bb, aa, tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; 474 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
492 Eina_Bool blend = 0; 475 Eina_Bool blend = 0;
493 476
494 if (a < 255) blend = 1; 477 if (a < 255) blend = 1;
@@ -556,10 +539,9 @@ evas_gl_common_context_yuv_push(Evas_GL_Context *gc,
556 PUSH_TEXUV3(t2x2, t2y2); 539 PUSH_TEXUV3(t2x2, t2y2);
557 PUSH_TEXUV3(t2x1, t2y2); 540 PUSH_TEXUV3(t2x1, t2y2);
558 541
559 COLOR_FLOAT(r, g, b, a, rr, gg, bb, aa);
560 for (i = 0; i < 6; i++) 542 for (i = 0; i < 6; i++)
561 { 543 {
562 PUSH_COLOR(rr, gg, bb, aa); 544 PUSH_COLOR(r, g, b, a);
563 } 545 }
564} 546}
565 547
@@ -612,13 +594,11 @@ shader_array_flush(Evas_GL_Context *gc)
612 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 594 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
613 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 595 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
614 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 596 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
615// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
616// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
617 } 597 }
618 } 598 }
619 599
620 glVertexAttribPointer(SHAD_VERTEX, 3, GL_INT, GL_FALSE, 0, gc->array.vertex); 600 glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, gc->array.vertex);
621 glVertexAttribPointer(SHAD_COLOR, 4, GL_FLOAT, GL_FALSE, 0, gc->array.color); 601 glVertexAttribPointer(SHAD_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, gc->array.color);
622 glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->array.texuv); 602 glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->array.texuv);
623 if ((gc->array.texuv2) && (gc->array.texuv3)) 603 if ((gc->array.texuv2) && (gc->array.texuv3))
624 { 604 {
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
index 5427a999b6..e80d67cc35 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
@@ -1,5 +1,25 @@
1#include "evas_gl_private.h" 1#include "evas_gl_private.h"
2 2
3#if 1
4static const GLenum rgba_fmt = GL_RGBA;
5static const GLenum rgba_ifmt = GL_RGBA;
6//static const GLenum rgb_fmt = GL_RGBA;
7//static const GLenum rgb_ifmt = GL_RGBA;
8static const GLenum alpha_fmt = GL_ALPHA;
9static const GLenum alpha_ifmt = GL_ALPHA;
10static const GLenum lum_fmt = GL_LUMINANCE;
11static const GLenum lum_ifmt = GL_LUMINANCE;
12#else
13static const GLenum rgba_fmt = GL_RGBA;
14static const GLenum rgba_ifmt = GL_COMPRESSED_RGBA;
15//static const GLenum rgb_fmt = GL_RGBA;
16//static const GLenum rgb_ifmt = GL_COMPRESSED_RGBA;
17static const GLenum alpha_fmt = GL_ALPHA;
18static const GLenum alpha_ifmt = GL_COMPRESSED_ALPHA;
19static const GLenum lum_fmt = GL_LUMINANCE;
20static const GLenum lum_ifmt = GL_COMPRESSED_LUMINANCE;
21#endif
22
3static int 23static int
4_nearest_pow2(int num) 24_nearest_pow2(int num)
5{ 25{
@@ -37,12 +57,24 @@ _tex_format_index(GLuint format)
37 switch (format) 57 switch (format)
38 { 58 {
39 case GL_RGBA: 59 case GL_RGBA:
60#ifdef GL_COMPRESSED_RGBA
61 case GL_COMPRESSED_RGBA:
62#endif
40 return 0; 63 return 0;
41 case GL_RGB: 64 case GL_RGB:
65#ifdef GL_COMPRESSED_RGB
66 case GL_COMPRESSED_RGB:
67#endif
42 return 1; 68 return 1;
43 case GL_ALPHA: 69 case GL_ALPHA:
70#ifdef GL_COMPRESSED_ALPHA
71 case GL_COMPRESSED_ALPHA:
72#endif
44 return 2; 73 return 2;
45 case GL_LUMINANCE: 74 case GL_LUMINANCE:
75#ifdef GL_COMPRESSED_LUMINANCE
76 case GL_COMPRESSED_LUMINANCE:
77#endif
46 return 3; 78 return 3;
47 default: 79 default:
48 break; 80 break;
@@ -50,8 +82,33 @@ _tex_format_index(GLuint format)
50 return 0; 82 return 0;
51} 83}
52 84
85static void
86_tex_2d(GLint internalformat,
87 GLsizei width,
88 GLsizei height,
89 GLenum format,
90 GLenum type)
91{
92 glTexImage2D(GL_TEXTURE_2D, 0, internalformat,
93 width, height, 0, format, type, NULL);
94}
95
96static void
97_tex_sub_2d(GLint xoffset,
98 GLint yoffset,
99 GLsizei width,
100 GLsizei height,
101 GLenum format,
102 GLenum type,
103 const GLvoid *pixels)
104{
105 glTexSubImage2D(GL_TEXTURE_2D, 0,
106 xoffset, yoffset, width, height, format, type, pixels);
107}
108
53static Evas_GL_Texture_Pool * 109static Evas_GL_Texture_Pool *
54_pool_tex_new(Evas_GL_Context *gc, int w, int h, GLuint format) 110_pool_tex_new(Evas_GL_Context *gc, int w, int h,
111 GLenum intformat, GLenum format)
55{ 112{
56 Evas_GL_Texture_Pool *pt; 113 Evas_GL_Texture_Pool *pt;
57 114
@@ -62,7 +119,9 @@ _pool_tex_new(Evas_GL_Context *gc, int w, int h, GLuint format)
62 pt->gc = gc; 119 pt->gc = gc;
63 pt->w = w; 120 pt->w = w;
64 pt->h = h; 121 pt->h = h;
122 pt->intformat = intformat;
65 pt->format = format; 123 pt->format = format;
124 pt->dataformat = GL_UNSIGNED_BYTE;
66 pt->references = 0; 125 pt->references = 0;
67 glGenTextures(1, &(pt->texture)); 126 glGenTextures(1, &(pt->texture));
68 glBindTexture(GL_TEXTURE_2D, pt->texture); 127 glBindTexture(GL_TEXTURE_2D, pt->texture);
@@ -70,14 +129,13 @@ _pool_tex_new(Evas_GL_Context *gc, int w, int h, GLuint format)
70 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 129 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
71 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 130 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
72 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 131 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
73 glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, 132 _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
74 format, GL_UNSIGNED_BYTE/* fixme - pass this in */, NULL);
75 glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex); 133 glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
76 return pt; 134 return pt;
77} 135}
78 136
79static int 137static int
80_pool_tex_alloc(Evas_GL_Texture_Pool *pt, GLuint format, int w, int h, int *u, int *v, Eina_List **l_after) 138_pool_tex_alloc(Evas_GL_Texture_Pool *pt, int w, int h, int *u, int *v, Eina_List **l_after)
81{ 139{
82 Eina_List *l; 140 Eina_List *l;
83 Evas_GL_Texture *tex, *tex2; 141 Evas_GL_Texture *tex, *tex2;
@@ -122,7 +180,9 @@ _pool_tex_alloc(Evas_GL_Texture_Pool *pt, GLuint format, int w, int h, int *u, i
122} 180}
123 181
124static Evas_GL_Texture_Pool * 182static Evas_GL_Texture_Pool *
125_pool_tex_find(Evas_GL_Context *gc, int w, int h, GLuint format, int *u, int *v, Eina_List **l_after, int atlas_w) 183_pool_tex_find(Evas_GL_Context *gc, int w, int h,
184 GLuint intformat, GLuint format, int *u, int *v,
185 Eina_List **l_after, int atlas_w)
126{ 186{
127 Evas_GL_Texture_Pool *pt = NULL; 187 Evas_GL_Texture_Pool *pt = NULL;
128 Eina_List *l; 188 Eina_List *l;
@@ -130,7 +190,7 @@ _pool_tex_find(Evas_GL_Context *gc, int w, int h, GLuint format, int *u, int *v,
130 190
131 if ((w > 512) || (h > 512)) 191 if ((w > 512) || (h > 512))
132 { 192 {
133 pt = _pool_tex_new(gc, w, h, format); 193 pt = _pool_tex_new(gc, w, h, intformat, format);
134 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, pt); 194 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, pt);
135 pt->slot = -1; 195 pt->slot = -1;
136 pt->fslot = -1; 196 pt->fslot = -1;
@@ -145,7 +205,7 @@ _pool_tex_find(Evas_GL_Context *gc, int w, int h, GLuint format, int *u, int *v,
145 th2 = _tex_format_index(format); 205 th2 = _tex_format_index(format);
146 EINA_LIST_FOREACH(gc->shared->tex.atlas[th][th2], l, pt) 206 EINA_LIST_FOREACH(gc->shared->tex.atlas[th][th2], l, pt)
147 { 207 {
148 if (_pool_tex_alloc(pt, format, w, h, u, v, l_after)) 208 if (_pool_tex_alloc(pt, w, h, u, v, l_after))
149 { 209 {
150 gc->shared->tex.atlas[th][th2] = 210 gc->shared->tex.atlas[th][th2] =
151 eina_list_remove_list(gc->shared->tex.atlas[th][th2], l); 211 eina_list_remove_list(gc->shared->tex.atlas[th][th2], l);
@@ -154,7 +214,7 @@ _pool_tex_find(Evas_GL_Context *gc, int w, int h, GLuint format, int *u, int *v,
154 return pt; 214 return pt;
155 } 215 }
156 } 216 }
157 pt = _pool_tex_new(gc, atlas_w, h, format); 217 pt = _pool_tex_new(gc, atlas_w, h, intformat, format);
158 gc->shared->tex.atlas[th][th2] = 218 gc->shared->tex.atlas[th][th2] =
159 eina_list_prepend(gc->shared->tex.atlas[th][th2], pt); 219 eina_list_prepend(gc->shared->tex.atlas[th][th2], pt);
160 pt->slot = th; 220 pt->slot = th;
@@ -179,11 +239,11 @@ evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im)
179 tex->references = 1; 239 tex->references = 1;
180// if (im->cache_entry.flags.alpha) 240// if (im->cache_entry.flags.alpha)
181 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2, 241 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
182 im->cache_entry.h + 1, GL_RGBA, 242 im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
183 &u, &v, &l_after, 1024); 243 &u, &v, &l_after, 1024);
184// else 244// else
185// tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3, 245// tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
186// im->cache_entry.h + 1, GL_RGB, 246// im->cache_entry.h + 1, rgb_ifmt, rgb_fmt,
187// &u, &v, &l_after, 1024); 247// &u, &v, &l_after, 1024);
188 if (!tex->pt) 248 if (!tex->pt)
189 { 249 {
@@ -208,16 +268,6 @@ evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im)
208void 268void
209evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) 269evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
210{ 270{
211#if defined(GL_UNSIGNED_INT_8_8_8_8_REV) && defined(GL_BGRA)
212#define COLOR_FORMAT GL_RGBA
213#define PIXEL_FORMAT GL_UNSIGNED_BYTE
214// FIXME: need to change shader for this to work
215//#define COLOR_FORMAT GL_BGRA
216//#define PIXEL_FORMAT GL_UNSIGNED_INT_8_8_8_8_REV
217#else
218#define COLOR_FORMAT GL_RGBA
219#define PIXEL_FORMAT GL_UNSIGNED_BYTE
220#endif
221 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 271 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
222#ifdef GL_UNPACK_ROW_LENGTH 272#ifdef GL_UNPACK_ROW_LENGTH
223 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 273 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
@@ -226,55 +276,47 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
226 // +-+ 276 // +-+
227 // +-+ 277 // +-+
228 // 278 //
229 glTexSubImage2D(GL_TEXTURE_2D, 0, 279 _tex_sub_2d(tex->x, tex->y,
230 tex->x, tex->y, 280 im->cache_entry.w, im->cache_entry.h,
231 im->cache_entry.w, im->cache_entry.h, 281 tex->pt->format, tex->pt->dataformat,
232 COLOR_FORMAT, PIXEL_FORMAT, 282 im->image.data);
233 im->image.data);
234 // |xxx 283 // |xxx
235 // |xxx 284 // |xxx
236 // 285 //
237 glTexSubImage2D(GL_TEXTURE_2D, 0, 286 _tex_sub_2d(tex->x - 1, tex->y,
238 tex->x - 1, tex->y, 287 1, im->cache_entry.h,
239 1, im->cache_entry.h, 288 tex->pt->format, tex->pt->dataformat,
240 COLOR_FORMAT, PIXEL_FORMAT, 289 im->image.data);
241 im->image.data);
242 // xxx| 290 // xxx|
243 // xxx| 291 // xxx|
244 // 292 //
245 glTexSubImage2D(GL_TEXTURE_2D, 0, 293 _tex_sub_2d(tex->x + im->cache_entry.w, tex->y,
246 tex->x + im->cache_entry.w, tex->y, 294 1, im->cache_entry.h,
247 1, im->cache_entry.h, 295 tex->pt->format, tex->pt->dataformat,
248 COLOR_FORMAT, PIXEL_FORMAT, 296 im->image.data + (im->cache_entry.w - 1));
249 im->image.data + (im->cache_entry.w - 1));
250 // xxx 297 // xxx
251 // xxx 298 // xxx
252 // --- 299 // ---
253 glTexSubImage2D(GL_TEXTURE_2D, 0, 300 _tex_sub_2d(tex->x, tex->y + im->cache_entry.h,
254 tex->x, tex->y + im->cache_entry.h, 301 im->cache_entry.w, 1,
255 im->cache_entry.w, 1, 302 tex->pt->format, tex->pt->dataformat,
256 COLOR_FORMAT, PIXEL_FORMAT, 303 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w));
257 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w));
258 // xxx 304 // xxx
259 // xxx 305 // xxx
260 // o 306 // o
261 glTexSubImage2D(GL_TEXTURE_2D, 0, 307 _tex_sub_2d(tex->x - 1, tex->y + im->cache_entry.h,
262 tex->x - 1, tex->y + im->cache_entry.h, 308 1, 1,
263 1, 1, 309 tex->pt->format, tex->pt->dataformat,
264 COLOR_FORMAT, PIXEL_FORMAT, 310 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w));
265 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w));
266 // xxx 311 // xxx
267 // xxx 312 // xxx
268 // o 313 // o
269 glTexSubImage2D(GL_TEXTURE_2D, 0, 314 _tex_sub_2d(tex->x + im->cache_entry.w, tex->y + im->cache_entry.h,
270 tex->x + im->cache_entry.w, tex->y + im->cache_entry.h, 315 1, 1,
271 1, 1, 316 tex->pt->format, tex->pt->dataformat,
272 COLOR_FORMAT, PIXEL_FORMAT, 317 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w) + (im->cache_entry.w - 1));
273 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w) + (im->cache_entry.w - 1));
274 if (tex->pt->texture != tex->gc->shader.cur_tex) 318 if (tex->pt->texture != tex->gc->shader.cur_tex)
275 { 319 glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
276 glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
277 }
278} 320}
279 321
280static void 322static void
@@ -323,8 +365,7 @@ evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, int w, int
323 tex->references = 1; 365 tex->references = 1;
324 if (tw > gc->shared->info.max_texture_size) 366 if (tw > gc->shared->info.max_texture_size)
325 tw = gc->shared->info.max_texture_size; 367 tw = gc->shared->info.max_texture_size;
326 tex->pt = _pool_tex_find(gc, w + 3, fh, GL_ALPHA, 368 tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v, &l_after, tw);
327 &u, &v, &l_after, tw);
328 if (!tex->pt) 369 if (!tex->pt)
329 { 370 {
330 free(tex); 371 free(tex);
@@ -351,10 +392,7 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, int w,
351 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 392 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
352#endif 393#endif
353 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 394 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
354 glTexSubImage2D(GL_TEXTURE_2D, 0, 395 _tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat, pixels);
355 tex->x, tex->y, w, h,
356 GL_ALPHA, GL_UNSIGNED_BYTE,
357 pixels);
358 if (tex->pt->texture != tex->gc->shader.cur_tex) 396 if (tex->pt->texture != tex->gc->shader.cur_tex)
359 glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex); 397 glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
360} 398}
@@ -371,17 +409,17 @@ evas_gl_common_texture_yuv_new(Evas_GL_Context *gc, DATA8 **rows, int w, int h)
371 409
372 tex->gc = gc; 410 tex->gc = gc;
373 tex->references = 1; 411 tex->references = 1;
374 tex->pt = _pool_tex_new(gc, w + 1, h + 1, GL_LUMINANCE); 412 tex->pt = _pool_tex_new(gc, w + 1, h + 1, lum_ifmt, lum_fmt);
375 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->pt); 413 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->pt);
376 tex->pt->slot = -1; 414 tex->pt->slot = -1;
377 tex->pt->fslot = -1; 415 tex->pt->fslot = -1;
378 tex->pt->whole = 1; 416 tex->pt->whole = 1;
379 tex->ptu = _pool_tex_new(gc, (w / 2) + 1, (h / 2) + 1, GL_LUMINANCE); 417 tex->ptu = _pool_tex_new(gc, (w / 2) + 1, (h / 2) + 1, lum_ifmt, lum_fmt);
380 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->ptu); 418 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->ptu);
381 tex->ptu->slot = -1; 419 tex->ptu->slot = -1;
382 tex->ptu->fslot = -1; 420 tex->ptu->fslot = -1;
383 tex->ptu->whole = 1; 421 tex->ptu->whole = 1;
384 tex->ptv = _pool_tex_new(gc, (w / 2) + 1, (h / 2) + 1, GL_LUMINANCE); 422 tex->ptv = _pool_tex_new(gc, (w / 2) + 1, (h / 2) + 1, lum_ifmt, lum_fmt);
385 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->ptv); 423 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->ptv);
386 tex->ptv->slot = -1; 424 tex->ptv->slot = -1;
387 tex->ptv->fslot = -1; 425 tex->ptv->fslot = -1;
@@ -403,82 +441,49 @@ evas_gl_common_texture_yuv_new(Evas_GL_Context *gc, DATA8 **rows, int w, int h)
403void 441void
404evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, int w, int h) 442evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, int w, int h)
405{ 443{
444 int y;
445
406 // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2 446 // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
407#ifdef GL_UNPACK_ROW_LENGTH 447#ifdef GL_UNPACK_ROW_LENGTH
408 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]); 448 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
409 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 449 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
410 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 450 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
411 glTexSubImage2D(GL_TEXTURE_2D, 0, 451 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
412 0, 0, w, h,
413 GL_LUMINANCE, GL_UNSIGNED_BYTE,
414 rows[0]);
415 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture); 452 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
416 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]); 453 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
417 glTexSubImage2D(GL_TEXTURE_2D, 0, 454 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
418 0, 0, w / 2, h / 2,
419 GL_LUMINANCE, GL_UNSIGNED_BYTE,
420 rows[h]);
421 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture); 455 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
422 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]); 456 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
423 glTexSubImage2D(GL_TEXTURE_2D, 0, 457 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
424 0, 0, w / 2, h / 2,
425 GL_LUMINANCE, GL_UNSIGNED_BYTE,
426 rows[h + (h / 2)]);
427#else 458#else
428 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 459 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
429 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 460 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
430 if ((rows[1] - rows[0]) == w) 461 if ((rows[1] - rows[0]) == w)
431 glTexSubImage2D(GL_TEXTURE_2D, 0, 462 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
432 0, 0, w, h,
433 GL_LUMINANCE, GL_UNSIGNED_BYTE,
434 rows[0]);
435 else 463 else
436 { 464 {
437 int y;
438
439 for (y = 0; y < h; y++) 465 for (y = 0; y < h; y++)
440 glTexSubImage2D(GL_TEXTURE_2D, 0, 466 _tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
441 0, y, w, 1,
442 GL_LUMINANCE, GL_UNSIGNED_BYTE,
443 rows[y]);
444 } 467 }
445 468
446 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture); 469 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
447 if ((rows[h + 1] - rows[h]) == (w / 2)) 470 if ((rows[h + 1] - rows[h]) == (w / 2))
448 glTexSubImage2D(GL_TEXTURE_2D, 0, 471 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
449 0, 0, w / 2, h / 2,
450 GL_LUMINANCE, GL_UNSIGNED_BYTE,
451 rows[h]);
452 else 472 else
453 { 473 {
454 int y;
455
456 for (y = 0; y < (h / 2); y++) 474 for (y = 0; y < (h / 2); y++)
457 glTexSubImage2D(GL_TEXTURE_2D, 0, 475 _tex_sub_2d(0, y, w / 2, 1, tex->ptu->format, tex->ptu->dataformat, rows[h + y]);
458 0, y, w / 2, 1,
459 GL_LUMINANCE, GL_UNSIGNED_BYTE,
460 rows[h + y]);
461 } 476 }
462 477
463 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture); 478 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
464 if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (w / 2)) 479 if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (w / 2))
465 glTexSubImage2D(GL_TEXTURE_2D, 0, 480 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
466 0, 0, w / 2, h / 2,
467 GL_LUMINANCE, GL_UNSIGNED_BYTE,
468 rows[h + (h / 2)]);
469 else 481 else
470 { 482 {
471 int y;
472
473 for (y = 0; y < (h / 2); y++) 483 for (y = 0; y < (h / 2); y++)
474 glTexSubImage2D(GL_TEXTURE_2D, 0, 484 _tex_sub_2d(0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
475 0, y, w / 2, 1,
476 GL_LUMINANCE, GL_UNSIGNED_BYTE,
477 rows[h + (h / 2) + y]);
478 } 485 }
479#endif 486#endif
480 if (tex->pt->texture != tex->gc->shader.cur_tex) 487 if (tex->pt->texture != tex->gc->shader.cur_tex)
481 { 488 glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
482 glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
483 }
484} 489}
diff --git a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.h b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.h
index f14c7ab77d..af1aa48ac0 100644
--- a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.h
+++ b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.h
@@ -8,15 +8,12 @@
8"varying vec2 tex_c3;\n" 8"varying vec2 tex_c3;\n"
9"void main()\n" 9"void main()\n"
10"{\n" 10"{\n"
11" float r, g, b, y, u, v;\n" 11" mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,\n"
12" y = texture2D(tex, tex_c.xy).r;\n" 12" 0.00000, -0.34410, 1.77200, 0.00000,\n"
13" u = texture2D(texu, tex_c2.xy).r;\n" 13" 1.40200, -0.71410, 0.00000, 0.00000,\n"
14" v = texture2D(texv, tex_c3.xy).r;\n" 14" -0.77380, 0.45630, -0.95880, 1.00000);\n"
15" y = (y - 0.0625) * 1.164;\n" 15" vec4 yuv = vec4(texture2D(tex, tex_c.xy).r,\n"
16" u = u - 0.5;\n" 16" texture2D(texu, tex_c2.xy).r,\n"
17" v = v - 0.5;\n" 17" texture2D(texv, tex_c3.xy).r, 1.0);\n"
18" r = y + (1.402 * v);\n" 18" gl_FragColor = (yuv2rgb * yuv) * col;\n"
19" g = y - (0.34414 * u) - (0.71414 * v);\n"
20" b = y + (1.772 * u);\n"
21" gl_FragColor = vec4(r, g, b, 1.0) * col;\n"
22"}\n" 19"}\n"
diff --git a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.shd b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.shd
index 95bbd829f4..7da25468a7 100644
--- a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.shd
+++ b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag.shd
@@ -8,15 +8,12 @@ varying vec2 tex_c2;
8varying vec2 tex_c3; 8varying vec2 tex_c3;
9void main() 9void main()
10{ 10{
11 float r, g, b, y, u, v; 11 mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,
12 y = texture2D(tex, tex_c.xy).r; 12 0.00000, -0.34410, 1.77200, 0.00000,
13 u = texture2D(texu, tex_c2.xy).r; 13 1.40200, -0.71410, 0.00000, 0.00000,
14 v = texture2D(texv, tex_c3.xy).r; 14 -0.77380, 0.45630, -0.95880, 1.00000);
15 y = (y - 0.0625) * 1.164; 15 vec4 yuv = vec4(texture2D(tex, tex_c.xy).r,
16 u = u - 0.5; 16 texture2D(texu, tex_c2.xy).r,
17 v = v - 0.5; 17 texture2D(texv, tex_c3.xy).r, 1.0);
18 r = y + (1.402 * v); 18 gl_FragColor = (yuv2rgb * yuv) * col;
19 g = y - (0.34414 * u) - (0.71414 * v);
20 b = y + (1.772 * u);
21 gl_FragColor = vec4(r, g, b, 1.0) * col;
22} 19}
diff --git a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h
index db8d76a376..cd301dc96d 100644
--- a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h
+++ b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h
@@ -1,31 +1,24 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000014, 0x0000000a, 10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x0000000d, 0x00000007,
20x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000003, 20x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000003,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000026, 0x00000000, 30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000026, 0x00000000,
40x00000000, 0x02025400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407, 40x00000000, 0x02065400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307820e4, 0x00000000, 0x01000000, 0x02025400, 0x23782150, 0x00000000, 50x307820e4, 0x00000000, 0x01000000, 0x02065400, 0x23782150, 0x00000000,
60x01000000, 0x0101e407, 0x307821e4, 0x00000000, 0x02000000, 0x02025400, 60x01000000, 0x0101e407, 0x307821e4, 0x00000000, 0x02000000, 0x02065400,
70x23782250, 0x00000000, 0x02000000, 0x0102e407, 0x307822e4, 0x00000000, 70x23782250, 0x00000000, 0x02000000, 0x0102e407, 0x307822e4, 0x00000000,
80x03000000, 0x01000042, 0x22082300, 0x00000000, 0x04000000, 0x01030002, 80x00000000, 0x02020001, 0x237823e4, 0x00000000, 0x01e40103, 0x02030001,
90x23082300, 0x00000000, 0x05000000, 0x01010042, 0x22102300, 0x00000000, 90x2ef823e4, 0x00000000, 0x02e40103, 0x02040001, 0x2ef823e4, 0x00000000,
100x05000000, 0x01020042, 0x22202300, 0x00000000, 0x03000103, 0x0206aa01, 100x00000000, 0x02050000, 0x20f824e4, 0x00000000, 0x06e40103, 0x01040002,
110x2ec02300, 0x00000000, 0x03000103, 0x42075501, 0x2e882400, 0x00000000, 110x2ef823e4, 0x00000000, 0x03000000, 0x0103e400, 0x237a10e4, 0x00000000,
120x03000104, 0x4208aa01, 0x2e882400, 0x00000000, 0x03000103, 0x02095501, 120x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
130x2e882300, 0x00000000, 0x00000000, 0x01030000, 0x208825ff, 0x00000000, 130x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
140x00000000, 0x01040000, 0x20902500, 0x00000000, 0x00000000, 0x01030000, 140x3f94fdf4, 0x3f94fdf4, 0x3f94fdf4, 0x00000000, 0x00000000, 0xbeb02de0,
150x20a02500, 0x00000000, 0x00000000, 0x02020000, 0x20c02500, 0x00000000, 150x3fe2d0e5, 0x00000000, 0x3fb374bc, 0xbf36cf42, 0x00000000, 0x00000000,
160x03000000, 0x0105e400, 0x237a10e4, 0x00000000, 0x00000000, 0x00000000, 160xbf4617c2, 0x3ee9a027, 0xbf7573eb, 0x3f800000, 0x3f800000, 0x00000000,
170x1e000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 170x00000000, 0x00000000, 0x0000000e, 0x00000003, 0x00000009, 0x00000000,
180x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000000, 180x0000000c, 0x00000012, 0x00000005, 0x00000003, 0x00000000, 0x00000000,
190x00000000, 0x00000000, 0x3d800000, 0x00000000, 0x00000000, 0x00000000, 190x00000018, 0x00000006, 0x00000003, 0x00000000, 0x00000004, 0x0000001f,
200x3f94fdf4, 0x00000000, 0x00000000, 0x00000000, 0x3f000000, 0x00000000, 200x00000006, 0x00000003, 0x00000000, 0x00000008, 0x00000000, 0x00000003,
210x00000000, 0x00000000, 0x3fb374bc, 0x00000000, 0x00000000, 0x00000000, 210x0000000f, 0x00030005, 0x00000000, 0x00000004, 0x00000004, 0x0000000f,
220x3eb0331e, 0x00000000, 0x00000000, 0x00000000, 0x3f36d1e1, 0x00000000, 220x00030005, 0x00000004, 0x00000009, 0x00000004, 0x0000000f, 0x00030005,
230x00000000, 0x00000000, 0x3fe2d0e5, 0x00000000, 0x00000000, 0x00000000, 230x00000008, 0x00786574, 0x75786574, 0x78657400, 0x6f630076, 0x6574006c,
240x0000000e, 0x00000003, 0x00000009, 0x00000000, 0x0000000c, 0x00000012, 240x00635f78, 0x5f786574, 0x74003263, 0x635f7865, 0x00000033,
250x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000018, 0x00000006,
260x00000003, 0x00000000, 0x00000004, 0x0000001f, 0x00000006, 0x00000003,
270x00000000, 0x00000008, 0x00000000, 0x00000003, 0x0000000f, 0x00030005,
280x00000000, 0x00000004, 0x00000004, 0x0000000f, 0x00030005, 0x00000004,
290x00000009, 0x00000004, 0x0000000f, 0x00030005, 0x00000008, 0x00786574,
300x75786574, 0x78657400, 0x6f630076, 0x6574006c, 0x00635f78, 0x5f786574,
310x74003263, 0x635f7865, 0x00000033, \ No newline at end of file
diff --git a/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm
new file mode 100644
index 0000000000..9a10bf07de
--- /dev/null
+++ b/legacy/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm
@@ -0,0 +1,46 @@
1
2#-------------------------------------------------
3# ORION - OpenGL ES 2.0 Shading Language Compiler
4# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
5# Compiler Version : v04.00.09
6# Release Date : 19.01.2009
7# FIMG VERSION : FIMGv1.5
8# Optimizer Options : -O --nolodcalc
9#-------------------------------------------------
10
11# hand optimised - removed useless ops
12
13ps_3_0
14
15fimg_version 0x01020000
16
17dcl_s2_tex s0
18dcl_s2_texu s1
19dcl_s2_texv s2
20dcl_f4_col v3.x
21dcl_f2_tex_c v0.x
22dcl_f2_tex_c2 v1.x
23dcl_f2_tex_c3 v2.x
24
25def c2, 1.164000, 1.164000, 1.164000, 0.000000
26def c3, 0.000000, -0.344100, 1.772000, 0.000000
27def c4, 1.402000, -0.714100, 0.000000, 0.000000
28def c5, -0.773800, 0.456300, -0.958800, 1.000000
29def c6, 1.000000, 0.000000, 0.000000, 0.000000
30
31label start
32label main_
33mul r0.xyzw, c6.xxyy, v0.xyyy # tex_c=v0.xyyy
34texld r0.xyzw, r0.xyzw, s0 # tex=s0
35mul r1.xyzw, c6.xxyy, v1.xyyy # tex_c2=v1.xyyy
36texld r1.xyzw, r1.xyzw, s1 # texu=s1
37mul r2.xyzw, c6.xxyy, v2.xyyy # tex_c3=v2.xyyy
38texld r2.xyzw, r2.xyzw, s2 # texv=s2
39mul r3.xyzw, c2.xyzw, r0.xxxx # yuv=r0.xxxx
40mad r3.xyzw, c3.xyzw, r1.xxxx, r3.xyzw # yuv=r1.xxxx
41mad r3.xyzw, c4.xyzw, r2.xxxx, r3.xyzw # yuv=r2.xxxx
42mov r4.xyzw, c5.xyzw
43mad r3.xyzw, r4.xyzw, c6.xxxx, r3.xyzw # yuv=c6.xxxx
44mul_sat oColor.xyzw, r3.xyzw, v3.xyzw # gl_FragColor=oColor.xyzw, col=v3.xyzw
45label main_end
46ret
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
index eb1f4365b7..b6e4c173f1 100644
--- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
+++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
@@ -1028,6 +1028,25 @@ eng_image_scale_hint_set(void *data __UNUSED__, void *image, int hint)
1028{ 1028{
1029} 1029}
1030 1030
1031static void
1032eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
1033{
1034 // XXX
1035}
1036
1037static void *
1038eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
1039{
1040 // XXX
1041 return NULL;
1042}
1043
1044static void
1045eng_image_map_surface_free(void *data __UNUSED__, void *surface)
1046{
1047 // XXX
1048}
1049
1031static int 1050static int
1032eng_image_scale_hint_get(void *data __UNUSED__, void *image) 1051eng_image_scale_hint_get(void *data __UNUSED__, void *image)
1033{ 1052{
@@ -1175,9 +1194,9 @@ module_open(Evas_Module *em)
1175 ORD(image_scale_hint_set); 1194 ORD(image_scale_hint_set);
1176 ORD(image_scale_hint_get); 1195 ORD(image_scale_hint_get);
1177 1196
1178 //ODR(image_map4_draw); 1197 ORD(image_map4_draw);
1179 //ODR(image_map_surface_new); 1198 ORD(image_map_surface_new);
1180 //ODR(image_map_surface_free); 1199 ORD(image_map_surface_free);
1181 1200
1182 /* now advertise out own api */ 1201 /* now advertise out own api */
1183 em->functions = (void *)(&func); 1202 em->functions = (void *)(&func);