xcbob =
evas_software_xcb_output_buffer_new(conn, visual, screen->root_depth,
- 16, 16, 2, NULL); // 1, 1 EINA_TRUE
+ 16, 16, 2, NULL);
if (!xcbob)
cached_result = 0;
else
xcbob->shm_info = NULL;
xcbob->w = w;
xcbob->h = h;
- xcbob->data = data;
if (try_shm > 0)
{
depth, NULL, ~0, NULL);
if (xcbob->xim)
{
- /* was 0666 */
xcbob->shm_info->shmid =
- shmget(IPC_PRIVATE, xcbob->xim->size, (IPC_CREAT | 0777));
+ shmget(IPC_PRIVATE,
+ xcbob->xim->stride * xcbob->xim->height,
+ (IPC_CREAT | 0777));
+ /* xcbob->shm_info->shmid = */
+ /* shmget(IPC_PRIVATE, xcbob->xim->size, (IPC_CREAT | 0777)); */
if (xcbob->shm_info->shmid == (uint32_t)-1)
{
xcb_image_destroy(xcbob->xim);
free(xcbob);
return NULL;
}
- xcbob->shm_info->shmaddr =
+ xcbob->shm_info->shmaddr = xcbob->xim->data =
shmat(xcbob->shm_info->shmid, 0, 0);
if (xcbob->shm_info->shmaddr != ((void *)-1))
{
/* Sync only needed for testing */
if (try_shm == 2) _xcbob_sync(conn);
- xcbob->xim->data = xcbob->shm_info->shmaddr;
+// xcbob->xim->data = xcbob->shm_info->shmaddr;
#if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW)
if (evas_common_frameq_enabled())
xcb_grab_server(conn);
xcbob->psize = (xcbob->bpl * xcbob->h);
return xcbob;
}
- else
- {
- shmdt(xcbob->shm_info->shmaddr);
- shmctl(xcbob->shm_info->shmid, IPC_RMID, 0);
- xcb_image_destroy(xcbob->xim);
- free(xcbob->shm_info);
- free(xcbob);
- return NULL;
- }
- }
- else
- {
- free(xcbob->shm_info);
- free(xcbob);
- return NULL;
+ shmdt(xcbob->shm_info->shmaddr);
+ shmctl(xcbob->shm_info->shmid, IPC_RMID, 0);
}
+ if (xcbob->xim) xcb_image_destroy(xcbob->xim);
+ xcbob->xim = NULL;
}
- else
- {
- free(xcbob);
- return NULL;
- }
+ if (xcbob->shm_info) free(xcbob->shm_info);
+ xcbob->shm_info = NULL;
}
if (try_shm > 1) return NULL;
return NULL;
}
+ xcbob->data = data;
+
if (!xcbob->xim->data)
{
- xcbob->xim->data = malloc(xcbob->xim->size);
+ xcbob->xim->data = malloc(xcbob->xim->stride * xcbob->xim->height);
if (!xcbob->xim->data)
{
xcb_image_destroy(xcbob->xim);
}
}
xcbob->bpl = xcbob->xim->stride;
- xcbob->psize = xcbob->xim->size;
+ xcbob->psize = (xcbob->bpl * xcbob->h);
return xcbob;
}
else
{
if (xcbob->data) xcbob->xim->data = NULL;
- free(xcbob->xim->data);
+// free(xcbob->xim->data);
xcb_image_destroy(xcbob->xim);
}
free(xcbob);
evas_software_xcb_output_buffer_data(Xcb_Output_Buffer *xcbob, int *bpl_ret)
{
if (bpl_ret) *bpl_ret = xcbob->xim->stride;
- return xcbob->xim->data;
+ return (DATA8 *)xcbob->xim->data;
}
int
xcb_image_format_t xif;
/* NB: We cannot use xcb_image_create_native as it only creates images
- * using MSB_FIRST, so this routine recreates that function and checks
- * endian-ness correctly */
+ * using MSB_FIRST, so this routine recreates that function and uses
+ * the endian-ness of the server setup */
setup = xcb_get_setup(conn);
xif = format;
case XCB_IMAGE_FORMAT_XY_BITMAP:
if (depth != 1) return 0;
case XCB_IMAGE_FORMAT_XY_PIXMAP:
- return xcb_image_create(w, h, xif,
- fmt->scanline_pad,
- fmt->depth, fmt->bits_per_pixel,
- setup->bitmap_format_scanline_unit,
- setup->image_byte_order,
- setup->bitmap_format_bit_order,
- base, bytes, data);
+ /* return xcb_image_create(w, h, xif, */
+ /* fmt->scanline_pad, */
+ /* fmt->depth, fmt->bits_per_pixel, */
+ /* setup->bitmap_format_scanline_unit, */
+ /* setup->image_byte_order, */
+ /* setup->bitmap_format_bit_order, */
+ /* base, bytes, data); */
case XCB_IMAGE_FORMAT_Z_PIXMAP:
return xcb_image_create(w, h, xif,
fmt->scanline_pad,
{
Eina_Rectangle *rect;
+ RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
+
if (!(obr = calloc(1, sizeof(Outbuf_Region))))
return NULL;
- RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
if (!(rect = eina_rectangle_new(x, y, w, h)))
{
free(obr);
if (cy) *cy = y;
if (cw) *cw = w;
if (ch) *ch = h;
+
alpha = ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha));
use_shm = buf->priv.x11.xcb.shm;
+
if ((buf->rot == 0) && (buf->priv.mask.r == 0xff0000) &&
- (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff))
+ (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff))
{
obr->xcbob =
evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn,
use_shm = buf->priv.x11.xcb.shm;
alpha = ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha));
if ((buf->rot == 0) && (buf->priv.mask.r == 0xff0000) &&
- (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff))
+ (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff))
{
obr->xcbob =
_find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual,
if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE);
if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE);
free(obr);
- evas_cache_image_drop(&im->cache_entry);
+// evas_cache_image_drop(&im->cache_entry);
}
#endif
}
im = buf->priv.onebuf;
buf->priv.onebuf = NULL;
obr = im->extended_info;
+ evas_cache_image_drop(&im->cache_entry);
if (obr->xcbob)
evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE);
if (obr->mask)
evas_software_xcb_output_buffer_free(obr->mask, EINA_FALSE);
free(obr);
- evas_cache_image_drop(&im->cache_entry);
}
else
{
}
#if 1
#else
- /* Async Push */
- if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions)))
- {
- evas_software_xcb_output_buffer_paste(obr->xcbob,
- buf->priv.x11.xcb.mask,
- buf->priv.x11.xcb.gcm,
- obr->x, obr->y, 0);
- }
+ /* Async Push */
+ if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions)))
+ evas_software_xcb_output_buffer_paste(obr->xcbob,
+ buf->priv.x11.xcb.mask,
+ buf->priv.x11.xcb.gcm,
+ obr->x, obr->y, 0);
#endif
}
#if 1
xcb_get_geometry_unchecked(buf->priv.x11.xcb.conn,
drawable), 0);
root = geom->root;
- free (geom);
+ free(geom);
geom =
xcb_get_geometry_reply(buf->priv.x11.xcb.conn,
xcb_get_geometry_unchecked(buf->priv.x11.xcb.conn,
break;
}
}
- free (geom);
+ free(geom);
for (i = 0; i < 20; i++)
{
xcb_poly_fill_rectangle(buf->priv.x11.xcb.conn, drawable,
buf->priv.x11.xcb.gc, 1, &rect);
_xcbob_sync(buf->priv.x11.xcb.conn);
+ _xcbob_sync(buf->priv.x11.xcb.conn);
mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
value[0] = screen->white_pixel;
xcb_poly_fill_rectangle(buf->priv.x11.xcb.conn, drawable,
buf->priv.x11.xcb.gc, 1, &rect);
_xcbob_sync(buf->priv.x11.xcb.conn);
+ _xcbob_sync(buf->priv.x11.xcb.conn);
}
}
-# ifdef EVAS_FRAME_QUEUING
+#ifdef EVAS_FRAME_QUEUING
void
evas_software_xcb_outbuf_priv_set(Outbuf *buf, void *cur, void *prev __UNUSED__)
{
buf->priv.pending_writes = (Eina_List *)cur;
}
-# endif
+#endif
/* local functions */
static Xcb_Output_Buffer *