forked from enlightenment/efl
parent
9e55698aec
commit
c049c0e12b
|
@ -847,31 +847,31 @@ eng_setup(Evas *e, void *in)
|
|||
#else
|
||||
int eb, evb;
|
||||
|
||||
if (!glXQueryExtension(info->info.display, &eb, &evb)) return 0;
|
||||
if (!glXQueryExtension(info->info.display, &eb, &evb)) return 0;
|
||||
#endif
|
||||
re = calloc(1, sizeof(Render_Engine));
|
||||
if (!re) return 0;
|
||||
re = calloc(1, sizeof(Render_Engine));
|
||||
if (!re) return 0;
|
||||
re->info = info;
|
||||
re->evas = e;
|
||||
e->engine.data.output = re;
|
||||
e->engine.data.output = re;
|
||||
re->w = e->output.w;
|
||||
re->h = e->output.h;
|
||||
re->win = eng_window_new(re->info->info.display,
|
||||
re->info->info.drawable,
|
||||
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->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);
|
||||
e->engine.data.output = NULL;
|
||||
return 0;
|
||||
if (!re->win)
|
||||
{
|
||||
free(re);
|
||||
e->engine.data.output = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
gl_wins++;
|
||||
|
@ -955,7 +955,7 @@ eng_setup(Evas *e, void *in)
|
|||
}
|
||||
else
|
||||
{
|
||||
re = e->engine.data.output;
|
||||
re = e->engine.data.output;
|
||||
if (_re_wincheck(re))
|
||||
{
|
||||
if ((re->info->info.display != re->win->disp) ||
|
||||
|
@ -1672,34 +1672,34 @@ eng_image_colorspace_set(void *data, void *image, int cspace)
|
|||
switch (cspace)
|
||||
{
|
||||
case EVAS_COLORSPACE_ARGB8888:
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
im->cs.data = NULL;
|
||||
im->cs.no_free = 0;
|
||||
}
|
||||
break;
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
im->cs.data = NULL;
|
||||
im->cs.no_free = 0;
|
||||
}
|
||||
break;
|
||||
case EVAS_COLORSPACE_YCBCR422P601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR422P709_PL:
|
||||
case EVAS_COLORSPACE_YCBCR422601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420NV12601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420TM12601_PL:
|
||||
if (im->tex) evas_gl_common_texture_free(im->tex);
|
||||
im->tex = NULL;
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
}
|
||||
if (im->im->cache_entry.h > 0)
|
||||
im->cs.data =
|
||||
calloc(1, im->im->cache_entry.h * sizeof(unsigned char *) * 2);
|
||||
else
|
||||
im->cs.data = NULL;
|
||||
im->cs.no_free = 0;
|
||||
break;
|
||||
if (im->tex) evas_gl_common_texture_free(im->tex);
|
||||
im->tex = NULL;
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
}
|
||||
if (im->im->cache_entry.h > 0)
|
||||
im->cs.data =
|
||||
calloc(1, im->im->cache_entry.h * sizeof(unsigned char *) * 2);
|
||||
else
|
||||
im->cs.data = NULL;
|
||||
im->cs.no_free = 0;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
im->cs.space = cspace;
|
||||
}
|
||||
|
@ -2293,9 +2293,9 @@ eng_image_size_get(void *data __UNUSED__, void *image, int *w, int *h)
|
|||
{
|
||||
if (!image)
|
||||
{
|
||||
*w = 0;
|
||||
*h = 0;
|
||||
return;
|
||||
*w = 0;
|
||||
*h = 0;
|
||||
return;
|
||||
}
|
||||
if (w) *w = ((Evas_GL_Image *)image)->w;
|
||||
if (h) *h = ((Evas_GL_Image *)image)->h;
|
||||
|
@ -2345,10 +2345,10 @@ eng_image_size_set(void *data, void *image, int w, int h)
|
|||
return image;
|
||||
if (im_old)
|
||||
{
|
||||
im = evas_gl_common_image_new(re->win->gl_context, w, h,
|
||||
eng_image_alpha_get(data, image),
|
||||
eng_image_colorspace_get(data, image));
|
||||
/*
|
||||
im = evas_gl_common_image_new(re->win->gl_context, w, h,
|
||||
eng_image_alpha_get(data, image),
|
||||
eng_image_colorspace_get(data, image));
|
||||
/*
|
||||
evas_common_load_image_data_from_file(im_old->im);
|
||||
if (im_old->im->image->data)
|
||||
{
|
||||
|
@ -2387,9 +2387,9 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
|
|||
re = (Render_Engine *)data;
|
||||
if (!image)
|
||||
{
|
||||
*image_data = NULL;
|
||||
*image_data = NULL;
|
||||
if (err) *err = EVAS_LOAD_ERROR_GENERIC;
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
im = image;
|
||||
if (im->native.data)
|
||||
|
@ -2441,41 +2441,41 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
|
|||
switch (im->cs.space)
|
||||
{
|
||||
case EVAS_COLORSPACE_ARGB8888:
|
||||
if (to_write)
|
||||
{
|
||||
if (im->references > 1)
|
||||
{
|
||||
Evas_GL_Image *im_new;
|
||||
if (to_write)
|
||||
{
|
||||
if (im->references > 1)
|
||||
{
|
||||
Evas_GL_Image *im_new;
|
||||
|
||||
im_new = evas_gl_common_image_new_from_copied_data
|
||||
(im->gc, im->im->cache_entry.w, im->im->cache_entry.h,
|
||||
im->im->image.data,
|
||||
eng_image_alpha_get(data, image),
|
||||
eng_image_colorspace_get(data, image));
|
||||
if (!im_new)
|
||||
{
|
||||
*image_data = NULL;
|
||||
if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
return NULL;
|
||||
}
|
||||
evas_gl_common_image_free(im);
|
||||
im = im_new;
|
||||
}
|
||||
else
|
||||
evas_gl_common_image_dirty(im, 0, 0, 0, 0);
|
||||
}
|
||||
*image_data = im->im->image.data;
|
||||
break;
|
||||
im_new = evas_gl_common_image_new_from_copied_data
|
||||
(im->gc, im->im->cache_entry.w, im->im->cache_entry.h,
|
||||
im->im->image.data,
|
||||
eng_image_alpha_get(data, image),
|
||||
eng_image_colorspace_get(data, image));
|
||||
if (!im_new)
|
||||
{
|
||||
*image_data = NULL;
|
||||
if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
return NULL;
|
||||
}
|
||||
evas_gl_common_image_free(im);
|
||||
im = im_new;
|
||||
}
|
||||
else
|
||||
evas_gl_common_image_dirty(im, 0, 0, 0, 0);
|
||||
}
|
||||
*image_data = im->im->image.data;
|
||||
break;
|
||||
case EVAS_COLORSPACE_YCBCR422P601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR422P709_PL:
|
||||
case EVAS_COLORSPACE_YCBCR422601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420NV12601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420TM12601_PL:
|
||||
*image_data = im->cs.data;
|
||||
break;
|
||||
*image_data = im->cs.data;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
if (err) *err = error;
|
||||
return im;
|
||||
|
@ -2502,7 +2502,7 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
|
|||
glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
|
||||
#endif
|
||||
if (im->tex->pt->dyn.data == image_data)
|
||||
return image;
|
||||
return image;
|
||||
|
||||
w = im->im->cache_entry.w;
|
||||
h = im->im->cache_entry.h;
|
||||
|
@ -2518,38 +2518,38 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
|
|||
switch (im->cs.space)
|
||||
{
|
||||
case EVAS_COLORSPACE_ARGB8888:
|
||||
if (image_data != im->im->image.data)
|
||||
{
|
||||
int w, h;
|
||||
if (image_data != im->im->image.data)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
w = im->im->cache_entry.w;
|
||||
h = im->im->cache_entry.h;
|
||||
im2 = eng_image_new_from_data(data, w, h, image_data,
|
||||
eng_image_alpha_get(data, image),
|
||||
eng_image_colorspace_get(data, image));
|
||||
if (!im2) return im;
|
||||
evas_gl_common_image_free(im);
|
||||
im = im2;
|
||||
}
|
||||
break;
|
||||
w = im->im->cache_entry.w;
|
||||
h = im->im->cache_entry.h;
|
||||
im2 = eng_image_new_from_data(data, w, h, image_data,
|
||||
eng_image_alpha_get(data, image),
|
||||
eng_image_colorspace_get(data, image));
|
||||
if (!im2) return im;
|
||||
evas_gl_common_image_free(im);
|
||||
im = im2;
|
||||
}
|
||||
break;
|
||||
case EVAS_COLORSPACE_YCBCR422P601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR422P709_PL:
|
||||
case EVAS_COLORSPACE_YCBCR422601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420NV12601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420TM12601_PL:
|
||||
if (image_data != im->cs.data)
|
||||
{
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
}
|
||||
im->cs.data = image_data;
|
||||
}
|
||||
evas_gl_common_image_dirty(im, 0, 0, 0, 0);
|
||||
break;
|
||||
if (image_data != im->cs.data)
|
||||
{
|
||||
if (im->cs.data)
|
||||
{
|
||||
if (!im->cs.no_free) free(im->cs.data);
|
||||
}
|
||||
im->cs.data = image_data;
|
||||
}
|
||||
evas_gl_common_image_dirty(im, 0, 0, 0, 0);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
return im;
|
||||
}
|
||||
|
@ -2744,24 +2744,24 @@ eng_font_draw(void *data, void *context, void *surface, Evas_Font_Set *font, int
|
|||
re->win->gl_context->dc = context;
|
||||
{
|
||||
// FIXME: put im into context so we can free it
|
||||
static RGBA_Image *im = NULL;
|
||||
static RGBA_Image *im = NULL;
|
||||
|
||||
if (!im)
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im->cache_entry.w = re->win->w;
|
||||
im->cache_entry.h = re->win->h;
|
||||
evas_common_draw_context_font_ext_set(context,
|
||||
re->win->gl_context,
|
||||
evas_gl_font_texture_new,
|
||||
evas_gl_font_texture_free,
|
||||
evas_gl_font_texture_draw);
|
||||
evas_common_font_draw(im, context, (RGBA_Font *) font, x, y,
|
||||
re->win->gl_context,
|
||||
evas_gl_font_texture_new,
|
||||
evas_gl_font_texture_free,
|
||||
evas_gl_font_texture_draw);
|
||||
evas_common_font_draw(im, context, (RGBA_Font *) font, x, y,
|
||||
intl_props);
|
||||
evas_common_draw_context_font_ext_set(context,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
evas_common_draw_context_font_ext_set(context,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3828,8 +3828,8 @@ module_open(Evas_Module *em)
|
|||
static Eina_Bool xrm_inited = EINA_FALSE;
|
||||
if (!xrm_inited)
|
||||
{
|
||||
xrm_inited = EINA_TRUE;
|
||||
XrmInitialize();
|
||||
xrm_inited = EINA_TRUE;
|
||||
XrmInitialize();
|
||||
}
|
||||
|
||||
if (!em) return 0;
|
||||
|
|
Loading…
Reference in New Issue