forked from enlightenment/efl
parent
0f042bcbd4
commit
de7384f549
|
@ -681,21 +681,26 @@ evas_engine_xrender_x11_image_size_set(void *data, void *image, int w, int h)
|
|||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return image;
|
||||
if ((w <= 0) || (h <= 0))
|
||||
{
|
||||
_xre_image_free((XR_Image *)image);
|
||||
return NULL;
|
||||
}
|
||||
if (((XR_Image *)image)->references > 1)
|
||||
{
|
||||
XR_Image *old_image;
|
||||
|
||||
old_image = (XR_Image *)image;
|
||||
image = _xre_image_copy((XR_Image *)old_image);
|
||||
if (image)
|
||||
{
|
||||
_xre_image_free(old_image);
|
||||
}
|
||||
else
|
||||
_xre_image_dirty((XR_Image *)image);
|
||||
if ((w <= 0) || (h <= 0))
|
||||
{
|
||||
_xre_image_free((XR_Image *)image);
|
||||
return NULL;
|
||||
image = old_image;
|
||||
}
|
||||
else
|
||||
_xre_image_dirty((XR_Image *)image);
|
||||
_xre_image_resize((XR_Image *)image, w, h);
|
||||
return image;
|
||||
}
|
||||
|
@ -713,8 +718,13 @@ evas_engine_xrender_x11_image_dirty_region(void *data, void *image, int x, int y
|
|||
|
||||
old_image = (XR_Image *)image;
|
||||
image = _xre_image_copy((XR_Image *)old_image);
|
||||
if (image)
|
||||
{
|
||||
_xre_image_free(old_image);
|
||||
}
|
||||
else
|
||||
image = old_image;
|
||||
}
|
||||
else
|
||||
_xre_image_dirty((XR_Image *)image);
|
||||
_xre_image_region_dirty((XR_Image *)image, x, y, w, h);
|
||||
|
@ -737,7 +747,9 @@ evas_engine_xrender_x11_image_data_get(void *data, void *image, int to_write, DA
|
|||
old_image = (XR_Image *)image;
|
||||
image = _xre_image_copy((XR_Image *)old_image);
|
||||
if (image)
|
||||
{
|
||||
_xre_image_free(old_image);
|
||||
}
|
||||
else
|
||||
image = old_image;
|
||||
}
|
||||
|
@ -786,8 +798,14 @@ evas_engine_xrender_x11_image_alpha_set(void *data, void *image, int has_alpha)
|
|||
|
||||
old_image = (XR_Image *)image;
|
||||
image = _xre_image_copy((XR_Image *)old_image);
|
||||
if (image)
|
||||
{
|
||||
((XR_Image *)image)->alpha = old_image->alpha;
|
||||
_xre_image_free(old_image);
|
||||
}
|
||||
else
|
||||
image = old_image;
|
||||
}
|
||||
else
|
||||
_xre_image_dirty((XR_Image *)image);
|
||||
_xre_image_alpha_set((XR_Image *)image, has_alpha);
|
||||
|
|
|
@ -48,7 +48,10 @@ _xre_image_load(Ximage_Info *xinf, char *file, char *key)
|
|||
else
|
||||
snprintf(buf, sizeof(buf), "/@%p@%x@/%s", xinf->disp, xinf->root, file);
|
||||
im = __xre_image_find(buf);
|
||||
if (im) return im;
|
||||
if (im)
|
||||
{
|
||||
return im;
|
||||
}
|
||||
|
||||
im = calloc(1, sizeof(XR_Image));
|
||||
if (!im) return NULL;
|
||||
|
@ -179,7 +182,9 @@ _xre_image_free(XR_Image *im)
|
|||
_xre_image_cache_set(_xr_image_cache_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
__xre_image_real_free(im);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue