shader/yuv_frag_bin_s3c6410.h \
shader/yuv_vert.h \
shader/yuv_vert_bin_s3c6410.h \
+shader/tex_frag.h \
+shader/tex_frag_bin_s3c6410.h \
+shader/tex_vert.h \
+shader/tex_vert_bin_s3c6410.h \
evas_gl_rectangle.c \
evas_gl_texture.c \
evas_gl_image.c \
shader/font_vert.shd \
shader/yuv_frag.shd \
shader/yuv_frag_s3c6410.asm \
-shader/yuv_vert.shd
+shader/yuv_vert.shd \
+shader/tex_frag.shd \
+shader/tex_frag_s3c6410.asm \
+shader/tex_vert.shd
} tex;
struct {
- Evas_GL_Program rect, img, font, yuv;
+ Evas_GL_Program rect, img, font, yuv, tex;
} shader;
int references;
int w, h;
Eina_Bool active : 1;
} clip;
struct {
+ Evas_GL_Image *surface;
GLuint cur_prog;
GLuint cur_tex, cur_texu, cur_texv;
+ int render_op;
Eina_Bool smooth : 1;
Eina_Bool blend : 1;
struct {
GLuint cur_prog;
GLuint cur_tex, cur_texum, cur_texv;
+ int render_op;
Eina_Bool smooth : 1;
Eina_Bool blend : 1;
} current;
struct {
Eina_Bool size : 1;
} change;
+
+ Evas_GL_Image *def_surface;
};
struct _Evas_GL_Texture_Pool
{
Evas_GL_Context *gc;
- GLuint texture;
+ GLuint texture, fb;
GLuint intformat, format, dataformat;
int w, h;
int references;
Evas_GL_Texture *tex;
RGBA_Image_Loadopts load_opts;
int references;
+ // if im->im == NULL, it's a render-surface so these here are used
+ int w, h;
struct {
int space;
void *data;
} cs;
unsigned char dirty : 1;
unsigned char cached : 1;
+ unsigned char alpha : 1;
+ unsigned char tex_only : 1;
};
struct _Evas_GL_Font_Texture
extern Evas_GL_Program_Source shader_font_vert_src;
extern Evas_GL_Program_Source shader_yuv_frag_src;
extern Evas_GL_Program_Source shader_yuv_vert_src;
+extern Evas_GL_Program_Source shader_tex_frag_src;
+extern Evas_GL_Program_Source shader_tex_vert_src;
void glerr(const char *file, const char *func, int line, const char *op);
void evas_gl_common_context_free(Evas_GL_Context *gc);
void evas_gl_common_context_use(Evas_GL_Context *gc);
void evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h);
-
+void evas_gl_common_context_target_surface_set(Evas_GL_Context *gc, Evas_GL_Image *surface);
+
void evas_gl_common_context_rectangle_push(Evas_GL_Context *gc,
int x, int y, int w, int h,
int r, int g, int b, int a);
RGBA_Map_Point *p,
int clip, int cx, int cy, int cw, int ch,
int r, int g, int b, int a,
- Eina_Bool smooth);
+ Eina_Bool smooth,
+ Eina_Bool tex_only);
void evas_gl_common_context_flush(Evas_GL_Context *gc);
void evas_gl_common_shader_program_init(Evas_GL_Program *p,
void evas_gl_common_rect_draw(Evas_GL_Context *gc, int x, int y, int w, int h);
Evas_GL_Texture *evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im);
+Evas_GL_Texture *evas_gl_common_texture_render_new(Evas_GL_Context *gc, int w, int h, int alpha);
void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im);
void evas_gl_common_texture_free(Evas_GL_Texture *tex);
Evas_GL_Texture *evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, int w, int h, int fh);
Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, int w, int h, DATA32 *data, int alpha, int cspace);
Evas_GL_Image *evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h, int alpha, int cspace);
void evas_gl_common_image_free(Evas_GL_Image *im);
+Evas_GL_Image *evas_gl_common_image_surface_new(Evas_GL_Context *gc, int w, int h, int alpha);
void evas_gl_common_image_dirty(Evas_GL_Image *im);
void evas_gl_common_image_map4_draw(Evas_GL_Context *gc, Evas_GL_Image *im, RGBA_Map_Point *p, int smooth, int level);
void evas_gl_common_image_draw(Evas_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);
}
static void
-matrix_ortho(GLfloat *m, GLfloat l, GLfloat r, GLfloat t, GLfloat b, GLfloat near, GLfloat far)
+matrix_ortho(GLfloat *m,
+ GLfloat l, GLfloat r,
+ GLfloat t, GLfloat b,
+ GLfloat near, GLfloat far)
{
m[0] = 2.0 / (r - l);
m[1] = m[2] = m[3] = 0.0;
_evas_gl_common_viewport_set(Evas_GL_Context *gc)
{
GLfloat proj[16];
+ int w = 1, h = 1, m = 1;
+ if ((gc->shader.surface == gc->def_surface) ||
+ (!gc->shader.surface))
+ {
+ w = gc->w;
+ h = gc->h;
+ }
+ else
+ {
+ w = gc->shader.surface->w;
+ h = gc->shader.surface->h;
+ m = -1;
+ }
+
if ((!gc->change.size) ||
- ((gc->shared->w == gc->w) && (gc->shared->h == gc->h)))
+ ((gc->shared->w == w) && (gc->shared->h == gc->h)))
return;
- gc->shared->w = gc->w;
- gc->shared->h = gc->h;
+ gc->shared->w = w;
+ gc->shared->h = h;
gc->change.size = 0;
- glViewport(0, 0, gc->w, gc->h);
+ glViewport(0, 0, w, h);
matrix_ident(proj);
- matrix_ortho(proj, 0, gc->w, 0, gc->h, -1.0, 1.0);
+ if (m == 1)
+ matrix_ortho(proj, 0, w, 0, h, -1.0, 1.0);
+ else
+ matrix_ortho(proj, 0, w, h, 0, -1.0, 1.0);
glUseProgram(gc->shared->shader.rect.prog);
glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.rect.prog, "mvp"), 1,
glUseProgram(gc->shared->shader.yuv.prog);
glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.yuv.prog, "mvp"), 1,
GL_FALSE, proj);
+ glUseProgram(gc->shared->shader.tex.prog);
+ glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.tex.prog, "mvp"), 1,
+ GL_FALSE, proj);
}
Evas_GL_Context *
glEnable(GL_DITHER);
glDisable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ // no dest alpha
+// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
+// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
glDepthMask(GL_FALSE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
&(shader_yuv_vert_src),
&(shader_yuv_frag_src),
"yuv");
+ evas_gl_common_shader_program_init(&(shared->shader.tex),
+ &(shader_tex_vert_src),
+ &(shader_tex_frag_src),
+ "tex");
glUseProgram(shared->shader.yuv.prog);
glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "tex"), 0);
glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texu"), 1);
gc->shared->references++;
_evas_gl_common_viewport_set(gc);
+ gc->def_surface = evas_gl_common_image_surface_new(gc, 1, 1, 1);
+
return gc;
}
for (j = 0; j < 3; j++)
{
while (gc->shared->tex.atlas[i][j])
- evas_gl_common_texture_free(gc->shared->tex.atlas[i][j]);
+ evas_gl_common_texture_free
+ ((Evas_GL_Texture *)gc->shared->tex.atlas[i][j]);
}
}
free(gc->shared);
shared = NULL;
}
+ evas_gl_common_image_free(gc->def_surface);
+
free(gc->array.vertex);
free(gc->array.color);
free(gc->array.texuv);
if (_evas_gl_common_context == gc) _evas_gl_common_viewport_set(gc);
}
+void
+evas_gl_common_context_target_surface_set(Evas_GL_Context *gc,
+ Evas_GL_Image *surface)
+{
+ if (surface == gc->shader.surface) return;
+
+ evas_gl_common_context_flush(gc);
+
+ gc->shader.surface = surface;
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ // FIXME: XXX render-to-texture for gles2
+#else
+ // FIXME: viewport goopies
+ gc->change.size = 1;
+ if (gc->shader.surface == gc->def_surface)
+ {
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
+ }
+ else
+ {
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, surface->tex->pt->fb);
+ }
+ _evas_gl_common_viewport_set(gc);
+#endif
+}
+
#define PUSH_VERTEX(x, y, z) \
gc->array.vertex[nv++] = x; \
gc->array.vertex[nv++] = y; \
Eina_Bool blend = 0;
if (a < 255) blend = 1;
+ if (gc->dc->render_op == EVAS_RENDER_COPY) blend = 0;
if ((gc->shader.cur_tex != 0)
|| (gc->shader.cur_prog != gc->shared->shader.rect.prog)
|| (gc->shader.blend != blend)
+ || (gc->shader.render_op != gc->dc->render_op)
)
{
shader_array_flush(gc);
gc->shader.cur_tex = 0;
gc->shader.cur_prog = gc->shared->shader.rect.prog;
gc->shader.blend = blend;
+ gc->shader.render_op = gc->dc->render_op;
}
pnum = gc->array.num;
|| (gc->shader.cur_prog != gc->shared->shader.img.prog)
|| (gc->shader.smooth != smooth)
|| (gc->shader.blend != blend)
+ || (gc->shader.render_op != gc->dc->render_op)
)
{
shader_array_flush(gc);
gc->shader.cur_prog = gc->shared->shader.img.prog;
gc->shader.smooth = smooth;
gc->shader.blend = blend;
+ gc->shader.render_op = gc->dc->render_op;
}
pnum = gc->array.num;
|| (gc->shader.cur_prog != gc->shared->shader.font.prog)
|| (gc->shader.smooth != 0)
|| (gc->shader.blend != 1)
+ || (gc->shader.render_op != gc->dc->render_op)
)
{
shader_array_flush(gc);
gc->shader.cur_prog = gc->shared->shader.font.prog;
gc->shader.smooth = 0;
gc->shader.blend = 1;
+ gc->shader.render_op = gc->dc->render_op;
}
pnum = gc->array.num;
|| (gc->shader.cur_prog != gc->shared->shader.yuv.prog)
|| (gc->shader.smooth != smooth)
|| (gc->shader.blend != blend)
+ || (gc->shader.render_op != gc->dc->render_op)
)
{
shader_array_flush(gc);
gc->shader.cur_prog = gc->shared->shader.yuv.prog;
gc->shader.smooth = smooth;
gc->shader.blend = blend;
+ gc->shader.render_op = gc->dc->render_op;
}
pnum = gc->array.num;
RGBA_Map_Point *p,
int clip, int cx, int cy, int cw, int ch,
int r, int g, int b, int a,
- Eina_Bool smooth)
+ Eina_Bool smooth, Eina_Bool tex_only)
{
int pnum, nv, nc, nu, nt, i;
const int points[6] = { 0, 1, 2, 0, 2, 3 };
// if (a < 255) blend = 1;
if ((gc->shader.cur_tex != tex->pt->texture)
- || (gc->shader.cur_prog != gc->shared->shader.img.prog)
+ || ((tex_only) && (gc->shader.cur_prog != gc->shared->shader.tex.prog))
+ || ((!tex_only) && (gc->shader.cur_prog != gc->shared->shader.img.prog))
|| (gc->shader.smooth != smooth)
|| (gc->shader.blend != blend)
+ || (gc->shader.render_op != gc->dc->render_op)
)
{
shader_array_flush(gc);
gc->shader.cur_tex = tex->pt->texture;
- gc->shader.cur_prog = gc->shared->shader.img.prog;
+ if (tex_only)
+ gc->shader.cur_prog = gc->shared->shader.tex.prog;
+ else
+ gc->shader.cur_prog =gc->shared->shader.img.prog;
gc->shader.smooth = smooth;
gc->shader.blend = blend;
+ gc->shader.render_op = gc->dc->render_op;
}
pnum = gc->array.num;
else
glDisable(GL_BLEND);
}
+ if (gc->shader.render_op != gc->shader.current.render_op)
+ {
+ switch (gc->shader.render_op)
+ {
+ case EVAS_RENDER_BLEND: /**< default op: d = d*(1-sa) + s */
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ break;
+ case EVAS_RENDER_COPY: /**< d = s */
+ glDisable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE);
+ break;
+ // FIXME: fix blend funcs below!
+ case EVAS_RENDER_BLEND_REL: /**< d = d*(1 - sa) + s*da */
+ case EVAS_RENDER_COPY_REL: /**< d = s*da */
+ case EVAS_RENDER_ADD: /**< d = d + s */
+ case EVAS_RENDER_ADD_REL: /**< d = d + s*da */
+ case EVAS_RENDER_SUB: /**< d = d - s */
+ case EVAS_RENDER_SUB_REL: /**< d = d - s*da */
+ case EVAS_RENDER_TINT: /**< d = d*s + d*(1 - sa) + s*(1 - da) */
+ case EVAS_RENDER_TINT_REL: /**< d = d*(1 - sa + s) */
+ case EVAS_RENDER_MASK: /**< d = d*sa */
+ case EVAS_RENDER_MUL: /**< d = d*s */
+ default:
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ break;
+ }
+ }
if (gc->shader.smooth != gc->shader.current.smooth)
{
if (gc->shader.smooth)
gc->shader.current.cur_tex = gc->shader.cur_tex;
gc->shader.current.blend = gc->shader.blend;
gc->shader.current.smooth = gc->shader.smooth;
+ gc->shader.current.render_op = gc->shader.render_op;
free(gc->array.vertex);
free(gc->array.color);
im->references = 1;
im->cached = 1;
im->cs.space = EVAS_COLORSPACE_ARGB8888;
+ im->alpha = im->im->cache_entry.flags.alpha;
+ im->w = im->im->cache_entry.w;
+ im->h = im->im->cache_entry.h;
if (lo) im->load_opts = *lo;
gc->shared->images = eina_list_prepend(gc->shared->images, im);
return im;
}
im->gc = gc;
im->cs.space = cspace;
+ im->alpha = im->im->cache_entry.flags.alpha;
+ im->w = im->im->cache_entry.w;
+ im->h = im->im->cache_entry.h;
switch (cspace)
{
case EVAS_COLORSPACE_ARGB8888:
}
im->gc = gc;
im->cs.space = cspace;
+ im->alpha = im->im->cache_entry.flags.alpha;
+ im->w = im->im->cache_entry.w;
+ im->h = im->im->cache_entry.h;
switch (cspace)
{
case EVAS_COLORSPACE_ARGB8888:
return NULL;
}
im->gc = gc;
- im->cs.space = cspace;
im->im->cache_entry.flags.alpha = alpha ? 1 : 0;
+ im->cs.space = cspace;
+ im->alpha = im->im->cache_entry.flags.alpha;
+ im->w = im->im->cache_entry.w;
+ im->h = im->im->cache_entry.h;
evas_cache_image_colorspace(&im->im->cache_entry, cspace);
im->im = (RGBA_Image *) evas_cache_image_size_set(&im->im->cache_entry, w, h);
switch (cspace)
free(im);
}
+Evas_GL_Image *
+evas_gl_common_image_surface_new(Evas_GL_Context *gc, int w, int h, int alpha)
+{
+ Evas_GL_Image *im;
+
+ im = calloc(1, sizeof(Evas_GL_Image));
+ if (!im) return NULL;
+ im->references = 1;
+ im->gc = gc;
+ im->cs.space = EVAS_COLORSPACE_ARGB8888;
+ im->alpha = alpha;
+ im->w = w;
+ im->h = h;
+ im->tex = evas_gl_common_texture_render_new(gc, w, h, alpha);
+ im->tex_only = 1;
+ return im;
+}
+
void
evas_gl_common_image_dirty(Evas_GL_Image *im)
{
- im->im = (RGBA_Image *) evas_cache_image_dirty(&im->im->cache_entry, 0, 0, im->im->cache_entry.w, im->im->cache_entry.h);
+ if (im->im)
+ {
+ im->im = (RGBA_Image *) evas_cache_image_dirty(&im->im->cache_entry, 0, 0, im->im->cache_entry.w, im->im->cache_entry.h);
+ }
im->dirty = 1;
}
static void
-image_update(Evas_GL_Context *gc, Evas_GL_Image *im)
+_evas_gl_common_image_update(Evas_GL_Context *gc, Evas_GL_Image *im)
{
+ if (!im->im) return;
/*
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
r = g = b = a = 255;
}
- image_update(gc, im);
+ _evas_gl_common_image_update(gc, im);
+
+ glFlush();
c = gc->dc->clip.use;
cx = gc->dc->clip.x; cy = gc->dc->clip.y;
cw = gc->dc->clip.w; ch = gc->dc->clip.h;
evas_gl_common_context_image_map4_push(gc, im->tex, p,
c, cx, cy, cw, ch,
- r, g, b, a, smooth);
+ r, g, b, a, smooth, im->tex_only);
}
void
r = g = b = a = 255;
}
- image_update(gc, im);
-
+ _evas_gl_common_image_update(gc, im);
+
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
yuv = 1;
c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
ca = (gc->dc->col.col >> 24) & 0xff;
- if (ca <= 0) return;
+// if (ca <= 0) return;
cr = (gc->dc->col.col >> 16) & 0xff;
cg = (gc->dc->col.col >> 8 ) & 0xff;
cb = (gc->dc->col.col ) & 0xff;
#endif
};
+/////////////////////////////////////////////
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int tex_frag_bin[] =
+{
+# include "shader/tex_frag_bin_s3c6410.h"
+};
+#endif
+
+const char tex_frag_glsl[] =
+#include "shader/tex_frag.h"
+ ;
+Evas_GL_Program_Source shader_tex_frag_src =
+{
+ tex_frag_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ tex_frag_bin, sizeof(tex_frag_bin)
+#else
+ NULL, 0
+#endif
+};
+
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int tex_vert_bin[] =
+{
+# include "shader/tex_vert_bin_s3c6410.h"
+};
+#endif
+const char tex_vert_glsl[] =
+#include "shader/tex_vert.h"
+ ;
+Evas_GL_Program_Source shader_tex_vert_src =
+{
+ tex_vert_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ tex_vert_bin, sizeof(tex_vert_bin)
+#else
+ NULL, 0
+#endif
+};
+
return tex;
}
+static Evas_GL_Texture_Pool *
+_pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int format)
+{
+ Evas_GL_Texture_Pool *pt;
+
+ pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
+ if (!pt) return NULL;
+ h = _tex_round_slot(gc, h) << 4;
+ _tex_adjust(gc, &w, &h);
+ pt->gc = gc;
+ pt->w = w;
+ pt->h = h;
+ pt->intformat = intformat;
+ pt->format = format;
+ pt->dataformat = GL_UNSIGNED_BYTE;
+ pt->references = 0;
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ // FIXME: XXX render-to-texture for gles2
+#else
+ glGenTextures(1, &(pt->texture));
+ glBindTexture(GL_TEXTURE_2D, pt->texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
+ glGenFramebuffers(1, &(pt->fb));
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, pt->fb);
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, pt->texture, 0);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
+#endif
+ return pt;
+}
+
+Evas_GL_Texture *
+evas_gl_common_texture_render_new(Evas_GL_Context *gc, int w, int h, int alpha)
+{
+ Evas_GL_Texture *tex;
+ Eina_List *l_after = NULL;
+ int u = 0, v = 0;
+
+ tex = calloc(1, sizeof(Evas_GL_Texture));
+ if (!tex) return NULL;
+
+ tex->gc = gc;
+ tex->references = 1;
+ tex->pt = _pool_tex_render_new(gc, w, h, rgba_ifmt, rgba_fmt);
+ if (!tex->pt)
+ {
+ free(tex);
+ return NULL;
+ }
+ tex->x = 0;
+ tex->y = 0;
+ tex->w = w;
+ tex->h = h;
+ tex->pt->references++;
+ return tex;
+}
+
void
evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
{
compile img
compile font
compile yuv
+compile tex
compile img
compile font
compile yuv
+compile tex
--- /dev/null
+"#ifdef GL_ES\n"
+"precision mediump float;\n"
+"#endif\n"
+"uniform sampler2D tex;\n"
+"varying vec4 col;\n"
+"varying vec2 tex_c;\n"
+"void main()\n"
+"{\n"
+" gl_FragColor = texture2D(tex, tex_c.xy) * col;\n"
+"}\n"
--- /dev/null
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D tex;
+varying vec4 col;
+varying vec2 tex_c;
+void main()
+{
+ gl_FragColor = texture2D(tex, tex_c.xy) * col;
+}
--- /dev/null
+0x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000000,
+0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000000,
+0x00000000, 0x0000e407, 0x307820e4, 0x00000000, 0x01000000, 0x0100e400,
+0x237a10e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
+0x00000004, 0x00000003, 0x00000009, 0x00000000, 0x00000004, 0x00000008,
+0x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
+0x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x006c6f63, 0x5f786574,
+0x00000063,
\ No newline at end of file
--- /dev/null
+
+#-------------------------------------------------
+# ORION - OpenGL ES 2.0 Shading Language Compiler
+# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
+# Compiler Version : v04.00.09
+# Release Date : 19.01.2009
+# FIMG VERSION : FIMGv1.5
+# Optimizer Options : -O --nolodcalc
+#-------------------------------------------------
+
+# hand optimised - removed useless ops
+
+ps_3_0
+
+fimg_version 0x01020000
+
+dcl_s2_tex s0
+dcl_f4_col v1.x
+dcl_f2_tex_c v0.x
+
+label start
+label main_
+texld r0.xyzw, v0.xyzw, s0 # tex=s0
+mul_sat oColor.xyzw, r0.xyzw, v1.xyzw # gl_FragColor=oColor.xyzw, col=v1.xyzw
+label main_end
+ret
--- /dev/null
+"#ifdef GL_ES\n"
+"precision mediump float;\n"
+"#endif\n"
+"attribute vec4 vertex;\n"
+"attribute vec4 color;\n"
+"attribute vec2 tex_coord;\n"
+"uniform mat4 mvp;\n"
+"varying vec4 col;\n"
+"varying vec2 tex_c;\n"
+"void main()\n"
+"{\n"
+" gl_Position = mvp * vertex;\n"
+" col = color;\n"
+" tex_c = tex_coord;\n"
+"}\n"
--- /dev/null
+#ifdef GL_ES
+precision mediump float;
+#endif
+attribute vec4 vertex;
+attribute vec4 color;
+attribute vec2 tex_coord;
+uniform mat4 mvp;
+varying vec4 col;
+varying vec2 tex_c;
+void main()
+{
+ gl_Position = mvp * vertex;
+ col = color;
+ tex_c = tex_coord;
+}
--- /dev/null
+0x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000007, 0x00000006,
+0x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000001, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000031, 0x00000000,
+0x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
+0x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
+0x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
+0x20f801e4, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
+0x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x00000006,
+0x00000009, 0x00000000, 0x00000000, 0x00000013, 0x00000005, 0x00000009,
+0x00000000, 0x00000004, 0x00000019, 0x00000009, 0x00000003, 0x00000000,
+0x00000008, 0x00000000, 0x0000000b, 0x00000009, 0x00010004, 0x00000000,
+0x00000027, 0x00000003, 0x00000009, 0x00010004, 0x00000004, 0x0000002b,
+0x00000005, 0x00000003, 0x00010004, 0x00000008, 0x00000023, 0x00000003,
+0x0000000e, 0x00020001, 0x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69,
+0x74726576, 0x63007865, 0x726f6c6f, 0x78657400, 0x6f6f635f, 0x6d006472,
+0x63007076, 0x74006c6f, 0x635f7865, 0x00000000,
\ No newline at end of file
// glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// glClear(GL_COLOR_BUFFER_BIT);
//x// printf("frame -> new\n");
- return re;
+ return re->win->gl_context->def_surface;
}
static void
}
static void
-eng_rectangle_draw(void *data, void *context, void *surface __UNUSED__, int x, int y, int w, int h)
+eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
eng_window_use(re->win);
+ evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
re->win->gl_context->dc = context;
evas_gl_common_rect_draw(re->win->gl_context, x, y, w, h);
}
static void
-eng_line_draw(void *data, void *context, void *surface __UNUSED__, int x1, int y1, int x2, int y2)
+eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2, int y2)
{
Render_Engine *re;
re = (Render_Engine *)data;
eng_window_use(re->win);
+ evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
re->win->gl_context->dc = context;
//-// evas_gl_common_line_draw(re->win->gl_context, x1, y1, x2, y2);
}
}
static void
-eng_polygon_draw(void *data, void *context, void *surface __UNUSED__, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
{
Render_Engine *re;
re = (Render_Engine *)data;
eng_window_use(re->win);
+ evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
re->win->gl_context->dc = context;
//--// evas_gl_common_poly_draw(re->win->gl_context, polygon);
}
}
static void
-eng_image_draw(void *data, void *context, void *surface __UNUSED__, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
+eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
{
Render_Engine *re;
re = (Render_Engine *)data;
if (!image) return;
eng_window_use(re->win);
+ evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
re->win->gl_context->dc = context;
evas_gl_common_image_draw(re->win->gl_context, image,
src_x, src_y, src_w, src_h,
Render_Engine *re;
re = (Render_Engine *)data;
+ eng_window_use(re->win);
+ evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
+ re->win->gl_context->dc = context;
evas_gl_common_image_map4_draw(re->win->gl_context, image, p, smooth, level);
}
static void *
eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
{
- // XXX
- return NULL;
+ Render_Engine *re;
+
+ re = (Render_Engine *)data;
+ return evas_gl_common_image_surface_new(re->win->gl_context, w, h, alpha);
}
static void
eng_image_map_surface_free(void *data __UNUSED__, void *surface)
{
- // XXX
+ evas_gl_common_image_free(surface);
}
static int
}
static void
-eng_font_draw(void *data, void *context, void *surface __UNUSED__, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const char *text)
+eng_font_draw(void *data, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const char *text)
{
Render_Engine *re;
re = (Render_Engine *)data;
eng_window_use(re->win);
+ evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
+ re->win->gl_context->dc = context;
{
// FIXME: put im into context so we can free it
static RGBA_Image *im = NULL;