forked from enlightenment/efl
add in lots of ptr checks to sw-x11 outbut code... this may only
happen if we ran out of mem and mallocs failed... but we can avoid a crash. SVN revision: 58797
This commit is contained in:
parent
3b167a62f5
commit
b1285ae71a
|
@ -40,7 +40,6 @@ _find_xcbob(xcb_connection_t *conn, int depth, int w, int h, int shm, void *data
|
||||||
int lbytes;
|
int lbytes;
|
||||||
int bpp;
|
int bpp;
|
||||||
|
|
||||||
// return evas_software_xcb_x_output_buffer_new(d, v, depth, w, h, shm, data);
|
|
||||||
if (!shm)
|
if (!shm)
|
||||||
return evas_software_xcb_x_output_buffer_new(conn, depth, w, h, shm, data);
|
return evas_software_xcb_x_output_buffer_new(conn, depth, w, h, shm, data);
|
||||||
if (depth > 1)
|
if (depth > 1)
|
||||||
|
@ -92,7 +91,6 @@ _find_xcbob(xcb_connection_t *conn, int depth, int w, int h, int shm, void *data
|
||||||
static void
|
static void
|
||||||
_unfind_xcbob(Xcb_Output_Buffer *xcbob, int sync)
|
_unfind_xcbob(Xcb_Output_Buffer *xcbob, int sync)
|
||||||
{
|
{
|
||||||
// evas_software_xcb_x_output_buffer_free(xcbob, sync); return;
|
|
||||||
if (xcbob->shm_info)
|
if (xcbob->shm_info)
|
||||||
{
|
{
|
||||||
shmpool = eina_list_prepend(shmpool, xcbob);
|
shmpool = eina_list_prepend(shmpool, xcbob);
|
||||||
|
@ -398,8 +396,14 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
Eina_Rectangle *rect;
|
Eina_Rectangle *rect;
|
||||||
|
|
||||||
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
|
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
|
||||||
|
obr = calloc(1, sizeof(Outbuf_Region));
|
||||||
|
if (!obr) return NULL;
|
||||||
rect = eina_rectangle_new(x, y, w, h);
|
rect = eina_rectangle_new(x, y, w, h);
|
||||||
if (!rect) return NULL;
|
if (!rect)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect);
|
buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect);
|
||||||
if (buf->priv.onebuf)
|
if (buf->priv.onebuf)
|
||||||
|
@ -416,7 +420,6 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
}
|
}
|
||||||
return buf->priv.onebuf;
|
return buf->priv.onebuf;
|
||||||
}
|
}
|
||||||
obr = calloc(1, sizeof(Outbuf_Region));
|
|
||||||
obr->x = 0;
|
obr->x = 0;
|
||||||
obr->y = 0;
|
obr->y = 0;
|
||||||
obr->w = buf->w;
|
obr->w = buf->w;
|
||||||
|
@ -439,21 +442,37 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
buf->w, buf->h,
|
buf->w, buf->h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xcbob)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
||||||
buf->w, buf->h,
|
buf->w, buf->h,
|
||||||
(DATA32 *)evas_software_xcb_x_output_buffer_data(obr->xcbob, &bpl),
|
(DATA32 *)evas_software_xcb_x_output_buffer_data(obr->xcbob, &bpl),
|
||||||
alpha, EVAS_COLORSPACE_ARGB8888);
|
alpha, EVAS_COLORSPACE_ARGB8888);
|
||||||
im->extended_info = obr;
|
if (!im)
|
||||||
if (buf->priv.x11.xcb.mask)
|
{
|
||||||
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
evas_software_xcb_x_output_buffer_free(obr->xcbob, 0);
|
||||||
1,
|
free(obr);
|
||||||
buf->w, buf->h,
|
return NULL;
|
||||||
use_shm,
|
}
|
||||||
NULL);
|
im->extended_info = obr;
|
||||||
|
if (buf->priv.x11.xcb.mask)
|
||||||
|
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||||
|
1,
|
||||||
|
buf->w, buf->h,
|
||||||
|
use_shm,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
|
im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
||||||
evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
|
evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
|
||||||
im->extended_info = obr;
|
im->extended_info = obr;
|
||||||
|
@ -464,6 +483,12 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
buf->w, buf->h,
|
buf->w, buf->h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xcbob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xcb.mask)
|
if (buf->priv.x11.xcb.mask)
|
||||||
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||||
1,
|
1,
|
||||||
|
@ -478,6 +503,12 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
buf->h, buf->w,
|
buf->h, buf->w,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xcbob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xcb.mask)
|
if (buf->priv.x11.xcb.mask)
|
||||||
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||||
1,
|
1,
|
||||||
|
@ -488,9 +519,11 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
}
|
}
|
||||||
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
||||||
we copy too much to the destination surface and some area are not cleaned before copy. */
|
we copy too much to the destination surface and some area are not cleaned before copy. */
|
||||||
if (alpha)
|
if ((alpha) && (im->image.data))
|
||||||
/* FIXME: faster memset! */
|
{
|
||||||
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
/* FIXME: faster memset! */
|
||||||
|
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
||||||
|
}
|
||||||
|
|
||||||
buf->priv.onebuf = im;
|
buf->priv.onebuf = im;
|
||||||
return im;
|
return im;
|
||||||
|
@ -498,6 +531,7 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
|
|
||||||
|
|
||||||
obr = calloc(1, sizeof(Outbuf_Region));
|
obr = calloc(1, sizeof(Outbuf_Region));
|
||||||
|
if (!obr) return NULL;
|
||||||
obr->x = x;
|
obr->x = x;
|
||||||
obr->y = y;
|
obr->y = y;
|
||||||
obr->w = w;
|
obr->w = w;
|
||||||
|
@ -526,27 +560,37 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
w, h,
|
w, h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
if (!obr->xcbob)
|
||||||
w, h,
|
{
|
||||||
(DATA32 *) evas_software_xcb_x_output_buffer_data(obr->xcbob, &bpl),
|
free(obr);
|
||||||
alpha, EVAS_COLORSPACE_ARGB8888);
|
return NULL;
|
||||||
im->extended_info = obr;
|
}
|
||||||
|
im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
|
||||||
|
w, h,
|
||||||
|
(DATA32 *) evas_software_xcb_x_output_buffer_data(obr->xcbob, &bpl),
|
||||||
|
alpha, EVAS_COLORSPACE_ARGB8888);
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
_unfind_xob(obr->xob, 0);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
im->extended_info = obr;
|
||||||
if (buf->priv.x11.xcb.mask)
|
if (buf->priv.x11.xcb.mask)
|
||||||
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||||
1,
|
1,
|
||||||
w, h,
|
w, h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
/* obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn, */
|
|
||||||
/* 1, */
|
|
||||||
/* w, */
|
|
||||||
/* h, */
|
|
||||||
/* use_shm, */
|
|
||||||
/* NULL); */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
|
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
||||||
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
||||||
im->extended_info = obr;
|
im->extended_info = obr;
|
||||||
|
@ -557,6 +601,12 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
w, h,
|
w, h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xcbob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xcb.mask)
|
if (buf->priv.x11.xcb.mask)
|
||||||
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||||
1,
|
1,
|
||||||
|
@ -564,12 +614,6 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
/* obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn, */
|
|
||||||
/* buf->priv.x11.xcb.depth, */
|
|
||||||
/* w, */
|
|
||||||
/* h, */
|
|
||||||
/* use_shm, */
|
|
||||||
/* NULL); */
|
|
||||||
else if ((buf->rot == 90) || (buf->rot == 270))
|
else if ((buf->rot == 90) || (buf->rot == 270))
|
||||||
{
|
{
|
||||||
obr->xcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
obr->xcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||||
|
@ -577,6 +621,12 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
h, w,
|
h, w,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xcbob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xcb.mask)
|
if (buf->priv.x11.xcb.mask)
|
||||||
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||||
1,
|
1,
|
||||||
|
@ -584,31 +634,15 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
/* obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn, */
|
|
||||||
/* buf->priv.x11.xcb.depth, */
|
|
||||||
/* h, */
|
|
||||||
/* w, */
|
|
||||||
/* use_shm, */
|
|
||||||
/* NULL); */
|
|
||||||
/*
|
|
||||||
if (buf->priv.x11.xcb.mask)
|
|
||||||
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
|
||||||
1, w, h,
|
|
||||||
use_shm,
|
|
||||||
NULL);
|
|
||||||
*/
|
|
||||||
/* obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn, */
|
|
||||||
/* 1, */
|
|
||||||
/* w, */
|
|
||||||
/* h, */
|
|
||||||
/* use_shm, */
|
|
||||||
/* NULL); */
|
|
||||||
}
|
}
|
||||||
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
||||||
we copy too much to the destination surface and some area are not cleaned before copy. */
|
we copy too much to the destination surface and some area are not cleaned before copy. */
|
||||||
if ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha))
|
if (((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)) &&
|
||||||
/* FIXME: faster memset! */
|
(im->image.data))
|
||||||
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
{
|
||||||
|
/* FIXME: faster memset! */
|
||||||
|
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
||||||
|
}
|
||||||
|
|
||||||
buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im);
|
buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im);
|
||||||
return im;
|
return im;
|
||||||
|
@ -654,9 +688,10 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
|
||||||
buf->priv.x11.xcb.gc,
|
buf->priv.x11.xcb.gc,
|
||||||
0, 0, pixman_region_n_rects(&tmpr),
|
0, 0, pixman_region_n_rects(&tmpr),
|
||||||
(const xcb_rectangle_t *)pixman_region_rectangles(&tmpr, NULL));
|
(const xcb_rectangle_t *)pixman_region_rectangles(&tmpr, NULL));
|
||||||
evas_software_xcb_x_output_buffer_paste(obr->xcbob, buf->priv.x11.xcb.win,
|
if (obr->xcbob)
|
||||||
buf->priv.x11.xcb.gc,
|
evas_software_xcb_x_output_buffer_paste(obr->xcbob, buf->priv.x11.xcb.win,
|
||||||
0, 0, 0);
|
buf->priv.x11.xcb.gc,
|
||||||
|
0, 0, 0);
|
||||||
if (obr->mxcbob)
|
if (obr->mxcbob)
|
||||||
{
|
{
|
||||||
xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, XCB_CLIP_ORDERING_YX_BANDED,
|
xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, XCB_CLIP_ORDERING_YX_BANDED,
|
||||||
|
@ -685,11 +720,12 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
|
||||||
obr->y,
|
obr->y,
|
||||||
obr->w,
|
obr->w,
|
||||||
obr->h);
|
obr->h);
|
||||||
evas_software_xcb_x_output_buffer_paste(obr->xcbob,
|
if (obr->xcbob)
|
||||||
buf->priv.x11.xcb.win,
|
evas_software_xcb_x_output_buffer_paste(obr->xcbob,
|
||||||
buf->priv.x11.xcb.gc,
|
buf->priv.x11.xcb.win,
|
||||||
obr->x,
|
buf->priv.x11.xcb.gc,
|
||||||
obr->y, 0);
|
obr->x,
|
||||||
|
obr->y, 0);
|
||||||
if (obr->mxcbob)
|
if (obr->mxcbob)
|
||||||
evas_software_xcb_x_output_buffer_paste(obr->mxcbob,
|
evas_software_xcb_x_output_buffer_paste(obr->mxcbob,
|
||||||
buf->priv.x11.xcb.mask,
|
buf->priv.x11.xcb.mask,
|
||||||
|
@ -706,8 +742,6 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
if (obr->xcbob) _unfind_xcbob(obr->xcbob, 0);
|
if (obr->xcbob) _unfind_xcbob(obr->xcbob, 0);
|
||||||
if (obr->mxcbob) _unfind_xcbob(obr->mxcbob, 0);
|
if (obr->mxcbob) _unfind_xcbob(obr->mxcbob, 0);
|
||||||
/* if (obr->xcbob) evas_software_xcb_x_output_buffer_free(obr->xcbob, 0); */
|
|
||||||
/* if (obr->mxcbob) evas_software_xcb_x_output_buffer_free(obr->mxcbob, 0); */
|
|
||||||
free(obr);
|
free(obr);
|
||||||
}
|
}
|
||||||
buf->priv.prev_pending_writes = buf->priv.pending_writes;
|
buf->priv.prev_pending_writes = buf->priv.pending_writes;
|
||||||
|
@ -743,10 +777,6 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
if (obr->xcbob) _unfind_xcbob(obr->xcbob, 0);
|
if (obr->xcbob) _unfind_xcbob(obr->xcbob, 0);
|
||||||
if (obr->mxcbob) _unfind_xcbob(obr->mxcbob, 0);
|
if (obr->mxcbob) _unfind_xcbob(obr->mxcbob, 0);
|
||||||
/*
|
|
||||||
if (obr->xcbob) evas_software_x11_x_output_buffer_free(obr->xcbob, 0);
|
|
||||||
if (obr->mxcbob) evas_software_x11_x_output_buffer_free(obr->mxcbob, 0);
|
|
||||||
*/
|
|
||||||
free(obr);
|
free(obr);
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
}
|
}
|
||||||
|
@ -842,8 +872,11 @@ evas_software_xcb_outbuf_push_updated_region(Outbuf *buf,
|
||||||
}
|
}
|
||||||
if (!conv_func) return;
|
if (!conv_func) return;
|
||||||
|
|
||||||
|
if (!obr->xcbob) return;
|
||||||
data = evas_software_xcb_x_output_buffer_data(obr->xcbob, &bpl);
|
data = evas_software_xcb_x_output_buffer_data(obr->xcbob, &bpl);
|
||||||
|
if (!data) return;
|
||||||
src_data = update->image.data;
|
src_data = update->image.data;
|
||||||
|
if (!src_data) return;
|
||||||
if (buf->rot == 0)
|
if (buf->rot == 0)
|
||||||
{
|
{
|
||||||
obr->x = x;
|
obr->x = x;
|
||||||
|
@ -901,9 +934,10 @@ evas_software_xcb_outbuf_push_updated_region(Outbuf *buf,
|
||||||
if (buf->priv.debug)
|
if (buf->priv.debug)
|
||||||
evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win,
|
evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win,
|
||||||
obr->x, obr->y, obr->w, obr->h);
|
obr->x, obr->y, obr->w, obr->h);
|
||||||
evas_software_xcb_x_output_buffer_paste(obr->xcbob, buf->priv.x11.xcb.win,
|
if (obr->xcbob)
|
||||||
buf->priv.x11.xcb.gc,
|
evas_software_xcb_x_output_buffer_paste(obr->xcbob, buf->priv.x11.xcb.win,
|
||||||
obr->x, obr->y, 0);
|
buf->priv.x11.xcb.gc,
|
||||||
|
obr->x, obr->y, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (obr->mxcbob)
|
if (obr->mxcbob)
|
||||||
|
@ -1028,10 +1062,10 @@ evas_software_xcb_outbuf_mask_set(Outbuf *buf,
|
||||||
}
|
}
|
||||||
buf->priv.x11.xcb.mask = mask;
|
buf->priv.x11.xcb.mask = mask;
|
||||||
if (buf->priv.x11.xcb.mask)
|
if (buf->priv.x11.xcb.mask)
|
||||||
{
|
{
|
||||||
buf->priv.x11.xcb.gcm = xcb_generate_id(buf->priv.x11.xcb.conn);
|
buf->priv.x11.xcb.gcm = xcb_generate_id(buf->priv.x11.xcb.conn);
|
||||||
xcb_create_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gcm, buf->priv.x11.xcb.win, 0, NULL);
|
xcb_create_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gcm, buf->priv.x11.xcb.win, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1063,16 +1097,17 @@ evas_software_xcb_outbuf_debug_show(Outbuf *buf,
|
||||||
|
|
||||||
i = xcb_setup_roots_iterator((xcb_setup_t *)xcb_get_setup(buf->priv.x11.xcb.conn));
|
i = xcb_setup_roots_iterator((xcb_setup_t *)xcb_get_setup(buf->priv.x11.xcb.conn));
|
||||||
for (; i.rem; xcb_screen_next(&i))
|
for (; i.rem; xcb_screen_next(&i))
|
||||||
if (i.data->root == geom->root)
|
{
|
||||||
{
|
if (i.data->root == geom->root)
|
||||||
screen = i.data;
|
{
|
||||||
break;
|
screen = i.data;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
free (geom);
|
free (geom);
|
||||||
}
|
}
|
||||||
for (i = 0; i < 20; i++)
|
for (i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
/* xcb_image_t *image; */
|
|
||||||
xcb_rectangle_t rect = { x, y, w, h};
|
xcb_rectangle_t rect = { x, y, w, h};
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
uint32_t value[2];
|
uint32_t value[2];
|
||||||
|
@ -1084,9 +1119,6 @@ evas_software_xcb_outbuf_debug_show(Outbuf *buf,
|
||||||
xcb_poly_fill_rectangle (buf->priv.x11.xcb.conn, draw, buf->priv.x11.xcb.gc, 1, &rect);
|
xcb_poly_fill_rectangle (buf->priv.x11.xcb.conn, draw, buf->priv.x11.xcb.gc, 1, &rect);
|
||||||
/* we sync */
|
/* we sync */
|
||||||
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
||||||
// image = xcb_image_get(buf->priv.x11.xcb.conn, draw, x, y, w, h, XCB_ALL_PLANES, XCB_IMAGE_FORMAT_Z_PIXMAP);
|
|
||||||
// if (image)
|
|
||||||
// xcb_image_destroy(image);
|
|
||||||
/* we sync */
|
/* we sync */
|
||||||
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
||||||
mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
|
mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
|
||||||
|
@ -1096,9 +1128,6 @@ evas_software_xcb_outbuf_debug_show(Outbuf *buf,
|
||||||
xcb_poly_fill_rectangle (buf->priv.x11.xcb.conn, draw, buf->priv.x11.xcb.gc, 1, &rect);
|
xcb_poly_fill_rectangle (buf->priv.x11.xcb.conn, draw, buf->priv.x11.xcb.gc, 1, &rect);
|
||||||
/* we sync */
|
/* we sync */
|
||||||
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
||||||
// image = xcb_image_get(buf->priv.x11.xcb.conn, draw, x, y, w, h, XCB_ALL_PLANES, XCB_IMAGE_FORMAT_Z_PIXMAP);
|
|
||||||
// if (image)
|
|
||||||
// xcb_image_destroy(image);
|
|
||||||
/* we sync */
|
/* we sync */
|
||||||
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
free(xcb_get_input_focus_reply(buf->priv.x11.xcb.conn, xcb_get_input_focus_unchecked(buf->priv.x11.xcb.conn), NULL));
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,11 +324,6 @@ evas_software_xlib_x_output_buffer_new(Display *d, Visual *v, int depth, int w,
|
||||||
}
|
}
|
||||||
if (!_x_err)
|
if (!_x_err)
|
||||||
{
|
{
|
||||||
// printf("SHM++ ID=%i -> %i bytes [%i creates]\n",
|
|
||||||
// xob->shm_info->shmid,
|
|
||||||
// xob->xim->bytes_per_line * xob->xim->height,
|
|
||||||
// creates);
|
|
||||||
// creates++;
|
|
||||||
xob->bpl = xob->xim->bytes_per_line;
|
xob->bpl = xob->xim->bytes_per_line;
|
||||||
xob->psize = xob->bpl * xob->h;
|
xob->psize = xob->bpl * xob->h;
|
||||||
return xob;
|
return xob;
|
||||||
|
@ -376,10 +371,6 @@ evas_software_xlib_x_output_buffer_free(X_Output_Buffer *xob, int sync)
|
||||||
{
|
{
|
||||||
if (xob->shm_info)
|
if (xob->shm_info)
|
||||||
{
|
{
|
||||||
// printf("SHM-- ID=%i -> %i bytes, [sync=%i]\n",
|
|
||||||
// xob->shm_info->shmid,
|
|
||||||
// xob->xim->bytes_per_line * xob->xim->height,
|
|
||||||
// sync);
|
|
||||||
if (sync) XSync(xob->display, False);
|
if (sync) XSync(xob->display, False);
|
||||||
XShmDetach(xob->display, xob->shm_info);
|
XShmDetach(xob->display, xob->shm_info);
|
||||||
XDestroyImage(xob->xim);
|
XDestroyImage(xob->xim);
|
||||||
|
@ -400,14 +391,12 @@ evas_software_xlib_x_output_buffer_paste(X_Output_Buffer *xob, Drawable d, GC gc
|
||||||
{
|
{
|
||||||
if (xob->shm_info)
|
if (xob->shm_info)
|
||||||
{
|
{
|
||||||
// printf("shm\n");
|
|
||||||
XShmPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y,
|
XShmPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y,
|
||||||
xob->w, xob->h, False);
|
xob->w, xob->h, False);
|
||||||
if (sync) XSync(xob->display, False);
|
if (sync) XSync(xob->display, False);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// printf("NO! shm\n");
|
|
||||||
XPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y,
|
XPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y,
|
||||||
xob->w, xob->h);
|
xob->w, xob->h);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ _find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data)
|
||||||
int fitness = 0x7fffffff;
|
int fitness = 0x7fffffff;
|
||||||
int sz, lbytes, bpp;
|
int sz, lbytes, bpp;
|
||||||
|
|
||||||
// return evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data);
|
|
||||||
if (!shm)
|
if (!shm)
|
||||||
return evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data);
|
return evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data);
|
||||||
if (depth > 1)
|
if (depth > 1)
|
||||||
|
@ -105,7 +104,6 @@ _find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data)
|
||||||
static void
|
static void
|
||||||
_unfind_xob(X_Output_Buffer *xob, int sync)
|
_unfind_xob(X_Output_Buffer *xob, int sync)
|
||||||
{
|
{
|
||||||
// evas_software_xlib_x_output_buffer_free(xob, sync); return;
|
|
||||||
if (xob->shm_info)
|
if (xob->shm_info)
|
||||||
{
|
{
|
||||||
SHMPOOL_LOCK();
|
SHMPOOL_LOCK();
|
||||||
|
@ -383,8 +381,14 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
Eina_Rectangle *rect;
|
Eina_Rectangle *rect;
|
||||||
|
|
||||||
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
|
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
|
||||||
|
obr = calloc(1, sizeof(Outbuf_Region));
|
||||||
|
if (!obr) return NULL;
|
||||||
rect = eina_rectangle_new(x, y, w, h);
|
rect = eina_rectangle_new(x, y, w, h);
|
||||||
if (!rect) return NULL;
|
if (!rect)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect);
|
buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect);
|
||||||
if (buf->priv.onebuf)
|
if (buf->priv.onebuf)
|
||||||
|
@ -400,7 +404,6 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
}
|
}
|
||||||
return buf->priv.onebuf;
|
return buf->priv.onebuf;
|
||||||
}
|
}
|
||||||
obr = calloc(1, sizeof(Outbuf_Region));
|
|
||||||
obr->x = 0;
|
obr->x = 0;
|
||||||
obr->y = 0;
|
obr->y = 0;
|
||||||
obr->w = buf->w;
|
obr->w = buf->w;
|
||||||
|
@ -424,22 +427,38 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
buf->w, buf->h,
|
buf->w, buf->h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
if (!obr->xob)
|
||||||
buf->w, buf->h,
|
{
|
||||||
(DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
|
free(obr);
|
||||||
alpha, EVAS_COLORSPACE_ARGB8888);
|
return NULL;
|
||||||
im->extended_info = obr;
|
}
|
||||||
if (buf->priv.x11.xlib.mask)
|
im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
|
||||||
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
buf->w, buf->h,
|
||||||
buf->priv.x11.xlib.vis,
|
(DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
|
||||||
1,
|
alpha, EVAS_COLORSPACE_ARGB8888);
|
||||||
buf->w, buf->h,
|
if (!im)
|
||||||
use_shm,
|
{
|
||||||
NULL);
|
evas_software_xlib_x_output_buffer_free(obr->xob, 0);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
im->extended_info = obr;
|
||||||
|
if (buf->priv.x11.xlib.mask)
|
||||||
|
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
||||||
|
buf->priv.x11.xlib.vis,
|
||||||
|
1,
|
||||||
|
buf->w, buf->h,
|
||||||
|
use_shm,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
|
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
||||||
evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
|
evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
|
||||||
im->extended_info = obr;
|
im->extended_info = obr;
|
||||||
|
@ -451,12 +470,18 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
buf->w, buf->h,
|
buf->w, buf->h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xlib.mask)
|
if (buf->priv.x11.xlib.mask)
|
||||||
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
||||||
buf->priv.x11.xlib.vis,
|
buf->priv.x11.xlib.vis,
|
||||||
1, buf->w, buf->h,
|
1, buf->w, buf->h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
else if ((buf->rot == 90) || (buf->rot == 270))
|
else if ((buf->rot == 90) || (buf->rot == 270))
|
||||||
{
|
{
|
||||||
|
@ -466,6 +491,12 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
buf->h, buf->w,
|
buf->h, buf->w,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xlib.mask)
|
if (buf->priv.x11.xlib.mask)
|
||||||
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
||||||
buf->priv.x11.xlib.vis,
|
buf->priv.x11.xlib.vis,
|
||||||
|
@ -476,15 +507,18 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
}
|
}
|
||||||
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
||||||
we copy too much to the destination surface and some area are not cleaned before copy. */
|
we copy too much to the destination surface and some area are not cleaned before copy. */
|
||||||
if (alpha)
|
if ((alpha) && (im->image.data))
|
||||||
/* FIXME: faster memset! */
|
{
|
||||||
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
/* FIXME: faster memset! */
|
||||||
|
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
||||||
|
}
|
||||||
|
|
||||||
buf->priv.onebuf = im;
|
buf->priv.onebuf = im;
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
|
|
||||||
obr = calloc(1, sizeof(Outbuf_Region));
|
obr = calloc(1, sizeof(Outbuf_Region));
|
||||||
|
if (!obr) return NULL;
|
||||||
obr->x = x;
|
obr->x = x;
|
||||||
obr->y = y;
|
obr->y = y;
|
||||||
obr->w = w;
|
obr->w = w;
|
||||||
|
@ -514,16 +548,21 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
w, h,
|
w, h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
/* obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, */
|
if (!obr->xob)
|
||||||
/* buf->priv.x11.xlib.vis, */
|
{
|
||||||
/* buf->priv.x11.xlib.depth, */
|
free(obr);
|
||||||
/* w, h, */
|
return NULL;
|
||||||
/* use_shm, */
|
}
|
||||||
/* NULL); */
|
im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
|
||||||
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
w, h,
|
||||||
w, h,
|
(DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
|
||||||
(DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
|
alpha, EVAS_COLORSPACE_ARGB8888);
|
||||||
alpha, EVAS_COLORSPACE_ARGB8888);
|
if (!im)
|
||||||
|
{
|
||||||
|
_unfind_xob(obr->xob, 0);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
im->extended_info = obr;
|
im->extended_info = obr;
|
||||||
if (buf->priv.x11.xlib.mask)
|
if (buf->priv.x11.xlib.mask)
|
||||||
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
||||||
|
@ -531,17 +570,15 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
1, w, h,
|
1, w, h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
/*
|
|
||||||
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
|
||||||
buf->priv.x11.xlib.vis,
|
|
||||||
1, w, h,
|
|
||||||
use_shm,
|
|
||||||
NULL);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
|
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
||||||
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
||||||
im->extended_info = obr;
|
im->extended_info = obr;
|
||||||
|
@ -553,6 +590,12 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
w, h,
|
w, h,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xlib.mask)
|
if (buf->priv.x11.xlib.mask)
|
||||||
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
||||||
buf->priv.x11.xlib.vis,
|
buf->priv.x11.xlib.vis,
|
||||||
|
@ -560,14 +603,6 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
|
||||||
buf->priv.x11.xlib.vis,
|
|
||||||
buf->priv.x11.xlib.depth,
|
|
||||||
w, h,
|
|
||||||
use_shm,
|
|
||||||
NULL);
|
|
||||||
*/
|
|
||||||
else if ((buf->rot == 90) || (buf->rot == 270))
|
else if ((buf->rot == 90) || (buf->rot == 270))
|
||||||
{
|
{
|
||||||
obr->xob = _find_xob(buf->priv.x11.xlib.disp,
|
obr->xob = _find_xob(buf->priv.x11.xlib.disp,
|
||||||
|
@ -576,6 +611,12 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
h, w,
|
h, w,
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!obr->xob)
|
||||||
|
{
|
||||||
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
|
free(obr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (buf->priv.x11.xlib.mask)
|
if (buf->priv.x11.xlib.mask)
|
||||||
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
||||||
buf->priv.x11.xlib.vis,
|
buf->priv.x11.xlib.vis,
|
||||||
|
@ -583,35 +624,15 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
use_shm,
|
use_shm,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
|
||||||
buf->priv.x11.xlib.vis,
|
|
||||||
buf->priv.x11.xlib.depth,
|
|
||||||
h, w,
|
|
||||||
use_shm,
|
|
||||||
NULL);
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
if (buf->priv.x11.xlib.mask)
|
|
||||||
obr->mxob = _find_xob(buf->priv.x11.xlib.disp,
|
|
||||||
buf->priv.x11.xlib.vis,
|
|
||||||
1, w, h,
|
|
||||||
use_shm,
|
|
||||||
NULL);
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp,
|
|
||||||
buf->priv.x11.xlib.vis,
|
|
||||||
1, w, h,
|
|
||||||
use_shm,
|
|
||||||
NULL);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
/* FIXME: We should be able to remove this memset, but somewhere in the process
|
||||||
we copy too much to the destination surface and some area are not cleaned before copy. */
|
we copy too much to the destination surface and some area are not cleaned before copy. */
|
||||||
if ((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha))
|
if (((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)) &&
|
||||||
/* FIXME: faster memset! */
|
(im->image.data))
|
||||||
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
{
|
||||||
|
/* FIXME: faster memset! */
|
||||||
|
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
if (!evas_common_frameq_enabled())
|
if (!evas_common_frameq_enabled())
|
||||||
|
@ -658,9 +679,10 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
|
||||||
eina_rectangle_free(rect);
|
eina_rectangle_free(rect);
|
||||||
}
|
}
|
||||||
XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, tmpr);
|
XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, tmpr);
|
||||||
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,
|
if (obr->xob)
|
||||||
buf->priv.x11.xlib.gc,
|
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,
|
||||||
0, 0, 0);
|
buf->priv.x11.xlib.gc,
|
||||||
|
0, 0, 0);
|
||||||
if (obr->mxob)
|
if (obr->mxob)
|
||||||
{
|
{
|
||||||
XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm, tmpr);
|
XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm, tmpr);
|
||||||
|
@ -682,9 +704,10 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
|
||||||
if (buf->priv.debug)
|
if (buf->priv.debug)
|
||||||
evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win,
|
evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win,
|
||||||
obr->x, obr->y, obr->w, obr->h);
|
obr->x, obr->y, obr->w, obr->h);
|
||||||
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,
|
if (obr->xob)
|
||||||
buf->priv.x11.xlib.gc,
|
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,
|
||||||
obr->x, obr->y, 0);
|
buf->priv.x11.xlib.gc,
|
||||||
|
obr->x, obr->y, 0);
|
||||||
if (obr->mxob)
|
if (obr->mxob)
|
||||||
evas_software_xlib_x_output_buffer_paste(obr->mxob,
|
evas_software_xlib_x_output_buffer_paste(obr->mxob,
|
||||||
buf->priv.x11.xlib.mask,
|
buf->priv.x11.xlib.mask,
|
||||||
|
@ -692,27 +715,23 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
|
||||||
obr->x, obr->y, 0);
|
obr->x, obr->y, 0);
|
||||||
}
|
}
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKL(buf->priv.lock);
|
LKL(buf->priv.lock);
|
||||||
#endif
|
#endif
|
||||||
while (buf->priv.prev_pending_writes)
|
while (buf->priv.prev_pending_writes)
|
||||||
{
|
{
|
||||||
im = buf->priv.prev_pending_writes->data;
|
im = buf->priv.prev_pending_writes->data;
|
||||||
buf->priv.prev_pending_writes =
|
buf->priv.prev_pending_writes =
|
||||||
eina_list_remove_list(buf->priv.prev_pending_writes,
|
eina_list_remove_list(buf->priv.prev_pending_writes,
|
||||||
buf->priv.prev_pending_writes);
|
buf->priv.prev_pending_writes);
|
||||||
obr = im->extended_info;
|
obr = im->extended_info;
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
if (obr->xob) _unfind_xob(obr->xob, 0);
|
if (obr->xob) _unfind_xob(obr->xob, 0);
|
||||||
if (obr->mxob) _unfind_xob(obr->mxob, 0);
|
if (obr->mxob) _unfind_xob(obr->mxob, 0);
|
||||||
/*
|
|
||||||
if (obr->xob) evas_software_xlib_x_output_buffer_free(obr->xob, 0);
|
|
||||||
if (obr->mxob) evas_software_xlib_x_output_buffer_free(obr->mxob, 0);
|
|
||||||
*/
|
|
||||||
free(obr);
|
free(obr);
|
||||||
}
|
}
|
||||||
buf->priv.prev_pending_writes = buf->priv.pending_writes;
|
buf->priv.prev_pending_writes = buf->priv.pending_writes;
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKU(buf->priv.lock);
|
LKU(buf->priv.lock);
|
||||||
#endif
|
#endif
|
||||||
buf->priv.pending_writes = NULL;
|
buf->priv.pending_writes = NULL;
|
||||||
XFlush(buf->priv.x11.xlib.disp);
|
XFlush(buf->priv.x11.xlib.disp);
|
||||||
|
@ -741,17 +760,13 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
|
||||||
{
|
{
|
||||||
RGBA_Image *im;
|
RGBA_Image *im;
|
||||||
Outbuf_Region *obr;
|
Outbuf_Region *obr;
|
||||||
|
|
||||||
im = eina_list_data_get(buf->priv.pending_writes);
|
im = eina_list_data_get(buf->priv.pending_writes);
|
||||||
buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes);
|
buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes);
|
||||||
obr = im->extended_info;
|
obr = im->extended_info;
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
if (obr->xob) _unfind_xob(obr->xob, 0);
|
if (obr->xob) _unfind_xob(obr->xob, 0);
|
||||||
if (obr->mxob) _unfind_xob(obr->mxob, 0);
|
if (obr->mxob) _unfind_xob(obr->mxob, 0);
|
||||||
/*
|
|
||||||
if (obr->xob) evas_software_xlib_x_output_buffer_free(obr->xob, 0);
|
|
||||||
if (obr->mxob) evas_software_xlib_x_output_buffer_free(obr->mxob, 0);
|
|
||||||
*/
|
|
||||||
free(obr);
|
free(obr);
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
}
|
}
|
||||||
|
@ -779,18 +794,18 @@ evas_software_xlib_outbuf_idle_flush(Outbuf *buf)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKL(buf->priv.lock);
|
LKL(buf->priv.lock);
|
||||||
#endif
|
#endif
|
||||||
if (buf->priv.prev_pending_writes) XSync(buf->priv.x11.xlib.disp, False);
|
if (buf->priv.prev_pending_writes) XSync(buf->priv.x11.xlib.disp, False);
|
||||||
while (buf->priv.prev_pending_writes)
|
while (buf->priv.prev_pending_writes)
|
||||||
{
|
{
|
||||||
RGBA_Image *im;
|
RGBA_Image *im;
|
||||||
Outbuf_Region *obr;
|
Outbuf_Region *obr;
|
||||||
|
|
||||||
im = buf->priv.prev_pending_writes->data;
|
im = buf->priv.prev_pending_writes->data;
|
||||||
buf->priv.prev_pending_writes =
|
buf->priv.prev_pending_writes =
|
||||||
eina_list_remove_list(buf->priv.prev_pending_writes,
|
eina_list_remove_list(buf->priv.prev_pending_writes,
|
||||||
buf->priv.prev_pending_writes);
|
buf->priv.prev_pending_writes);
|
||||||
obr = im->extended_info;
|
obr = im->extended_info;
|
||||||
evas_cache_image_drop(&im->cache_entry);
|
evas_cache_image_drop(&im->cache_entry);
|
||||||
if (obr->xob) _unfind_xob(obr->xob, 0);
|
if (obr->xob) _unfind_xob(obr->xob, 0);
|
||||||
|
@ -798,7 +813,7 @@ evas_software_xlib_outbuf_idle_flush(Outbuf *buf)
|
||||||
free(obr);
|
free(obr);
|
||||||
}
|
}
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKU(buf->priv.lock);
|
LKU(buf->priv.lock);
|
||||||
#endif
|
#endif
|
||||||
_clear_xob(0);
|
_clear_xob(0);
|
||||||
}
|
}
|
||||||
|
@ -846,8 +861,11 @@ evas_software_xlib_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, i
|
||||||
}
|
}
|
||||||
if (!conv_func) return;
|
if (!conv_func) return;
|
||||||
|
|
||||||
|
if (!obr->xob) return;
|
||||||
data = evas_software_xlib_x_output_buffer_data(obr->xob, &bpl);
|
data = evas_software_xlib_x_output_buffer_data(obr->xob, &bpl);
|
||||||
|
if (!data) return;
|
||||||
src_data = update->image.data;
|
src_data = update->image.data;
|
||||||
|
if (!src_data) return;
|
||||||
if (buf->rot == 0)
|
if (buf->rot == 0)
|
||||||
{
|
{
|
||||||
obr->x = x;
|
obr->x = x;
|
||||||
|
@ -904,10 +922,11 @@ evas_software_xlib_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, i
|
||||||
{
|
{
|
||||||
if (buf->priv.debug)
|
if (buf->priv.debug)
|
||||||
evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win,
|
evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win,
|
||||||
obr->x, obr->y, obr->w, obr->h);
|
obr->x, obr->y, obr->w, obr->h);
|
||||||
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,
|
if (obr->xob)
|
||||||
buf->priv.x11.xlib.gc,
|
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,
|
||||||
obr->x, obr->y, 0);
|
buf->priv.x11.xlib.gc,
|
||||||
|
obr->x, obr->y, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (obr->mxob)
|
if (obr->mxob)
|
||||||
|
@ -1058,25 +1077,15 @@ evas_software_xlib_outbuf_debug_show(Outbuf * buf, Drawable draw, int x, int y,
|
||||||
}
|
}
|
||||||
for (i = 0; i < 20; i++)
|
for (i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
// XImage *xim;
|
|
||||||
|
|
||||||
XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc,
|
XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc,
|
||||||
BlackPixel(buf->priv.x11.xlib.disp, screen_num));
|
BlackPixel(buf->priv.x11.xlib.disp, screen_num));
|
||||||
XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h);
|
XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h);
|
||||||
XSync(buf->priv.x11.xlib.disp, False);
|
XSync(buf->priv.x11.xlib.disp, False);
|
||||||
// xim =
|
|
||||||
// XGetImage(buf->priv.x11.xlib.disp, draw, x, y, w, h, 0xffffffff, ZPixmap);
|
|
||||||
// if (xim)
|
|
||||||
// XDestroyImage(xim);
|
|
||||||
XSync(buf->priv.x11.xlib.disp, False);
|
XSync(buf->priv.x11.xlib.disp, False);
|
||||||
XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc,
|
XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc,
|
||||||
WhitePixel(buf->priv.x11.xlib.disp, screen_num));
|
WhitePixel(buf->priv.x11.xlib.disp, screen_num));
|
||||||
XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h);
|
XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h);
|
||||||
XSync(buf->priv.x11.xlib.disp, False);
|
XSync(buf->priv.x11.xlib.disp, False);
|
||||||
// xim =
|
|
||||||
// XGetImage(buf->priv.x11.xlib.disp, draw, x, y, w, h, 0xffffffff, ZPixmap);
|
|
||||||
// if (xim)
|
|
||||||
// XDestroyImage(xim);
|
|
||||||
XSync(buf->priv.x11.xlib.disp, False);
|
XSync(buf->priv.x11.xlib.disp, False);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue