forked from enlightenment/efl
parent
b351ead33a
commit
97f6242fca
|
@ -77,7 +77,7 @@ _xr_image_info_get(Display *disp, Drawable draw, Visual *vis)
|
||||||
if (shm_info.shmid >= 0)
|
if (shm_info.shmid >= 0)
|
||||||
{
|
{
|
||||||
shm_info.shmaddr = xim->data = shmat(shm_info.shmid, 0, 0);
|
shm_info.shmaddr = xim->data = shmat(shm_info.shmid, 0, 0);
|
||||||
if (shm_info.shmaddr != NULL)
|
if ((shm_info.shmaddr != NULL) && (shm_info.shmaddr != -1))
|
||||||
{
|
{
|
||||||
XErrorHandler ph;
|
XErrorHandler ph;
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ _xr_image_new(Ximage_Info *xinf, int w, int h, int depth)
|
||||||
if (xim->shm_info->shmid >= 0)
|
if (xim->shm_info->shmid >= 0)
|
||||||
{
|
{
|
||||||
xim->shm_info->shmaddr = xim->xim->data = shmat(xim->shm_info->shmid, 0, 0);
|
xim->shm_info->shmaddr = xim->xim->data = shmat(xim->shm_info->shmid, 0, 0);
|
||||||
if (xim->shm_info->shmaddr != NULL)
|
if ((xim->shm_info->shmaddr != NULL) && (xim->shm_info->shmaddr != -1))
|
||||||
{
|
{
|
||||||
XErrorHandler ph;
|
XErrorHandler ph;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ _xr_render_surface_new(Ximage_Info *xinf, int w, int h, XRenderPictFormat *fmt,
|
||||||
rs->depth = fmt->depth;
|
rs->depth = fmt->depth;
|
||||||
rs->allocated = 1;
|
rs->allocated = 1;
|
||||||
rs->draw = XCreatePixmap(xinf->disp, xinf->root, w, h, fmt->depth);
|
rs->draw = XCreatePixmap(xinf->disp, xinf->root, w, h, fmt->depth);
|
||||||
|
rs->xinf->references++;
|
||||||
att.dither = 0;
|
att.dither = 0;
|
||||||
att.component_alpha = 0;
|
att.component_alpha = 0;
|
||||||
att.repeat = 0;
|
att.repeat = 0;
|
||||||
|
@ -46,6 +47,7 @@ _xr_render_surface_adopt(Ximage_Info *xinf, Drawable draw, int w, int h, int alp
|
||||||
if (fmt->depth == 32) rs->alpha = 1;
|
if (fmt->depth == 32) rs->alpha = 1;
|
||||||
rs->allocated = 0;
|
rs->allocated = 0;
|
||||||
rs->draw = draw;
|
rs->draw = draw;
|
||||||
|
rs->xinf->references++;
|
||||||
att.dither = 0;
|
att.dither = 0;
|
||||||
att.component_alpha = 0;
|
att.component_alpha = 0;
|
||||||
att.repeat = 0;
|
att.repeat = 0;
|
||||||
|
@ -67,6 +69,7 @@ _xr_render_surface_format_adopt(Ximage_Info *xinf, Drawable draw, int w, int h,
|
||||||
rs->alpha = alpha;
|
rs->alpha = alpha;
|
||||||
rs->depth = fmt->depth;
|
rs->depth = fmt->depth;
|
||||||
if (fmt->depth == 32) rs->alpha = 1;
|
if (fmt->depth == 32) rs->alpha = 1;
|
||||||
|
rs->xinf->references++;
|
||||||
rs->allocated = 0;
|
rs->allocated = 0;
|
||||||
rs->draw = draw;
|
rs->draw = draw;
|
||||||
att.dither = 0;
|
att.dither = 0;
|
||||||
|
@ -81,6 +84,8 @@ _xr_render_surface_free(Xrender_Surface *rs)
|
||||||
{
|
{
|
||||||
if (rs->allocated) XFreePixmap(rs->xinf->disp, rs->draw);
|
if (rs->allocated) XFreePixmap(rs->xinf->disp, rs->draw);
|
||||||
XRenderFreePicture(rs->xinf->disp, rs->pic);
|
XRenderFreePicture(rs->xinf->disp, rs->pic);
|
||||||
|
_xr_image_info_free(rs->xinf);
|
||||||
|
rs->xinf = NULL;
|
||||||
free(rs);
|
free(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue