forked from enlightenment/efl
parent
19ef9ecc95
commit
18d1e68924
|
@ -6,7 +6,6 @@
|
|||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
@ -134,9 +133,9 @@ struct _Evas_GL_Program_Source
|
|||
struct _Evas_GL_Shared
|
||||
{
|
||||
Eina_List *images;
|
||||
|
||||
|
||||
int images_size;
|
||||
|
||||
|
||||
struct {
|
||||
GLint max_texture_units;
|
||||
GLint max_texture_size;
|
||||
|
@ -151,31 +150,31 @@ struct _Evas_GL_Shared
|
|||
// tuning params - per gpu/cpu combo?
|
||||
#define MAX_CUTOUT 512
|
||||
#define DEF_CUTOUT 512
|
||||
|
||||
// FIXME bug with pipes > 1 right now, should default to 32
|
||||
|
||||
// FIXME bug with pipes > 1 right now, should default to 32
|
||||
#define MAX_PIPES 128
|
||||
#define DEF_PIPES 32
|
||||
#define DEF_PIPES_SGX_540 32
|
||||
#define DEF_PIPES_TEGRA_2 1
|
||||
|
||||
|
||||
#define MIN_ATLAS_ALLOC 16
|
||||
#define MAX_ATLAS_ALLOC 1024
|
||||
#define DEF_ATLAS_ALLOC 1024
|
||||
|
||||
|
||||
#define MIN_ATLAS_ALLOC_ALPHA 16
|
||||
#define MAX_ATLAS_ALLOC_ALPHA 4096
|
||||
#define DEF_ATLAS_ALLOC_ALPHA 4096
|
||||
|
||||
|
||||
#define MAX_ATLAS_W 512
|
||||
#define DEF_ATLAS_W 512
|
||||
|
||||
|
||||
#define MAX_ATLAS_H 512
|
||||
#define DEF_ATLAS_H 512
|
||||
|
||||
|
||||
#define MIN_ATLAS_SLOT 16
|
||||
#define MAX_ATLAS_SLOT 512
|
||||
#define DEF_ATLAS_SLOT 16
|
||||
|
||||
|
||||
struct {
|
||||
struct {
|
||||
int max;
|
||||
|
@ -192,19 +191,19 @@ struct _Evas_GL_Shared
|
|||
} atlas;
|
||||
} tune;
|
||||
} info;
|
||||
|
||||
|
||||
struct {
|
||||
Eina_List *whole;
|
||||
Eina_List *atlas[33][3];
|
||||
} tex;
|
||||
|
||||
|
||||
Eina_Hash *native_pm_hash;
|
||||
Eina_Hash *native_tex_hash;
|
||||
|
||||
|
||||
struct {
|
||||
Evas_GL_Program rect;
|
||||
Evas_GL_Program font;
|
||||
|
||||
|
||||
Evas_GL_Program img, img_nomul;
|
||||
Evas_GL_Program img_bgra, img_bgra_nomul;
|
||||
Evas_GL_Program img_mask;
|
||||
|
@ -236,7 +235,7 @@ struct _Evas_GL_Shared
|
|||
#define RTYPE_IMAGE 2
|
||||
#define RTYPE_FONT 3
|
||||
#define RTYPE_YUV 4
|
||||
#define RTYPE_MAP 5 /* need to merge with image */
|
||||
#define RTYPE_MAP 5 /* need to merge with image */
|
||||
#define RTYPE_IMASK 6
|
||||
|
||||
|
||||
|
@ -248,7 +247,7 @@ struct _Evas_Engine_GL_Context
|
|||
int rot;
|
||||
int foc, z0, px, py;
|
||||
RGBA_Draw_Context *dc;
|
||||
|
||||
|
||||
Evas_GL_Shared *shared;
|
||||
|
||||
int flushnum;
|
||||
|
@ -265,7 +264,7 @@ struct _Evas_Engine_GL_Context
|
|||
int clip;
|
||||
} current;
|
||||
} state;
|
||||
|
||||
|
||||
struct {
|
||||
struct {
|
||||
int x, y, w, h;
|
||||
|
@ -303,22 +302,22 @@ struct _Evas_Engine_GL_Context
|
|||
Evas_GL_Image *im;
|
||||
} array;
|
||||
} pipe[MAX_PIPES];
|
||||
|
||||
|
||||
struct {
|
||||
Eina_Bool size : 1;
|
||||
} change;
|
||||
|
||||
|
||||
Eina_Bool havestuff : 1;
|
||||
|
||||
|
||||
Evas_GL_Image *def_surface;
|
||||
|
||||
/* If this is set: Force drawing with a particular filter */
|
||||
GLuint filter_prog;
|
||||
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
// FIXME: hack. expose egl display to gl core for egl image sec extn.
|
||||
// FIXME: hack. expose egl display to gl core for egl image sec extn.
|
||||
void *egldisp;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _Evas_GL_Texture_Pool
|
||||
|
@ -350,7 +349,7 @@ struct _Evas_GL_Texture
|
|||
int x, y, w, h;
|
||||
double sx1, sy1, sx2, sy2;
|
||||
int references;
|
||||
|
||||
|
||||
Eina_Bool alpha : 1;
|
||||
};
|
||||
|
||||
|
@ -368,7 +367,7 @@ struct _Evas_GL_Image
|
|||
void *data;
|
||||
unsigned char no_free : 1;
|
||||
} cs;
|
||||
|
||||
|
||||
struct {
|
||||
void *data;
|
||||
struct {
|
||||
|
@ -385,7 +384,7 @@ struct _Evas_GL_Image
|
|||
|
||||
int scale_hint, content_hint;
|
||||
int csize;
|
||||
|
||||
|
||||
Eina_List *filtered;
|
||||
|
||||
unsigned char dirty : 1;
|
||||
|
@ -458,7 +457,7 @@ extern Evas_GL_Program_Source shader_filter_blur_bgra_nomul_frag_src;
|
|||
#endif
|
||||
|
||||
void glerr(int err, const char *file, const char *func, int line, const char *op);
|
||||
|
||||
|
||||
Evas_Engine_GL_Context *evas_gl_common_context_new(void);
|
||||
void evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
|
||||
void evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
|
||||
|
@ -506,7 +505,7 @@ void evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *g
|
|||
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,
|
||||
Eina_Bool yuv);
|
||||
void evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
|
||||
|
@ -514,7 +513,7 @@ void evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
|
|||
int evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
|
||||
void evas_gl_common_shader_program_init_done(void);
|
||||
void evas_gl_common_shader_program_shutdown(Evas_GL_Program *p);
|
||||
|
||||
|
||||
void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
|
||||
|
||||
void evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,7 +11,7 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
|
|||
int fh;
|
||||
|
||||
if (fg->ext_dat) return fg->ext_dat; // FIXME: one engine at a time can do this :(
|
||||
|
||||
|
||||
w = fg->glyph_out->bitmap.width;
|
||||
h = fg->glyph_out->bitmap.rows;
|
||||
if ((w == 0) || (h == 0)) return NULL;
|
||||
|
@ -45,13 +45,13 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
|
|||
DATA8 *tmpbuf = NULL, *dp, *tp, bits;
|
||||
int bi, bj, end;
|
||||
const DATA8 bitrepl[2] = {0x0, 0xff};
|
||||
|
||||
|
||||
tmpbuf = alloca(w);
|
||||
if (tmpbuf)
|
||||
{
|
||||
int x, y;
|
||||
DATA8 *p1, *p2;
|
||||
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
p1 = tmpbuf;
|
||||
|
@ -109,7 +109,7 @@ evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_co
|
|||
int c, cx, cy, cw, ch;
|
||||
int i;
|
||||
int sx, sy, sw, sh;
|
||||
|
||||
|
||||
if (dc != gc->dc) return;
|
||||
tex = fg->ext_dat;
|
||||
if (!tex) return;
|
||||
|
@ -119,14 +119,14 @@ evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_co
|
|||
g = (dc->col.col >> 8 ) & 0xff;
|
||||
b = (dc->col.col ) & 0xff;
|
||||
sx = 0; sy = 0; sw = tex->w, sh = tex->h;
|
||||
if ((!gc->dc->cutout.rects)
|
||||
if ((!gc->dc->cutout.rects)
|
||||
// || (gc->dc->cutout.active > 32)
|
||||
)
|
||||
{
|
||||
if (gc->dc->clip.use)
|
||||
{
|
||||
int nx, ny, nw, nh;
|
||||
|
||||
|
||||
nx = x; ny = y; nw = tex->w; nh = tex->h;
|
||||
RECTS_CLIP_TO_RECT(nx, ny, nw, nh,
|
||||
gc->dc->clip.x, gc->dc->clip.y,
|
||||
|
@ -145,14 +145,14 @@ evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_co
|
|||
ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(tex->h));
|
||||
ssw = ((double)sw * (double)(nw)) / (double)(tex->w);
|
||||
ssh = ((double)sh * (double)(nh)) / (double)(tex->h);
|
||||
evas_gl_common_context_font_push(gc, tex,
|
||||
evas_gl_common_context_font_push(gc, tex,
|
||||
ssx, ssy, ssw, ssh,
|
||||
nx, ny, nw, nh,
|
||||
r, g, b, a);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_gl_common_context_font_push(gc, tex,
|
||||
evas_gl_common_context_font_push(gc, tex,
|
||||
0.0, 0.0, 0.0, 0.0,
|
||||
// sx, sy, sw, sh,
|
||||
x, y, tex->w, tex->h,
|
||||
|
@ -174,7 +174,7 @@ evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_co
|
|||
for (i = 0; i < rects->active; ++i)
|
||||
{
|
||||
int nx, ny, nw, nh;
|
||||
|
||||
|
||||
rct = rects->rects + i;
|
||||
nx = x; ny = y; nw = tex->w; nh = tex->h;
|
||||
RECTS_CLIP_TO_RECT(nx, ny, nw, nh, rct->x, rct->y, rct->w, rct->h);
|
||||
|
@ -192,7 +192,7 @@ evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_co
|
|||
ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(tex->h));
|
||||
ssw = ((double)sw * (double)(nw)) / (double)(tex->w);
|
||||
ssh = ((double)sh * (double)(nh)) / (double)(tex->h);
|
||||
evas_gl_common_context_font_push(gc, tex,
|
||||
evas_gl_common_context_font_push(gc, tex,
|
||||
ssx, ssy, ssw, ssh,
|
||||
nx, ny, nw, nh,
|
||||
r, g, b, a);
|
||||
|
|
|
@ -5,7 +5,7 @@ evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc)
|
|||
{
|
||||
Eina_List *l;
|
||||
Evas_GL_Image *im;
|
||||
|
||||
|
||||
EINA_LIST_FOREACH(gc->shared->images, l, im)
|
||||
{
|
||||
if (im->im) evas_cache_image_unload_data(&im->im->cache_entry);
|
||||
|
@ -35,7 +35,7 @@ _evas_gl_image_cache_trim(Evas_Engine_GL_Context *gc)
|
|||
if (im2->references == 0)
|
||||
{
|
||||
im2->cached = 0;
|
||||
im2->gc->shared->images =
|
||||
im2->gc->shared->images =
|
||||
eina_list_remove_list(im2->gc->shared->images, l);
|
||||
im2->gc->shared->images_size -= (im2->csize);
|
||||
evas_gl_common_image_free(im2);
|
||||
|
@ -45,13 +45,13 @@ _evas_gl_image_cache_trim(Evas_Engine_GL_Context *gc)
|
|||
}
|
||||
if ((gc->shared->images_size > size) && (l))
|
||||
{
|
||||
printf("EEK %i > %i, no 0 ref imgs\n",
|
||||
printf("EEK %i > %i, no 0 ref imgs\n",
|
||||
gc->shared->images_size, size);
|
||||
break;
|
||||
}
|
||||
if (!gc->shared->images)
|
||||
{
|
||||
printf("EEK %i > %i, no imgs\n",
|
||||
printf("EEK %i > %i, no imgs\n",
|
||||
gc->shared->images_size, size);
|
||||
break;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ evas_gl_common_image_native_enable(Evas_GL_Image *im)
|
|||
evas_gl_common_texture_free(im->tex);
|
||||
im->tex = NULL;
|
||||
}
|
||||
|
||||
|
||||
im->cs.space = EVAS_COLORSPACE_ARGB8888;
|
||||
im->tex = evas_gl_common_texture_native_new(im->gc, im->w, im->h, im->alpha, im);
|
||||
im->tex_only = 1;
|
||||
|
@ -343,7 +343,7 @@ evas_gl_common_image_native_disable(Evas_GL_Image *im)
|
|||
im->tex = NULL;
|
||||
}
|
||||
im->tex_only = 0;
|
||||
|
||||
|
||||
im->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im->im->cache_entry.flags.alpha = im->alpha;
|
||||
im->cs.space = EVAS_COLORSPACE_ARGB8888;
|
||||
|
@ -413,7 +413,7 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
|
|||
im->tex = NULL;
|
||||
}
|
||||
im->tex_only = 0;
|
||||
|
||||
|
||||
im->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im->im->cache_entry.flags.alpha = im->alpha;
|
||||
im->cs.space = EVAS_COLORSPACE_ARGB8888;
|
||||
|
@ -436,14 +436,14 @@ evas_gl_common_image_free(Evas_GL_Image *im)
|
|||
#if 0 // filtering disabled
|
||||
Filtered_Image *fi;
|
||||
#endif
|
||||
|
||||
|
||||
evas_gl_common_context_flush(im->gc);
|
||||
im->references--;
|
||||
if (im->references > 0) return;
|
||||
|
||||
|
||||
if (im->native.func.free)
|
||||
im->native.func.free(im->native.func.data, im);
|
||||
|
||||
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
|
@ -504,7 +504,7 @@ void
|
|||
evas_gl_common_image_update(Evas_Engine_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))
|
||||
{
|
||||
|
@ -516,7 +516,7 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
|
|||
free(im->im->image.data);
|
||||
im->im->image.data = malloc(im->im->cache_entry.w * im->im->cache_entry.h * sizeof(DATA32));
|
||||
if (im->im->image.data)
|
||||
evas_common_convert_yuv_420p_601_rgba(im->cs.data,
|
||||
evas_common_convert_yuv_420p_601_rgba(im->cs.data,
|
||||
(void *)im->im->image.data,
|
||||
im->im->cache_entry.w, im->im->cache_entry.h);
|
||||
}
|
||||
|
@ -548,14 +548,14 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
|
|||
if ((im->tex) && (im->dirty))
|
||||
{
|
||||
evas_gl_common_texture_yuv_update(im->tex, im->cs.data,
|
||||
im->im->cache_entry.w,
|
||||
im->im->cache_entry.w,
|
||||
im->im->cache_entry.h);
|
||||
im->dirty = 0;
|
||||
}
|
||||
if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
|
||||
{
|
||||
im->tex = evas_gl_common_texture_yuv_new(gc, im->cs.data,
|
||||
im->im->cache_entry.w,
|
||||
im->im->cache_entry.w,
|
||||
im->im->cache_entry.h);
|
||||
im->dirty = 0;
|
||||
}
|
||||
|
@ -568,14 +568,14 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
|
|||
}
|
||||
|
||||
void
|
||||
evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im,
|
||||
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 __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc;
|
||||
int r, g, b, a;
|
||||
int c, cx, cy, cw, ch;
|
||||
Eina_Bool yuv = 0;
|
||||
|
||||
|
||||
dc = gc->dc;
|
||||
if (dc->mul.use)
|
||||
{
|
||||
|
@ -588,18 +588,18 @@ evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im,
|
|||
{
|
||||
r = g = b = a = 255;
|
||||
}
|
||||
|
||||
|
||||
evas_gl_common_image_update(gc, im);
|
||||
|
||||
c = gc->dc->clip.use;
|
||||
cx = gc->dc->clip.x; cy = gc->dc->clip.y;
|
||||
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;
|
||||
im->tex->im = im;
|
||||
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
|
||||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
|
||||
yuv = 1;
|
||||
evas_gl_common_context_image_map_push(gc, im->tex, npoints, p,
|
||||
c, cx, cy, cw, ch,
|
||||
c, cx, cy, cw, ch,
|
||||
r, g, b, a, smooth, im->tex_only,
|
||||
yuv);
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx,
|
|||
int c, cx, cy, cw, ch;
|
||||
int i;
|
||||
int yuv = 0;
|
||||
|
||||
|
||||
if (sw < 1) sw = 1;
|
||||
if (sh < 1) sh = 1;
|
||||
dc = gc->dc;
|
||||
|
@ -633,7 +633,7 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx,
|
|||
{
|
||||
r = g = b = a = 255;
|
||||
}
|
||||
|
||||
|
||||
evas_gl_common_image_update(gc, im);
|
||||
if (!im->tex)
|
||||
{
|
||||
|
@ -744,7 +744,7 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx,
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* save out clip info */
|
||||
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_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
|
||||
|
|
|
@ -6,7 +6,7 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
|
|||
RGBA_Draw_Context *dc;
|
||||
int r, g, b, a;
|
||||
int c, cx, cy, cw, ch;
|
||||
|
||||
|
||||
dc = gc->dc;
|
||||
if (dc->mul.use)
|
||||
{
|
||||
|
@ -21,12 +21,12 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
|
|||
}
|
||||
|
||||
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_line_push(gc, x1, y1, x2, y2,
|
||||
c, cx, cy, cw, ch,
|
||||
|
||||
evas_gl_common_context_line_push(gc, x1, y1, x2, y2,
|
||||
c, cx, cy, cw, ch,
|
||||
r, g, b, a);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ static int
|
|||
polygon_point_sorter(const void *a, const void *b)
|
||||
{
|
||||
RGBA_Vertex *p, *q;
|
||||
|
||||
|
||||
p = (RGBA_Vertex *)a;
|
||||
q = (RGBA_Vertex *)b;
|
||||
if (p->y <= q->y) return -1;
|
||||
|
@ -112,7 +112,7 @@ static int
|
|||
polygon_edge_sorter(const void *a, const void *b)
|
||||
{
|
||||
RGBA_Edge *p, *q;
|
||||
|
||||
|
||||
p = (RGBA_Edge *)a;
|
||||
q = (RGBA_Edge *)b;
|
||||
if (p->x <= q->x) return -1;
|
||||
|
@ -133,7 +133,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
RGBA_Vertex *point;
|
||||
Evas_GL_Polygon_Point *pt;
|
||||
Eina_Inlist *spans;
|
||||
|
||||
|
||||
/* save out clip info */
|
||||
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;
|
||||
|
||||
|
@ -142,7 +142,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
cr = (gc->dc->col.col >> 16) & 0xff;
|
||||
cg = (gc->dc->col.col >> 8 ) & 0xff;
|
||||
cb = (gc->dc->col.col ) & 0xff;
|
||||
|
||||
|
||||
n = eina_list_count(poly->points);
|
||||
if (n < 3) return;
|
||||
edges = malloc(sizeof(RGBA_Edge) * n);
|
||||
|
@ -160,7 +160,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
free(point);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
k = 0;
|
||||
EINA_LIST_FOREACH(poly->points, l, pt)
|
||||
{
|
||||
|
@ -180,20 +180,20 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
point[k].i = k;
|
||||
k++;
|
||||
}
|
||||
|
||||
|
||||
y0 = MAX(cy, ceil(point[sorted_index[0]].y - 0.5));
|
||||
y1 = MIN(cy + ch - 1, floor(point[sorted_index[n - 1]].y - 0.5));
|
||||
|
||||
|
||||
k = 0;
|
||||
num_active_edges = 0;
|
||||
spans = NULL;
|
||||
|
||||
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
for (; (k < n) && (point[sorted_index[k]].y <= ((double)y + 0.5)); k++)
|
||||
{
|
||||
i = sorted_index[k];
|
||||
|
||||
|
||||
if (i > 0) j = i - 1;
|
||||
else j = n - 1;
|
||||
if (point[j].y <= ((double)y - 0.5))
|
||||
|
@ -215,13 +215,13 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
POLY_EDGE_ADD(i, y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
|
||||
|
||||
|
||||
for (j = 0; j < num_active_edges; j += 2)
|
||||
{
|
||||
int x0, x1;
|
||||
|
||||
|
||||
x0 = ceil(edges[j].x - 0.5);
|
||||
if (j < (num_active_edges - 1))
|
||||
x1 = floor(edges[j + 1].x - 0.5);
|
||||
|
@ -230,7 +230,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
if ((x1 >= cx) && (x0 < (cx + cw)) && (x0 <= x1))
|
||||
{
|
||||
RGBA_Span *span;
|
||||
|
||||
|
||||
if (x0 < cx) x0 = cx;
|
||||
if (x1 >= (cx + cw)) x1 = cx + cw - 1;
|
||||
span = malloc(sizeof(RGBA_Span));
|
||||
|
@ -243,13 +243,13 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
edges[j + 1].x += edges[j + 1].dx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free(edges);
|
||||
free(point);
|
||||
free(sorted_index);
|
||||
|
||||
|
||||
evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
|
||||
|
||||
|
||||
if (spans)
|
||||
{
|
||||
RGBA_Span *span;
|
||||
|
@ -298,9 +298,9 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
|
|||
span = (RGBA_Span *)spans;
|
||||
spans = eina_inlist_remove(spans, spans);
|
||||
free(span);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* restore clip info */
|
||||
gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
|
|||
Cutout_Rects *rects;
|
||||
Cutout_Rect *r;
|
||||
int c, cx, cy, cw, ch, cr, cg, cb, ca, i;
|
||||
|
||||
|
||||
if ((w <= 0) || (h <= 0)) return;
|
||||
if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, gc->w, gc->h))) return;
|
||||
/* save out clip info */
|
||||
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 ((gc->dc->render_op != EVAS_RENDER_COPY) && (ca <= 0)) return;
|
||||
cr = (gc->dc->col.col >> 16) & 0xff;
|
||||
|
@ -25,7 +25,7 @@ evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
|
|||
gc->dc->clip.x, gc->dc->clip.y,
|
||||
gc->dc->clip.w, gc->dc->clip.h);
|
||||
}
|
||||
|
||||
|
||||
if (!gc->dc->cutout.rects)
|
||||
{
|
||||
evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca);
|
||||
|
|
|
@ -16,9 +16,9 @@ Evas_GL_Program_Source shader_rect_frag_src =
|
|||
rect_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
rect_frag_bin, sizeof(rect_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -35,9 +35,9 @@ Evas_GL_Program_Source shader_rect_vert_src =
|
|||
rect_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
rect_vert_bin, sizeof(rect_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -56,9 +56,9 @@ Evas_GL_Program_Source shader_font_frag_src =
|
|||
font_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
font_frag_bin, sizeof(font_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -75,9 +75,9 @@ Evas_GL_Program_Source shader_font_vert_src =
|
|||
font_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
font_vert_bin, sizeof(font_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -96,9 +96,9 @@ Evas_GL_Program_Source shader_yuv_frag_src =
|
|||
yuv_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
yuv_frag_bin, sizeof(yuv_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -115,9 +115,9 @@ Evas_GL_Program_Source shader_yuv_vert_src =
|
|||
yuv_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
yuv_vert_bin, sizeof(yuv_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -136,9 +136,9 @@ Evas_GL_Program_Source shader_yuv_nomul_frag_src =
|
|||
yuv_nomul_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
yuv_nomul_frag_bin, sizeof(yuv_nomul_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -155,9 +155,9 @@ Evas_GL_Program_Source shader_yuv_nomul_vert_src =
|
|||
yuv_nomul_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
yuv_nomul_vert_bin, sizeof(yuv_nomul_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -176,9 +176,9 @@ Evas_GL_Program_Source shader_tex_frag_src =
|
|||
tex_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
tex_frag_bin, sizeof(tex_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -195,9 +195,9 @@ Evas_GL_Program_Source shader_tex_vert_src =
|
|||
tex_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
tex_vert_bin, sizeof(tex_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -216,9 +216,9 @@ Evas_GL_Program_Source shader_tex_nomul_frag_src =
|
|||
tex_nomul_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
tex_nomul_frag_bin, sizeof(tex_nomul_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -235,9 +235,9 @@ Evas_GL_Program_Source shader_tex_nomul_vert_src =
|
|||
tex_nomul_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
tex_nomul_vert_bin, sizeof(tex_nomul_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -256,9 +256,9 @@ Evas_GL_Program_Source shader_img_frag_src =
|
|||
img_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_frag_bin, sizeof(img_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -275,9 +275,9 @@ Evas_GL_Program_Source shader_img_vert_src =
|
|||
img_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_vert_bin, sizeof(img_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -296,9 +296,9 @@ Evas_GL_Program_Source shader_img_nomul_frag_src =
|
|||
img_nomul_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_nomul_frag_bin, sizeof(img_nomul_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -315,9 +315,9 @@ Evas_GL_Program_Source shader_img_nomul_vert_src =
|
|||
img_nomul_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_nomul_vert_bin, sizeof(img_nomul_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -336,9 +336,9 @@ Evas_GL_Program_Source shader_img_bgra_frag_src =
|
|||
img_bgra_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_bgra_frag_bin, sizeof(img_bgra_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -355,9 +355,9 @@ Evas_GL_Program_Source shader_img_bgra_vert_src =
|
|||
img_bgra_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_bgra_vert_bin, sizeof(img_bgra_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
@ -418,9 +418,9 @@ Evas_GL_Program_Source shader_img_bgra_nomul_frag_src =
|
|||
img_bgra_nomul_frag_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_bgra_nomul_frag_bin, sizeof(img_bgra_nomul_frag_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -437,9 +437,9 @@ Evas_GL_Program_Source shader_img_bgra_nomul_vert_src =
|
|||
img_bgra_nomul_vert_glsl,
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
img_bgra_nomul_vert_bin, sizeof(img_bgra_nomul_vert_bin)
|
||||
#else
|
||||
#else
|
||||
NULL, 0
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
@ -622,7 +622,7 @@ gl_compile_link_error(GLuint target, const char *action)
|
|||
free(logtxt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Program info log */
|
||||
glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
|
||||
if (loglen > 0)
|
||||
|
@ -709,7 +709,7 @@ _evas_gl_shader_dir_check(char *bin_shader_dir, int num)
|
|||
|
||||
home = getenv("HOME");
|
||||
if ((!home) || (!home[0])) return 0;
|
||||
|
||||
|
||||
snprintf(bin_shader_dir, num, "%s/%s", home, subdir);
|
||||
return _evas_gl_shader_file_exists(bin_shader_dir);
|
||||
}
|
||||
|
@ -774,8 +774,8 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
|
|||
p->prog = glCreateProgram();
|
||||
|
||||
#if 0
|
||||
// TODO: invalid rendering error occurs when attempting to use a
|
||||
// glProgramBinary. in order to render correctly we should create a dummy
|
||||
// TODO: invalid rendering error occurs when attempting to use a
|
||||
// glProgramBinary. in order to render correctly we should create a dummy
|
||||
// vertex shader.
|
||||
p->vert = glCreateShader(GL_VERTEX_SHADER);
|
||||
glAttachShader(p->prog, p->vert);
|
||||
|
@ -840,7 +840,7 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
const char *name)
|
||||
{
|
||||
GLint ok;
|
||||
|
||||
|
||||
p->vert = glCreateShader(GL_VERTEX_SHADER);
|
||||
p->frag = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
#if defined (GLES_VARIETY_S3C6410)
|
||||
|
@ -848,7 +848,7 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glShaderBinary(1, &(p->frag), 0, frag->bin, frag->bin_size);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#else
|
||||
#else
|
||||
glShaderSource(p->vert, 1,
|
||||
(const char **)&(vert->src), NULL);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
@ -882,14 +882,14 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
#if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
|
||||
#else
|
||||
if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri))
|
||||
glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
|
||||
glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
|
||||
GL_TRUE);
|
||||
#endif
|
||||
#endif
|
||||
glAttachShader(p->prog, p->vert);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glAttachShader(p->prog, p->frag);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
|
||||
glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_COLOR, "color");
|
||||
|
@ -902,7 +902,7 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
|
||||
glLinkProgram(p->prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
ok = 0;
|
||||
|
@ -965,7 +965,7 @@ _evas_gl_common_shader_source_init(Evas_GL_Shared *shared)
|
|||
&(shader_yuv_nomul_vert_src),
|
||||
&(shader_yuv_nomul_frag_src),
|
||||
"yuv_nomul")) return 0;
|
||||
|
||||
|
||||
/* Most of the filters use the image fragment shader */
|
||||
if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_invert),
|
||||
&(shader_img_vert_src),
|
||||
|
@ -983,7 +983,7 @@ _evas_gl_common_shader_source_init(Evas_GL_Shared *shared)
|
|||
&(shader_img_vert_src),
|
||||
&(shader_filter_invert_bgra_nomul_frag_src),
|
||||
"filter_invert_bgra_nomul")) return 0;
|
||||
|
||||
|
||||
if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_sepia),
|
||||
&(shader_img_vert_src),
|
||||
&(shader_filter_sepia_frag_src),
|
||||
|
@ -1000,7 +1000,7 @@ _evas_gl_common_shader_source_init(Evas_GL_Shared *shared)
|
|||
&(shader_img_vert_src),
|
||||
&(shader_filter_sepia_bgra_nomul_frag_src),
|
||||
"filter_sepia_bgra_nomul")) return 0;
|
||||
|
||||
|
||||
if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_greyscale),
|
||||
&(shader_img_vert_src),
|
||||
&(shader_filter_greyscale_frag_src),
|
||||
|
@ -1035,7 +1035,7 @@ _evas_gl_common_shader_source_init(Evas_GL_Shared *shared)
|
|||
&(shader_filter_blur_bgra_nomul_frag_src),
|
||||
"filter_blur_bgra_nomul")) return 0;
|
||||
#endif
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1049,11 +1049,11 @@ _evas_gl_common_shader_binary_init(Evas_GL_Shared *shared)
|
|||
|
||||
if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
|
||||
return 0;
|
||||
|
||||
|
||||
if (!_evas_gl_shader_file_check(bin_dir_path, bin_file_path,
|
||||
sizeof(bin_dir_path)))
|
||||
sizeof(bin_dir_path)))
|
||||
return 0;
|
||||
|
||||
|
||||
/* use eet */
|
||||
if (!eet_init()) return 0;
|
||||
et = eet_open(bin_file_path, EET_FILE_MODE_READ);
|
||||
|
@ -1117,10 +1117,10 @@ _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared)
|
|||
if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
|
||||
res = _evas_gl_shader_file_mkpath(bin_dir_path);
|
||||
if (!res) return 0; /* we can't make directory */
|
||||
|
||||
_evas_gl_shader_file_check(bin_dir_path, bin_file_path,
|
||||
|
||||
_evas_gl_shader_file_check(bin_dir_path, bin_file_path,
|
||||
sizeof(bin_dir_path));
|
||||
|
||||
|
||||
/* use mkstemp for writing */
|
||||
snprintf(tmp_file, sizeof(tmp_file), "%s.XXXXXX", bin_file_path);
|
||||
tmpfd = mkstemp(tmp_file);
|
||||
|
@ -1182,7 +1182,7 @@ int
|
|||
evas_gl_common_shader_program_init(Evas_GL_Shared *shared)
|
||||
{
|
||||
// gl support binary shader and get env of binary shader path
|
||||
if (shared->info.bin_program &&
|
||||
if (shared->info.bin_program &&
|
||||
_evas_gl_common_shader_binary_init(shared)) return 1;
|
||||
/* compile all shader.*/
|
||||
if (!_evas_gl_common_shader_source_init(shared)) return 0;
|
||||
|
@ -1196,7 +1196,7 @@ evas_gl_common_shader_program_init_done(void)
|
|||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
glReleaseShaderCompiler();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -88,7 +88,7 @@ _tex_format_index(GLuint format)
|
|||
case GL_RGBA:
|
||||
#ifdef GL_BGRA
|
||||
case GL_BGRA:
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
case GL_RGB:
|
||||
return 1;
|
||||
|
@ -120,7 +120,7 @@ static Evas_GL_Texture_Pool *
|
|||
_pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum format)
|
||||
{
|
||||
Evas_GL_Texture_Pool *pt;
|
||||
|
||||
|
||||
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
|
||||
if (!pt) return NULL;
|
||||
h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
|
||||
|
@ -132,7 +132,7 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum fo
|
|||
pt->format = format;
|
||||
pt->dataformat = GL_UNSIGNED_BYTE;
|
||||
pt->references = 0;
|
||||
|
||||
|
||||
if (format == alpha_fmt)
|
||||
{
|
||||
texinfo.a.num++;
|
||||
|
@ -150,7 +150,7 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum fo
|
|||
}
|
||||
|
||||
_print_tex_count();
|
||||
|
||||
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||
|
@ -215,8 +215,8 @@ _pool_tex_alloc(Evas_GL_Texture_Pool *pt, int w, int h __UNUSED__, int *u, int *
|
|||
}
|
||||
|
||||
static Evas_GL_Texture_Pool *
|
||||
_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
|
||||
int intformat, int format, int *u, int *v,
|
||||
_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
|
||||
int intformat, int format, int *u, int *v,
|
||||
Eina_List **l_after, int atlas_w)
|
||||
{
|
||||
Evas_GL_Texture_Pool *pt = NULL;
|
||||
|
@ -225,7 +225,7 @@ _pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
|
|||
|
||||
if (atlas_w > gc->shared->info.max_texture_size)
|
||||
atlas_w = gc->shared->info.max_texture_size;
|
||||
if ((w > gc->shared->info.tune.atlas.max_w) ||
|
||||
if ((w > gc->shared->info.tune.atlas.max_w) ||
|
||||
(h > gc->shared->info.tune.atlas.max_h))
|
||||
{
|
||||
pt = _pool_tex_new(gc, w, h, intformat, format);
|
||||
|
@ -238,22 +238,22 @@ _pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
|
|||
*l_after = NULL;
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
||||
th = _tex_round_slot(gc, h);
|
||||
th2 = _tex_format_index(intformat);
|
||||
EINA_LIST_FOREACH(gc->shared->tex.atlas[th][th2], l, pt)
|
||||
{
|
||||
if (_pool_tex_alloc(pt, w, h, u, v, l_after))
|
||||
{
|
||||
gc->shared->tex.atlas[th][th2] =
|
||||
gc->shared->tex.atlas[th][th2] =
|
||||
eina_list_remove_list(gc->shared->tex.atlas[th][th2], l);
|
||||
gc->shared->tex.atlas[th][th2] =
|
||||
gc->shared->tex.atlas[th][th2] =
|
||||
eina_list_prepend(gc->shared->tex.atlas[th][th2], pt);
|
||||
return pt;
|
||||
}
|
||||
}
|
||||
pt = _pool_tex_new(gc, atlas_w, h, intformat, format);
|
||||
gc->shared->tex.atlas[th][th2] =
|
||||
gc->shared->tex.atlas[th][th2] =
|
||||
eina_list_prepend(gc->shared->tex.atlas[th][th2], pt);
|
||||
pt->slot = th;
|
||||
pt->fslot = th2;
|
||||
|
@ -272,7 +272,7 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
|
|||
|
||||
tex = calloc(1, sizeof(Evas_GL_Texture));
|
||||
if (!tex) return NULL;
|
||||
|
||||
|
||||
tex->gc = gc;
|
||||
tex->references = 1;
|
||||
|
||||
|
@ -280,12 +280,12 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
|
|||
{
|
||||
if (gc->shared->info.bgra)
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
|
||||
im->cache_entry.h + 1, bgra_ifmt, bgra_fmt,
|
||||
im->cache_entry.h + 1, bgra_ifmt, bgra_fmt,
|
||||
&u, &v, &l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_size);
|
||||
else
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
|
||||
im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
|
||||
im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
|
||||
&u, &v, &l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_size);
|
||||
tex->alpha = 1;
|
||||
|
@ -293,18 +293,18 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
|
|||
else
|
||||
{
|
||||
if (gc->shared->info.bgra)
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
im->cache_entry.h + 1, bgr_ifmt, bgr_fmt,
|
||||
&u, &v, &l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_size);
|
||||
else
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
|
||||
&u, &v, &l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_size);
|
||||
#else
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
im->cache_entry.h + 1, rgb_ifmt, rgb_fmt,
|
||||
&u, &v, &l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_size);
|
||||
|
@ -320,10 +320,10 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
|
|||
tex->w = im->cache_entry.w;
|
||||
tex->h = im->cache_entry.h;
|
||||
if (l_after)
|
||||
tex->pt->allocations =
|
||||
tex->pt->allocations =
|
||||
eina_list_append_relative_list(tex->pt->allocations, tex, l_after);
|
||||
else
|
||||
tex->pt->allocations =
|
||||
tex->pt->allocations =
|
||||
eina_list_prepend(tex->pt->allocations, tex);
|
||||
tex->pt->references++;
|
||||
evas_gl_common_texture_update(tex, im);
|
||||
|
@ -334,7 +334,7 @@ static Evas_GL_Texture_Pool *
|
|||
_pool_tex_render_new(Evas_Engine_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) * gc->shared->info.tune.atlas.slot_size;
|
||||
|
@ -361,12 +361,12 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
# ifndef GL_COLOR_ATTACHMENT0
|
||||
# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
texinfo.r.num++;
|
||||
texinfo.r.pix += pt->w * pt->h;
|
||||
|
||||
|
||||
_print_tex_count();
|
||||
|
||||
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||
|
@ -380,7 +380,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
|
||||
|
||||
|
||||
glsym_glGenFramebuffers(1, &(pt->fb));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
|
||||
|
@ -389,7 +389,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
return pt;
|
||||
|
@ -399,11 +399,11 @@ static Evas_GL_Texture_Pool *
|
|||
_pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format, Evas_GL_Image *im)
|
||||
{
|
||||
Evas_GL_Texture_Pool *pt;
|
||||
|
||||
|
||||
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
|
||||
if (!pt) return NULL;
|
||||
pt->gc = gc;
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
if (im->native.target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
{
|
||||
printf("REEEEEEEEECT\n");
|
||||
|
@ -411,7 +411,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
pt->h = h;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
// FIXME: handle po2 only textures
|
||||
pt->w = w;
|
||||
|
@ -424,14 +424,14 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
pt->native = 1;
|
||||
texinfo.n.num++;
|
||||
texinfo.n.pix += pt->w * pt->h;
|
||||
|
||||
|
||||
_print_tex_count();
|
||||
|
||||
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(im->native.target, pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#else
|
||||
if (im->native.loose)
|
||||
|
@ -440,7 +440,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
im->native.func.bind(im->native.func.data, im);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
@ -460,7 +460,7 @@ static Evas_GL_Texture_Pool *
|
|||
_pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format)
|
||||
{
|
||||
Evas_GL_Texture_Pool *pt = NULL;
|
||||
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
int fmt; // EGL_MAP_GL_TEXTURE_RGBA_SEC or EGL_MAP_GL_TEXTURE_RGB_SEC or bust
|
||||
int pixtype; // EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC or bust
|
||||
|
@ -473,7 +473,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
EGL_NONE
|
||||
};
|
||||
void *egldisplay;
|
||||
|
||||
|
||||
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
|
||||
if (!pt) return NULL;
|
||||
h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
|
||||
|
@ -488,9 +488,9 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
pt->references = 0;
|
||||
texinfo.d.num++;
|
||||
texinfo.d.pix += pt->w * pt->h;
|
||||
|
||||
|
||||
_print_tex_count();
|
||||
|
||||
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||
|
@ -505,14 +505,14 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
egldisplay = pt->gc->egldisp;
|
||||
|
||||
|
||||
attr[1] = pt->w;
|
||||
attr[3] = pt->h;
|
||||
|
||||
// FIXME: seems a bit slower than i'd like - maybe too many flushes?
|
||||
// FIXME: YCbCr no support as yet
|
||||
pt->dyn.img = secsym_eglCreateImage(egldisplay,
|
||||
EGL_NO_CONTEXT,
|
||||
EGL_NO_CONTEXT,
|
||||
EGL_MAP_GL_TEXTURE_2D_SEC,
|
||||
0, attr);
|
||||
if (!pt->dyn.img)
|
||||
|
@ -593,7 +593,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#else
|
||||
|
@ -602,7 +602,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
h = 0;
|
||||
intformat = 0;
|
||||
format = 0;
|
||||
#endif
|
||||
#endif
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
@ -610,7 +610,7 @@ void
|
|||
evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
|
||||
{
|
||||
if (!pt->gc) return;
|
||||
|
||||
|
||||
if (pt->format == alpha_fmt)
|
||||
{
|
||||
texinfo.a.num--;
|
||||
|
@ -641,9 +641,9 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
|
|||
texinfo.c.num--;
|
||||
texinfo.c.pix -= pt->w * pt->h;
|
||||
}
|
||||
|
||||
|
||||
_print_tex_count();
|
||||
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
if (pt->dyn.img)
|
||||
{
|
||||
|
@ -654,8 +654,8 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
|
|||
pt->dyn.h = 0;
|
||||
pt->dyn.stride = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
glDeleteTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (pt->fb)
|
||||
|
@ -665,7 +665,7 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
|
|||
pt->fb = 0;
|
||||
}
|
||||
while (pt->allocations)
|
||||
pt->allocations =
|
||||
pt->allocations =
|
||||
eina_list_remove_list(pt->allocations, pt->allocations);
|
||||
pt->texture = 0;
|
||||
pt->gc = NULL;
|
||||
|
@ -683,7 +683,7 @@ pt_unref(Evas_GL_Texture_Pool *pt)
|
|||
if (!((pt->render) || (pt->native)))
|
||||
{
|
||||
if (pt->whole)
|
||||
pt->gc->shared->tex.whole =
|
||||
pt->gc->shared->tex.whole =
|
||||
eina_list_remove(pt->gc->shared->tex.whole, pt);
|
||||
else
|
||||
pt->gc->shared->tex.atlas [pt->slot][pt->fslot] =
|
||||
|
@ -700,7 +700,7 @@ evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, un
|
|||
|
||||
tex = calloc(1, sizeof(Evas_GL_Texture));
|
||||
if (!tex) return NULL;
|
||||
|
||||
|
||||
tex->gc = gc;
|
||||
tex->references = 1;
|
||||
tex->alpha = alpha;
|
||||
|
@ -738,7 +738,7 @@ evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, un
|
|||
|
||||
tex = calloc(1, sizeof(Evas_GL_Texture));
|
||||
if (!tex) return NULL;
|
||||
|
||||
|
||||
tex->gc = gc;
|
||||
tex->references = 1;
|
||||
tex->alpha = alpha;
|
||||
|
@ -765,7 +765,7 @@ evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, un
|
|||
tex->y = 0;
|
||||
tex->w = w;
|
||||
tex->h = h;
|
||||
tex->pt->references++;
|
||||
tex->pt->references++;
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
@ -776,7 +776,7 @@ evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im
|
|||
|
||||
tex = calloc(1, sizeof(Evas_GL_Texture));
|
||||
if (!tex) return NULL;
|
||||
|
||||
|
||||
tex->gc = gc;
|
||||
tex->references = 1;
|
||||
tex->alpha = im->alpha;
|
||||
|
@ -834,36 +834,36 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
|||
}
|
||||
if (!tex->pt) return;
|
||||
if (!im->image.data) return;
|
||||
|
||||
|
||||
fmt = tex->pt->format;
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#endif
|
||||
#endif
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
|
||||
// +-+
|
||||
// +-+
|
||||
//
|
||||
_tex_sub_2d(tex->x, tex->y,
|
||||
//
|
||||
_tex_sub_2d(tex->x, tex->y,
|
||||
im->cache_entry.w, im->cache_entry.h,
|
||||
fmt, tex->pt->dataformat,
|
||||
im->image.data);
|
||||
// |xxx
|
||||
// |xxx
|
||||
//
|
||||
_tex_sub_2d(tex->x - 1, tex->y,
|
||||
//
|
||||
_tex_sub_2d(tex->x - 1, tex->y,
|
||||
1, im->cache_entry.h,
|
||||
fmt, tex->pt->dataformat,
|
||||
im->image.data);
|
||||
// xxx|
|
||||
// xxx|
|
||||
//
|
||||
_tex_sub_2d(tex->x + im->cache_entry.w, tex->y,
|
||||
//
|
||||
_tex_sub_2d(tex->x + im->cache_entry.w, tex->y,
|
||||
1, im->cache_entry.h,
|
||||
fmt, tex->pt->dataformat,
|
||||
im->image.data + (im->cache_entry.w - 1));
|
||||
|
@ -923,11 +923,11 @@ evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels,
|
|||
|
||||
tex = calloc(1, sizeof(Evas_GL_Texture));
|
||||
if (!tex) return NULL;
|
||||
|
||||
|
||||
tex->gc = gc;
|
||||
tex->references = 1;
|
||||
tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v,
|
||||
&l_after,
|
||||
&l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_alpha_size);
|
||||
if (!tex->pt)
|
||||
{
|
||||
|
@ -939,7 +939,7 @@ evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels,
|
|||
tex->w = w;
|
||||
tex->h = h;
|
||||
if (l_after)
|
||||
tex->pt->allocations =
|
||||
tex->pt->allocations =
|
||||
eina_list_append_relative_list(tex->pt->allocations, tex, l_after);
|
||||
else
|
||||
tex->pt->allocations = eina_list_prepend(tex->pt->allocations, tex);
|
||||
|
@ -955,13 +955,13 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
|
|||
if (!tex->pt) return;
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#endif
|
||||
#endif
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
|
||||
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
|
||||
pixels);
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
|
@ -977,7 +977,7 @@ evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigne
|
|||
|
||||
tex = calloc(1, sizeof(Evas_GL_Texture));
|
||||
if (!tex) return NULL;
|
||||
|
||||
|
||||
tex->gc = gc;
|
||||
tex->references = 1;
|
||||
tex->pt = _pool_tex_new(gc, w + 1, h + 1, lum_ifmt, lum_fmt);
|
||||
|
@ -1073,7 +1073,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
for (y = 0; y < (h / 2); y++)
|
||||
_tex_sub_2d(0, y, w / 2, 1, tex->ptu->format, tex->ptu->dataformat, rows[h + y]);
|
||||
}
|
||||
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
|
||||
|
@ -1083,7 +1083,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
for (y = 0; y < (h / 2); y++)
|
||||
_tex_sub_2d(0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
|
|
|
@ -33,16 +33,14 @@ struct _Evas_Engine_Info_GL_X11
|
|||
struct {
|
||||
void (*pre_swap) (void *data, Evas *e);
|
||||
void (*post_swap) (void *data, Evas *e);
|
||||
|
||||
|
||||
void *data; // data for callback calls
|
||||
} callback;
|
||||
|
||||
/* non-blocking or blocking mode */
|
||||
Evas_Engine_Render_Mode render_mode;
|
||||
|
||||
|
||||
unsigned char vsync : 1; // does nothing right now
|
||||
unsigned char indirect : 1; // use indirect rendering
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -92,7 +92,7 @@ struct _Evas_GL_X11_Window
|
|||
EGLSurface egl_surface[1];
|
||||
EGLConfig egl_config;
|
||||
EGLDisplay egl_disp;
|
||||
#else
|
||||
#else
|
||||
GLXContext context;
|
||||
GLXWindow glxwin;
|
||||
struct {
|
||||
|
@ -102,7 +102,7 @@ struct _Evas_GL_X11_Window
|
|||
int mipmap;
|
||||
unsigned char yinvert : 1;
|
||||
} depth_cfg[33]; // config for all 32 possible depths!
|
||||
|
||||
|
||||
struct {
|
||||
unsigned int loose_binding : 1;
|
||||
} detected;
|
||||
|
|
|
@ -41,15 +41,15 @@ eng_window_new(Display *disp,
|
|||
int config_attrs[40];
|
||||
int major_version, minor_version;
|
||||
int num_config, n = 0;
|
||||
#endif
|
||||
#endif
|
||||
XVisualInfo *vi_use;
|
||||
const GLubyte *vendor, *renderer, *version;
|
||||
|
||||
|
||||
if (!_evas_gl_x11_vi) return NULL;
|
||||
|
||||
|
||||
gw = calloc(1, sizeof(Evas_GL_X11_Window));
|
||||
if (!gw) return NULL;
|
||||
|
||||
|
||||
win_count++;
|
||||
gw->disp = disp;
|
||||
gw->win = win;
|
||||
|
@ -76,11 +76,11 @@ eng_window_new(Display *disp,
|
|||
{
|
||||
vi_use = _evas_gl_x11_rgba_vi;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
gw->visualinfo = vi_use;
|
||||
|
||||
|
||||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
|
||||
|
@ -137,7 +137,7 @@ eng_window_new(Display *disp,
|
|||
config_attrs[n++] = 1;
|
||||
config_attrs[n++] = EGL_BLUE_SIZE;
|
||||
config_attrs[n++] = 1;
|
||||
// FIXME: end n900 breakage
|
||||
// FIXME: end n900 breakage
|
||||
#endif
|
||||
if (gw->alpha)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ eng_window_new(Display *disp,
|
|||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
# endif
|
||||
|
||||
|
||||
gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)(gw->disp));
|
||||
if (!gw->egl_disp)
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ eng_window_new(Display *disp,
|
|||
eng_window_free(gw);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
num_config = 0;
|
||||
if (!eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config,
|
||||
1, &num_config) || (num_config != 1))
|
||||
|
@ -196,7 +196,7 @@ eng_window_new(Display *disp,
|
|||
return NULL;
|
||||
}
|
||||
if (context == EGL_NO_CONTEXT)
|
||||
context = eglCreateContext(gw->egl_disp, gw->egl_config, NULL,
|
||||
context = eglCreateContext(gw->egl_disp, gw->egl_config, NULL,
|
||||
context_attrs);
|
||||
gw->egl_context[0] = context;
|
||||
if (gw->egl_context[0] == EGL_NO_CONTEXT)
|
||||
|
@ -205,8 +205,8 @@ eng_window_new(Display *disp,
|
|||
eng_window_free(gw);
|
||||
return NULL;
|
||||
}
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
gw->egl_surface[0],
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
gw->egl_surface[0],
|
||||
gw->egl_surface[0],
|
||||
gw->egl_context[0]) == EGL_FALSE)
|
||||
{
|
||||
|
@ -227,18 +227,18 @@ eng_window_new(Display *disp,
|
|||
fprintf(stderr, "renderer: %s\n", renderer);
|
||||
fprintf(stderr, "version: %s\n", version);
|
||||
}
|
||||
// GLX
|
||||
// GLX
|
||||
#else
|
||||
if (!context)
|
||||
{
|
||||
#ifdef NEWGL
|
||||
#ifdef NEWGL
|
||||
if (indirect)
|
||||
context = glXCreateNewContext(gw->disp, fbconf,
|
||||
GLX_RGBA_TYPE, NULL,
|
||||
context = glXCreateNewContext(gw->disp, fbconf,
|
||||
GLX_RGBA_TYPE, NULL,
|
||||
GL_TRUE);
|
||||
else
|
||||
context = glXCreateNewContext(gw->disp, fbconf,
|
||||
GLX_RGBA_TYPE, NULL,
|
||||
context = glXCreateNewContext(gw->disp, fbconf,
|
||||
GLX_RGBA_TYPE, NULL,
|
||||
GL_FALSE);
|
||||
#else
|
||||
if (indirect)
|
||||
|
@ -251,12 +251,12 @@ eng_window_new(Display *disp,
|
|||
if ((gw->alpha) && (!rgba_context))
|
||||
{
|
||||
if (indirect)
|
||||
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
|
||||
GLX_RGBA_TYPE, context,
|
||||
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
|
||||
GLX_RGBA_TYPE, context,
|
||||
GL_TRUE);
|
||||
else
|
||||
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
|
||||
GLX_RGBA_TYPE, context,
|
||||
rgba_context = glXCreateNewContext(gw->disp, rgba_fbconf,
|
||||
GLX_RGBA_TYPE, context,
|
||||
GL_FALSE);
|
||||
}
|
||||
if (gw->alpha)
|
||||
|
@ -268,10 +268,10 @@ eng_window_new(Display *disp,
|
|||
eng_window_free(gw);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (gw->alpha) gw->context = rgba_context;
|
||||
else gw->context = context;
|
||||
#else
|
||||
#else
|
||||
gw->context = context;
|
||||
#endif
|
||||
|
||||
|
@ -288,7 +288,7 @@ eng_window_new(Display *disp,
|
|||
|
||||
if (gw->glxwin)
|
||||
{
|
||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||
gw->context))
|
||||
{
|
||||
printf("Error: glXMakeContextCurrent(%p, %p, %p, %p)\n", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
|
||||
|
@ -305,7 +305,7 @@ eng_window_new(Display *disp,
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FIXME: move this up to context creation
|
||||
|
||||
vendor = glGetString(GL_VENDOR);
|
||||
|
@ -363,7 +363,7 @@ eng_window_new(Display *disp,
|
|||
// version: 2.0 Mesa 7.8.2
|
||||
// or
|
||||
// vendor: Tungsten Graphics, Inc
|
||||
// renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20100330 DEVELOPMENT
|
||||
// renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20100330 DEVELOPMENT
|
||||
// version: 2.1 Mesa 7.9-devel
|
||||
// or (bad - software renderer)
|
||||
// vendor: Mesa Project
|
||||
|
@ -373,7 +373,7 @@ eng_window_new(Display *disp,
|
|||
// vendor: VMware, Inc.
|
||||
// renderer: Gallium 0.4 on softpipe
|
||||
// version: 2.1 Mesa 7.9-devel
|
||||
|
||||
|
||||
if (strstr((const char *)vendor, "Mesa Project"))
|
||||
{
|
||||
if (strstr((const char *)renderer, "Software Rasterizer"))
|
||||
|
@ -396,12 +396,12 @@ eng_window_new(Display *disp,
|
|||
{
|
||||
int v1 = 0, v2 = 0, v3 = 0;
|
||||
|
||||
if (sscanf((const char *)version,
|
||||
if (sscanf((const char *)version,
|
||||
"%*s %*s %i.%i.%i",
|
||||
&v1, &v2, &v3) != 3)
|
||||
{
|
||||
v1 = v2 = v3 = 0;
|
||||
if (sscanf((const char *)version,
|
||||
if (sscanf((const char *)version,
|
||||
"%*s %*s %i.%i",
|
||||
&v1, &v2) != 2)
|
||||
v1 = 0;
|
||||
|
@ -415,7 +415,7 @@ eng_window_new(Display *disp,
|
|||
{
|
||||
// noothing yet. add more cases and options over time
|
||||
}
|
||||
|
||||
|
||||
fbc = glXGetFBConfigs(gw->disp, screen, &num);
|
||||
if (!fbc)
|
||||
{
|
||||
|
@ -431,22 +431,22 @@ eng_window_new(Display *disp,
|
|||
int vd;
|
||||
int alph, val, dbuf, stencil, tdepth;
|
||||
int rgba;
|
||||
|
||||
|
||||
vi = glXGetVisualFromFBConfig(gw->disp, fbc[j]);
|
||||
if (!vi) continue;
|
||||
vd = vi->depth;
|
||||
XFree(vi);
|
||||
|
||||
|
||||
if (vd != i) continue;
|
||||
|
||||
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BUFFER_SIZE, &val);
|
||||
|
||||
|
||||
if ((val != i) && ((val - alph) != i)) continue;
|
||||
|
||||
|
||||
val = 0;
|
||||
rgba = 0;
|
||||
|
||||
|
||||
if (i == 32)
|
||||
{
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
|
||||
|
@ -463,32 +463,32 @@ eng_window_new(Display *disp,
|
|||
if (!val) continue;
|
||||
gw->depth_cfg[i].tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
|
||||
}
|
||||
|
||||
|
||||
dbuf = 0x7fff;
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
|
||||
if (val > dbuf) continue;
|
||||
dbuf = val;
|
||||
|
||||
|
||||
stencil = 0x7fff;
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
|
||||
if (val > stencil) continue;
|
||||
stencil = val;
|
||||
|
||||
|
||||
tdepth = 0x7fff;
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
|
||||
if (val > tdepth) continue;
|
||||
tdepth = val;
|
||||
|
||||
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
|
||||
if (val < 0) continue;
|
||||
gw->depth_cfg[i].mipmap = val;
|
||||
|
||||
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
|
||||
gw->depth_cfg[i].yinvert = val;
|
||||
|
||||
|
||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &val);
|
||||
gw->depth_cfg[i].tex_target = val;
|
||||
|
||||
|
||||
gw->depth_cfg[i].fbc = fbc[j];
|
||||
}
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ eng_window_new(Display *disp,
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
gw->gl_context = evas_gl_common_context_new();
|
||||
if (!gw->gl_context)
|
||||
{
|
||||
|
@ -508,7 +508,7 @@ eng_window_new(Display *disp,
|
|||
}
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
gw->gl_context->egldisp = gw->egl_disp;
|
||||
#endif
|
||||
#endif
|
||||
eng_window_use(gw);
|
||||
evas_gl_common_context_resize(gw->gl_context, w, h, rot);
|
||||
gw->surf = 1;
|
||||
|
@ -557,15 +557,15 @@ void
|
|||
eng_window_use(Evas_GL_X11_Window *gw)
|
||||
{
|
||||
Eina_Bool force_use = EINA_FALSE;
|
||||
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
if (_evas_gl_x11_window)
|
||||
{
|
||||
if ((eglGetCurrentContext() !=
|
||||
if ((eglGetCurrentContext() !=
|
||||
_evas_gl_x11_window->egl_context[0]) ||
|
||||
(eglGetCurrentSurface(EGL_READ) !=
|
||||
(eglGetCurrentSurface(EGL_READ) !=
|
||||
_evas_gl_x11_window->egl_surface[0]) ||
|
||||
(eglGetCurrentSurface(EGL_DRAW) !=
|
||||
(eglGetCurrentSurface(EGL_DRAW) !=
|
||||
_evas_gl_x11_window->egl_surface[0]))
|
||||
force_use = EINA_TRUE;
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ eng_window_use(Evas_GL_X11_Window *gw)
|
|||
if (glXGetCurrentContext() != _evas_gl_x11_window->context)
|
||||
force_use = EINA_TRUE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if ((_evas_gl_x11_window != gw) || (force_use))
|
||||
{
|
||||
if (_evas_gl_x11_window)
|
||||
|
@ -590,19 +590,19 @@ eng_window_use(Evas_GL_X11_Window *gw)
|
|||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
if (gw->egl_surface[0] != EGL_NO_SURFACE)
|
||||
{
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
gw->egl_surface[0],
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
gw->egl_surface[0],
|
||||
gw->egl_surface[0],
|
||||
gw->egl_context[0]) == EGL_FALSE)
|
||||
{
|
||||
ERR("eglMakeCurrent() failed!");
|
||||
}
|
||||
}
|
||||
// GLX
|
||||
// GLX
|
||||
#else
|
||||
if (gw->glxwin)
|
||||
{
|
||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||
gw->context))
|
||||
{
|
||||
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
|
||||
|
@ -667,8 +667,8 @@ eng_window_resurf(Evas_GL_X11_Window *gw)
|
|||
(unsigned int)gw->win, eglGetError());
|
||||
return;
|
||||
}
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
gw->egl_surface[0],
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
gw->egl_surface[0],
|
||||
gw->egl_surface[0],
|
||||
gw->egl_context[0]) == EGL_FALSE)
|
||||
{
|
||||
|
@ -680,18 +680,18 @@ eng_window_resurf(Evas_GL_X11_Window *gw)
|
|||
gw->glxwin = glXCreateWindow(gw->disp, rgba_fbconf, gw->win, NULL);
|
||||
else
|
||||
gw->glxwin = glXCreateWindow(gw->disp, fbconf, gw->win, NULL);
|
||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||
gw->context))
|
||||
{
|
||||
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
|
||||
}
|
||||
#else
|
||||
#else
|
||||
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
|
||||
{
|
||||
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", (void *)gw->disp, (unsigned int)gw->win, (void *)gw->context);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
gw->surf = 1;
|
||||
}
|
||||
|
||||
|
@ -703,7 +703,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
if (!_evas_gl_x11_vi)
|
||||
{
|
||||
int alpha;
|
||||
|
||||
|
||||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
for (alpha = 0; alpha < 2; alpha++)
|
||||
|
@ -715,7 +715,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
XVisualInfo *xvi, vi_in;
|
||||
int nvi, i;
|
||||
XRenderPictFormat *fmt;
|
||||
|
||||
|
||||
vi_in.screen = einfo->info.screen;
|
||||
vi_in.depth = 32;
|
||||
vi_in.class = TrueColor;
|
||||
|
@ -726,16 +726,16 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
if (xvi)
|
||||
{
|
||||
for (i = 0; i < nvi; i++)
|
||||
{
|
||||
fmt = XRenderFindVisualFormat(einfo->info.display,
|
||||
{
|
||||
fmt = XRenderFindVisualFormat(einfo->info.display,
|
||||
xvi[i].visual);
|
||||
if ((fmt->type == PictTypeDirect) &&
|
||||
if ((fmt->type == PictTypeDirect) &&
|
||||
(fmt->direct.alphaMask))
|
||||
{
|
||||
_evas_gl_x11_rgba_vi =
|
||||
_evas_gl_x11_rgba_vi =
|
||||
calloc(1, sizeof(XVisualInfo));
|
||||
if (_evas_gl_x11_rgba_vi)
|
||||
memcpy(_evas_gl_x11_rgba_vi,
|
||||
memcpy(_evas_gl_x11_rgba_vi,
|
||||
&(xvi[i]), sizeof(XVisualInfo));
|
||||
break;
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
int config_attrs[40];
|
||||
GLXFBConfig *configs = NULL, config = 0;
|
||||
int i, num;
|
||||
|
||||
|
||||
i = 0;
|
||||
config_attrs[i++] = GLX_DRAWABLE_TYPE;
|
||||
config_attrs[i++] = GLX_WINDOW_BIT;
|
||||
|
@ -793,8 +793,8 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
config_attrs[i++] = GLX_TRANSPARENT_TYPE;
|
||||
config_attrs[i++] = GLX_NONE;//GLX_NONE;//GLX_TRANSPARENT_INDEX//GLX_TRANSPARENT_RGB;
|
||||
config_attrs[i++] = 0;
|
||||
|
||||
configs = glXChooseFBConfig(einfo->info.display,
|
||||
|
||||
configs = glXChooseFBConfig(einfo->info.display,
|
||||
einfo->info.screen,
|
||||
config_attrs, &num);
|
||||
if ((!configs) || (num < 1))
|
||||
|
@ -806,8 +806,8 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
{
|
||||
XVisualInfo *visinfo;
|
||||
XRenderPictFormat *format = NULL;
|
||||
|
||||
visinfo = glXGetVisualFromFBConfig(einfo->info.display,
|
||||
|
||||
visinfo = glXGetVisualFromFBConfig(einfo->info.display,
|
||||
configs[i]);
|
||||
if (!visinfo) continue;
|
||||
if (!alpha)
|
||||
|
@ -849,11 +849,11 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
if (_evas_gl_x11_rgba_vi) return _evas_gl_x11_rgba_vi->visual;
|
||||
#else
|
||||
#else
|
||||
# ifdef NEWGL
|
||||
if (_evas_gl_x11_rgba_vi) return _evas_gl_x11_rgba_vi->visual;
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return _evas_gl_x11_vi->visual;
|
||||
}
|
||||
|
@ -868,24 +868,24 @@ eng_best_colormap_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
if (einfo->info.destination_alpha)
|
||||
{
|
||||
if (!_evas_gl_x11_rgba_cmap)
|
||||
_evas_gl_x11_rgba_cmap =
|
||||
_evas_gl_x11_rgba_cmap =
|
||||
XCreateColormap(einfo->info.display,
|
||||
RootWindow(einfo->info.display,
|
||||
einfo->info.screen),
|
||||
_evas_gl_x11_rgba_vi->visual,
|
||||
_evas_gl_x11_rgba_vi->visual,
|
||||
0);
|
||||
return _evas_gl_x11_rgba_cmap;
|
||||
}
|
||||
if (!_evas_gl_x11_cmap)
|
||||
_evas_gl_x11_cmap =
|
||||
_evas_gl_x11_cmap =
|
||||
XCreateColormap(einfo->info.display,
|
||||
RootWindow(einfo->info.display,
|
||||
einfo->info.screen),
|
||||
_evas_gl_x11_vi->visual,
|
||||
_evas_gl_x11_vi->visual,
|
||||
0);
|
||||
return _evas_gl_x11_cmap;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
eng_best_depth_get(Evas_Engine_Info_GL_X11 *einfo)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue