(lo->scale_down_by == 0) &&
(lo->dpi == 0.0) &&
((lo->w == 0) || (lo->h == 0)) &&
- ((lo->region.w == 0) || (lo->region.w == 0))
+ ((lo->region.w == 0))
))
{
lo = &prevent;
Evas_Object_Textblock_Format_Item *fi;
int x2;
- x2 = (fmt->tabstops * ((c->x + fmt->tabstops) / fmt->tabstops));
- if (x2 >
+ x2 = c->x + fmt->tabstops;
+ /* Wrap lines if there's a size */
+ if ((c->w > 0) && (x2 >
(c->w - c->o->style_pad.l -
c->o->style_pad.r -
- c->marginl - c->marginr))
+ c->marginl - c->marginr)))
{
_layout_line_advance(c, fmt);
- x2 = (fmt->tabstops * ((c->x + fmt->tabstops) / fmt->tabstops));
+ x2 = c->x + fmt->tabstops;
}
if (c->ln->items)
{
* fancier in the future, atm it breaks if this char
* is inside <> */
_prepend_text_run(o, s, p);
- p += 2; /* it's also advanced later in this loop */
- s = NULL;
+ p += 2; /* it's also advanced later in this loop need +3
+ * in total*/
+ s = p + 1; /* One after the end of the replacement char */
}
p++;
}
*/
EAPI void
-evas_common_font_query_size(RGBA_Font *fn, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props, int *w, int *h)
+evas_common_font_query_size(RGBA_Font *fn, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props __UNUSED__, int *w, int *h)
{
int use_kerning;
int pen_x, pen_y;
*/
EAPI int
-evas_common_font_query_last_up_to_pos(RGBA_Font *fn, const Eina_Unicode *in_text, const Evas_BiDi_Props *intl_props, int x, int y)
+evas_common_font_query_last_up_to_pos(RGBA_Font *fn, const Eina_Unicode *in_text, const Evas_BiDi_Props *intl_props __UNUSED__, int x, int y)
{
int use_kerning;
int pen_x, pen_y;
void *data;
int data_size;
- int current_size;
-
+ unsigned int current_size;
+
struct {
int orig_upem;
FT_Face face;
#define SHAD_TEXUV2 3
#define SHAD_TEXUV3 4
-#define MAX_CUTOUT 512
-#define MAX_PIPES 128
-
typedef struct _Evas_GL_Program Evas_GL_Program;
typedef struct _Evas_GL_Program_Source Evas_GL_Program_Source;
typedef struct _Evas_GL_Shared Evas_GL_Shared;
Eina_Bool tex_rect : 1;
Eina_Bool sec_image_map : 1;
// tuning params - per gpu/cpu combo?
- int cutout_max;
- int pipes_max;
+#define MAX_CUTOUT 512
+#define DEF_CUTOUT 512
+
+// 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;
+ } cutout;
+ struct {
+ int max;
+ } pipes;
+ struct {
+ int max_alloc_size;
+ int max_alloc_alpha_size;
+ int max_w;
+ int max_h;
+ int slot_size;
+ } atlas;
+ } tune;
} info;
struct {
ext = glGetString(GL_EXTENSIONS);
if (ext)
{
- fprintf(stderr, "EXT:\n%s\n", ext);
+ if (getenv("EVAS_GL_INFO"))
+ fprintf(stderr, "EXT:\n%s\n", ext);
if ((strstr((char *)ext, "GL_ARB_texture_non_power_of_two")) ||
(strstr((char *)ext, "OES_texture_npot")) ||
(strstr((char *)ext, "GL_IMG_texture_npot")))
// magic numbers that are a result of imperical testing and getting
// "best case" performance across a range of systems
- shared->info.cutout_max = 512;
- shared->info.pipes_max = 32;
+ shared->info.tune.cutout.max = DEF_CUTOUT;
+ shared->info.tune.pipes.max = DEF_PIPES;
+ shared->info.tune.atlas.max_alloc_size = DEF_ATLAS_ALLOC;
+ shared->info.tune.atlas.max_alloc_alpha_size = DEF_ATLAS_ALLOC_ALPHA;
+ shared->info.tune.atlas.max_w = DEF_ATLAS_W;
+ shared->info.tune.atlas.max_h = DEF_ATLAS_H;
+ shared->info.tune.atlas.slot_size = DEF_ATLAS_SLOT;
// per gpu hacks. based on impirical measurement of some known gpu's
s = (const char *)glGetString(GL_RENDERER);
if (s)
{
if (strstr(s, "PowerVR SGX 540"))
- shared->info.pipes_max = 32;
+ shared->info.tune.pipes.max = DEF_PIPES_SGX_540;
else if (strstr(s, "NVIDIA Tegra"))
- shared->info.pipes_max = 1;
+ shared->info.tune.pipes.max = DEF_PIPES_TEGRA_2;
}
- if (getenv("EVAS_GL_CUTOUT_MAX"))
- shared->info.cutout_max = atoi(getenv("EVAS_GL_CUTOUT_MAX"));
- if (getenv("EVAS_GL_PIPES_MAX"))
- {
- shared->info.pipes_max = atoi(getenv("EVAS_GL_PIPES_MAX"));
- if (shared->info.pipes_max > MAX_PIPES)
- shared->info.pipes_max = MAX_PIPES;
- else if (shared->info.pipes_max < 1)
- shared->info.pipes_max = 1;
- }
-
- fprintf(stderr,
- "max tex size %ix%i\n"
- "max units %i\n"
- "non-power-2 tex %i\n"
- "rect tex %i\n"
- "bgra : %i\n"
- "max ansiotropic filtering: %3.3f\n"
- "egl sec map image: %i\n"
- "\n"
- "cutout max: %i\n"
- "pipes max: %i\n"
- ,
- (int)shared->info.max_texture_size, (int)shared->info.max_texture_size,
- (int)shared->info.max_texture_units,
- (int)shared->info.tex_npo2,
- (int)shared->info.tex_rect,
- (int)shared->info.bgra,
- (double)shared->info.anisotropic,
- (int)shared->info.sec_image_map,
-
- (int)shared->info.cutout_max,
- (int)shared->info.pipes_max
- );
+#define GETENVOPT(name, tune_param, min, max) \
+ do { \
+ const char *__v = getenv(name); \
+ if (__v) { \
+ shared->info.tune.tune_param = atoi(__v); \
+ if (shared->info.tune.tune_param > max) \
+ shared->info.tune.tune_param = max; \
+ else if (shared->info.tune.tune_param < min) \
+ shared->info.tune.tune_param = min; \
+ } \
+ } while (0)
+
+ GETENVOPT("EVAS_GL_CUTOUT_MAX", cutout.max, -1, 0x7fffffff);
+ GETENVOPT("EVAS_GL_PIPES_MAX", pipes.max, 1, MAX_PIPES);
+ GETENVOPT("EVAS_GL_ATLAS_ALLOC_SIZE", atlas.max_alloc_size, MIN_ATLAS_ALLOC, MAX_ATLAS_ALLOC);
+ GETENVOPT("EVAS_GL_ATLAS_ALLOC_ALPHA_SIZE", atlas.max_alloc_alpha_size, MIN_ATLAS_ALLOC_ALPHA, MAX_ATLAS_ALLOC_ALPHA);
+ GETENVOPT("EVAS_GL_ATLAS_MAX_W", atlas.max_w, 0, MAX_ATLAS_W);
+ GETENVOPT("EVAS_GL_ATLAS_MAX_H", atlas.max_h, 0, MAX_ATLAS_H);
+ GETENVOPT("EVAS_GL_ATLAS_SLOT_SIZE", atlas.slot_size, MIN_ATLAS_SLOT, MAX_ATLAS_SLOT);
+
+ if (getenv("EVAS_GL_INFO"))
+ fprintf(stderr,
+ "max tex size %ix%i\n"
+ "max units %i\n"
+ "non-power-2 tex %i\n"
+ "rect tex %i\n"
+ "bgra : %i\n"
+ "max ansiotropic filtering: %3.3f\n"
+ "egl sec map image: %i\n"
+ "max vertex count: %i\n"
+ "\n"
+ "(can set EVAS_GL_VERTEX_MAX EVAS_GL_NO_MAP_IMAGE_SEC EVAS_GL_INFO EVAS_GL_MEMINFO )\n"
+ "\n"
+ "EVAS_GL_CUTOUT_MAX: %i\n"
+ "EVAS_GL_PIPES_MAX: %i\n"
+ "EVAS_GL_ATLAS_ALLOC_SIZE: %i\n"
+ "EVAS_GL_ATLAS_ALLOC_ALPHA_SIZE: %i\n"
+ "EVAS_GL_ATLAS_MAX_W x EVAS_GL_ATLAS_MAX_H: %i x %i\n"
+ "EVAS_GL_ATLAS_SLOT_SIZE: %i\n"
+ ,
+ (int)shared->info.max_texture_size, (int)shared->info.max_texture_size,
+ (int)shared->info.max_texture_units,
+ (int)shared->info.tex_npo2,
+ (int)shared->info.tex_rect,
+ (int)shared->info.bgra,
+ (double)shared->info.anisotropic,
+ (int)shared->info.sec_image_map,
+
+ (int)shared->info.tune.cutout.max,
+ (int)shared->info.tune.pipes.max,
+ (int)shared->info.tune.atlas.max_alloc_size,
+ (int)shared->info.tune.atlas.max_alloc_alpha_size,
+ (int)shared->info.tune.atlas.max_w, (int)shared->info.tune.atlas.max_h,
+ (int)shared->info.tune.atlas.slot_size
+ );
glDisable(GL_DEPTH_TEST);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (gc->shared) gc->shared->references--;
if (gc->def_surface) evas_gl_common_image_free(gc->def_surface);
-
+
if (gc->shared)
{
- for (i = 0; i < gc->shared->info.pipes_max; i++)
- {
- if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
- if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
- if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
- if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2);
- if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
- }
+ for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
+ {
+ if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
+ if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
+ if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
+ if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2);
+ if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
+ }
}
if ((gc->shared) && (gc->shared->references == 0))
gc->state.current.cw = 0;
gc->state.current.ch = 0;
- for (i = 0; i < gc->shared->info.pipes_max; i++)
+ for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
{
gc->pipe[i].region.x = 0;
gc->pipe[i].region.y = 0;
if (!found)
{
pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.pipes_max)
+ if (pn >= gc->shared->info.tune.pipes.max)
{
shader_array_flush(gc);
goto again;
if (!found)
{
pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.pipes_max)
+ if (pn >= gc->shared->info.tune.pipes.max)
{
shader_array_flush(gc);
goto again;
if (!found)
{
pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.pipes_max)
+ if (pn >= gc->shared->info.tune.pipes.max)
{
shader_array_flush(gc);
goto again;
if (!found)
{
pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.pipes_max)
+ if (pn >= gc->shared->info.tune.pipes.max)
{
shader_array_flush(gc);
goto again;
if (!found)
{
pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.pipes_max)
+ if (pn >= gc->shared->info.tune.pipes.max)
{
shader_array_flush(gc);
goto again;
{
int i;
- for (i = 0; i < gc->shared->info.pipes_max; i++)
+ for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
{
if (gc->pipe[i].array.num <= 0) break;
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
- if (gc->pipe[i].shader.smooth != gc->state.current.smooth)
+ if ((gc->pipe[i].shader.smooth != gc->state.current.smooth) ||
+ (gc->pipe[i].shader.cur_tex != gc->state.current.cur_tex))
{
if (gc->pipe[i].shader.smooth)
{
EINA_LIST_FOREACH(gc->shared->images, l, im)
{
if (im->im) evas_cache_image_unload_data(&im->im->cache_entry);
- if (im->tex) evas_gl_common_texture_free(im->tex);
- im->tex = NULL;
+ if (im->tex)
+ {
+ if (!im->tex->pt->dyn.img)
+ {
+ evas_gl_common_texture_free(im->tex);
+ im->tex = NULL;
+ }
+ }
}
}
im->tex->im = im;
if ((!gc->dc->cutout.rects) ||
- ((gc->shared->info.cutout_max > 0) &&
- (gc->dc->cutout.active > gc->shared->info.cutout_max)))
+ ((gc->shared->info.tune.cutout.max > 0) &&
+ (gc->dc->cutout.active > gc->shared->info.tune.cutout.max)))
{
if (gc->dc->clip.use)
{
static const GLenum lum_fmt = GL_LUMINANCE;
static const GLenum lum_ifmt = GL_LUMINANCE;
+static struct {
+ struct {
+ int num, pix;
+ } c, a, v, r, n, d;
+} texinfo = {0};
+
+static void
+_print_tex_count(void)
+{
+ if (getenv("EVAS_GL_MEMINFO"))
+ {
+ fprintf(stderr,
+ "T: c:%i/%ik | a:%i/%ik | v:%i/%ik | r:%i/%ik | n:%i/%ik | d:%i/%ik\n",
+ texinfo.c.num, (texinfo.c.pix * 4) / 1024,
+ texinfo.a.num, (texinfo.a.pix ) / 1024,
+ texinfo.v.num, (texinfo.v.pix ) / 1024,
+ texinfo.r.num, (texinfo.r.pix * 4) / 1024,
+ texinfo.n.num, (texinfo.n.pix * 4) / 1024,
+ texinfo.d.num, (texinfo.d.pix * 4) / 1024
+ );
+ }
+}
+
static int
_nearest_pow2(int num)
{
{
if (!gc->shared->info.tex_npo2)
h = _nearest_pow2(h);
- return (h + 15) >> 4;
+ return (h + gc->shared->info.tune.atlas.slot_size - 1) /
+ gc->shared->info.tune.atlas.slot_size;
}
static int
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
if (!pt) return NULL;
- h = _tex_round_slot(gc, h) << 4;
+ h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
_tex_adjust(gc, &w, &h);
pt->gc = gc;
pt->w = w;
pt->format = format;
pt->dataformat = GL_UNSIGNED_BYTE;
pt->references = 0;
+
+ if (format == alpha_fmt)
+ {
+ texinfo.a.num++;
+ texinfo.a.pix += pt->w * pt->h;
+ }
+ else if (format == lum_fmt)
+ {
+ texinfo.v.num++;
+ texinfo.v.pix += pt->w * pt->h;
+ }
+ else
+ {
+ texinfo.c.num++;
+ texinfo.c.pix += pt->w * pt->h;
+ }
+
+ _print_tex_count();
+
glGenTextures(1, &(pt->texture));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, pt->texture);
Evas_GL_Texture_Pool *pt = NULL;
Eina_List *l;
int th, th2;
-
- if ((w > 512) || (h > 512))
+
+ 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) ||
+ (h > gc->shared->info.tune.atlas.max_h))
{
pt = _pool_tex_new(gc, w, h, intformat, format);
gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, pt);
if (im->cache_entry.flags.alpha)
{
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,
- &u, &v, &l_after, 1024);
+ tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
+ 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,
- &u, &v, &l_after, 1024);
+ tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
+ im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
+ &u, &v, &l_after,
+ gc->shared->info.tune.atlas.max_alloc_size);
tex->alpha = 1;
}
else
{
if (gc->shared->info.bgra)
- tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
- im->cache_entry.h + 1, bgr_ifmt, bgr_fmt,
- &u, &v, &l_after, 1024);
+ 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,
- im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
- &u, &v, &l_after, 1024);
+ 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,
- im->cache_entry.h + 1, rgb_ifmt, rgb_fmt,
- &u, &v, &l_after, 1024);
+ 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);
#endif
}
if (!tex->pt)
{
- memset(tex, 0x11, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x11, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
if (!pt) return NULL;
- h = _tex_round_slot(gc, h) << 4;
+ h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
_tex_adjust(gc, &w, &h);
pt->gc = gc;
pt->w = w;
# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
# 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);
if (im->native.target == GL_TEXTURE_RECTANGLE_ARB)
{
printf("REEEEEEEEECT\n");
+ pt->w = w;
+ pt->h = h;
}
else
#endif
pt->dataformat = GL_UNSIGNED_BYTE;
pt->references = 0;
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);
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
if (!pt) return NULL;
- h = _tex_round_slot(gc, h) << 4;
+ h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
_tex_adjust(gc, &w, &h);
pt->gc = gc;
pt->w = w;
pt->dataformat = GL_UNSIGNED_BYTE;
pt->render = 1;
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);
{
pt->references--;
if (pt->references != 0) return;
+
+ if (pt->format == alpha_fmt)
+ {
+ texinfo.a.num--;
+ texinfo.a.pix -= pt->w * pt->h;
+ }
+ else if (pt->format == lum_fmt)
+ {
+ texinfo.v.num--;
+ texinfo.v.pix -= pt->w * pt->h;
+ }
+ else if (pt->dyn.img)
+ {
+ texinfo.d.num--;
+ texinfo.d.pix -= pt->w * pt->h;
+ }
+ else if (pt->render)
+ {
+ texinfo.r.num--;
+ texinfo.r.pix -= pt->w * pt->h;
+ }
+ else if (pt->native)
+ {
+ texinfo.n.num--;
+ texinfo.n.pix -= pt->w * pt->h;
+ }
+ else
+ {
+ texinfo.c.num--;
+ texinfo.c.pix -= pt->w * pt->h;
+ }
+
+ _print_tex_count();
+
if (!((pt->render) || (pt->native)))
{
if (pt->whole)
glsym_glDeleteFramebuffers(1, &(pt->fb));
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
- memset(pt, 0x22, sizeof(Evas_GL_Texture_Pool)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(pt, 0x22, sizeof(Evas_GL_Texture_Pool));
free(pt);
}
}
if (!tex->pt)
{
- memset(tex, 0x33, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x33, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
}
if (!tex->pt)
{
- memset(tex, 0x44, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x44, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
}
if (!tex->pt)
{
- memset(tex, 0x44, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x55, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
}
if (tex->ptu) pt_unref(tex->ptu);
if (tex->ptv) pt_unref(tex->ptv);
- memset(tex, 0x55, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x66, sizeof(Evas_GL_Texture));
free(tex);
}
Evas_GL_Texture *tex;
Eina_List *l_after = NULL;
int u = 0, v = 0;
- int tw = 4096;
tex = calloc(1, sizeof(Evas_GL_Texture));
if (!tex) return NULL;
tex->gc = gc;
tex->references = 1;
- if (tw > gc->shared->info.max_texture_size)
- tw = gc->shared->info.max_texture_size;
- tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v,
- &l_after, tw);
+ tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v,
+ &l_after,
+ gc->shared->info.tune.atlas.max_alloc_alpha_size);
if (!tex->pt)
{
- memset(tex, 0x66, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x77, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
tex->pt = _pool_tex_new(gc, w + 1, h + 1, lum_ifmt, lum_fmt);
if (!tex->pt)
{
- memset(tex, 0x77, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x88, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
if (!tex->ptu)
{
pt_unref(tex->pt);
- memset(tex, 0x88, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0x99, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
{
pt_unref(tex->pt);
pt_unref(tex->ptu);
- memset(tex, 0x99, sizeof(Evas_GL_Texture)); // mark as freed
+ // FIXME: mark as freed for now with 0x66, but this is me TRYING to
+ // find some mysterious bug i simply have been unable to catch or
+ // reproduce - so leave a trail and see how it goes.
+ memset(tex, 0xaa, sizeof(Evas_GL_Texture));
free(tex);
return NULL;
}
struct { // xres - dpi
int dpi; // xres - dpi
} xr; // xres - dpi
+
+ int w, h;
};
static int initted = 0;
}
static int
+_re_wincheck(Render_Engine *re)
+{
+ if (re->win->surf) return 1;
+ eng_window_resurf(re->win);
+ if (!re->win->surf)
+ {
+ fprintf(stderr, "ERROR: GL engine can't re-create window surface!\n");
+ }
+ return 0;
+}
+
+static void
+_re_winfree(Render_Engine *re)
+{
+ if (!re->win->surf) return;
+ eng_window_unsurf(re->win);
+}
+
+static int
eng_setup(Evas *e, void *in)
{
Render_Engine *re;
re->info = info;
re->evas = e;
e->engine.data.output = re;
- re->win = eng_window_new(info->info.display,
- info->info.drawable,
- info->info.screen,
- info->info.visual,
- info->info.colormap,
- info->info.depth,
- e->output.w,
- e->output.h,
- info->indirect,
- info->info.destination_alpha,
- info->info.rotation);
+ re->w = e->output.w;
+ re->h = e->output.h;
+ re->win = eng_window_new(re->info->info.display,
+ re->info->info.drawable,
+ re->info->info.screen,
+ re->info->info.visual,
+ re->info->info.colormap,
+ re->info->info.depth,
+ re->w,
+ re->h,
+ re->info->indirect,
+ re->info->info.destination_alpha,
+ re->info->info.rotation);
if (!re->win)
{
free(re);
status = xrdb_user_query("Xft.dpi", "Xft.Dpi", &type, &val);
if ((!status) || (!type))
{
- if (!re->xrdb) re->xrdb = XrmGetDatabase(info->info.display);
+ if (!re->xrdb) re->xrdb = XrmGetDatabase(re->info->info.display);
if (re->xrdb)
status = XrmGetResource(re->xrdb,
"Xft.dpi", "Xft.Dpi", &type, &val);
else
{
re = e->engine.data.output;
- if ((info->info.display != re->win->disp) ||
- (info->info.drawable != re->win->win) ||
- (info->info.screen != re->win->screen) ||
- (info->info.visual != re->win->visual) ||
- (info->info.colormap != re->win->colormap) ||
- (info->info.depth != re->win->depth) ||
- (info->info.destination_alpha != re->win->alpha) ||
- (info->info.rotation != re->win->rot))
+ if (_re_wincheck(re))
{
- int inc = 0;
-
- if (re->win)
+ if ((re->info->info.display != re->win->disp) ||
+ (re->info->info.drawable != re->win->win) ||
+ (re->info->info.screen != re->win->screen) ||
+ (re->info->info.visual != re->win->visual) ||
+ (re->info->info.colormap != re->win->colormap) ||
+ (re->info->info.depth != re->win->depth) ||
+ (re->info->info.destination_alpha != re->win->alpha) ||
+ (re->info->info.rotation != re->win->rot))
{
- re->win->gl_context->references++;
- eng_window_free(re->win);
- inc = 1;
- gl_wins--;
+ int inc = 0;
+
+ if (re->win)
+ {
+ re->win->gl_context->references++;
+ eng_window_free(re->win);
+ inc = 1;
+ gl_wins--;
+ }
+ re->w = e->output.w;
+ re->h = e->output.h;
+ re->win = eng_window_new(re->info->info.display,
+ re->info->info.drawable,
+ re->info->info.screen,
+ re->info->info.visual,
+ re->info->info.colormap,
+ re->info->info.depth,
+ re->w,
+ re->h,
+ re->info->indirect,
+ re->info->info.destination_alpha,
+ re->info->info.rotation);
+ if (re->win) gl_wins++;
+ if ((re->win) && (inc))
+ re->win->gl_context->references--;
}
- re->win = eng_window_new(info->info.display,
- info->info.drawable,
- info->info.screen,
- info->info.visual,
- info->info.colormap,
- info->info.depth,
- e->output.w,
- e->output.h,
- info->indirect,
- info->info.destination_alpha,
- info->info.rotation);
- if (re->win) gl_wins++;
- if ((re->win) && (inc))
- re->win->gl_context->references--;
- }
- else if ((re->win->w != e->output.w) ||
- (re->win->h != e->output.h))
- {
- re->win->w = e->output.w;
- re->win->h = e->output.h;
- eng_window_use(re->win);
- evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
- }
- // added by gl77.lee
- else if (info->no_swap == 1)
- {
- info->num_deferred_swaps = 0;
- }
- else if (info->no_swap == 0)
- {
- if (info->num_deferred_swaps > 0)
+ else if ((re->win->w != e->output.w) ||
+ (re->win->h != e->output.h))
{
-#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
- if (re->win->egl_disp && re->win->egl_surface[0])
- eglSwapBuffers(re->win->egl_disp, re->win->egl_surface[0]);
-#else
- if (re->win->disp && re->win->win)
- glXSwapBuffers(re->win->disp, re->win->win);
-#endif
- info->num_deferred_swaps = 0;
+ re->w = e->output.w;
+ re->h = e->output.h;
+ re->win->w = e->output.w;
+ re->win->h = e->output.h;
+ eng_window_use(re->win);
+ evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
}
+ // added by gl77.lee
+ else if (info->no_swap == 1)
+ {
+ info->num_deferred_swaps = 0;
+ }
+ else if (info->no_swap == 0)
+ {
+ if (info->num_deferred_swaps > 0)
+ {
+ #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ if (re->win->egl_disp && re->win->egl_surface[0])
+ eglSwapBuffers(re->win->egl_disp, re->win->egl_surface[0]);
+ #else
+ if (re->win->disp && re->win->win)
+ glXSwapBuffers(re->win->disp, re->win->win);
+ #endif
+ info->num_deferred_swaps = 0;
+ }
+ }
}
-
}
if (!re->win)
{
re = (Render_Engine *)data;
/* get the upate rect surface - return engine data as dummy */
if (!re->win->draw.redraw) return NULL;
+ if (!_re_wincheck(re)) return NULL;
evas_gl_common_context_flush(re->win->gl_context);
eng_window_use(re->win);
evas_gl_common_context_newframe(re->win->gl_context);
re = (Render_Engine *)data;
/* put back update surface.. in this case just unflag redraw */
+ if (!_re_wincheck(re)) return;
re->win->draw.redraw = 0;
re->win->draw.drew = 1;
evas_gl_common_context_flush(re->win->gl_context);
Render_Engine *re;
re = (Render_Engine *)data;
+ if (!_re_wincheck(re)) return;
if (!re->win->draw.drew) return;
//x// printf("frame -> flush\n");
re->win->draw.drew = 0;
evas_common_image_image_all_unload();
evas_common_font_font_all_unload();
evas_gl_common_image_all_unload(re->win->gl_context);
+ _re_winfree(re);
}
static void
uint32_t pmid;
if (!im) return NULL;
+
if (ns)
{
vis = ns->data.x11.visual;
static void
eng_image_size_get(void *data, void *image, int *w, int *h)
{
-// Render_Engine *re;
-//
-// re = (Render_Engine *)data;
if (!image)
{
*w = 0;