forked from enlightenment/efl
masks should be correctly rotated in the xcb engine, now
remove a few unused parameters and unused variables SVN revision: 41975
This commit is contained in:
parent
86dab3bef7
commit
ea9c39e2f7
|
@ -628,7 +628,7 @@ eng_output_idle_flush(void *data)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
eng_canvas_alpha_get(void *data, void *context)
|
||||
eng_canvas_alpha_get(void *data, void *context __UNUSED__)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
|
@ -667,7 +667,7 @@ module_open(Evas_Module *em)
|
|||
}
|
||||
|
||||
static void
|
||||
module_close(Evas_Module *em)
|
||||
module_close(Evas_Module *em __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,182 @@ evas_software_xcb_x_write_mask_line(Outbuf *buf,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
evas_software_xcb_x_write_mask_line_rev(Outbuf *buf,
|
||||
Xcb_Output_Buffer *xcbob,
|
||||
DATA32 *src,
|
||||
int w,
|
||||
int y)
|
||||
{
|
||||
int x;
|
||||
DATA32 *src_ptr;
|
||||
DATA8 *dst_ptr;
|
||||
int bpl = 0;
|
||||
|
||||
src_ptr = src + w - 1;
|
||||
dst_ptr = evas_software_xcb_x_output_buffer_data(xcbob, &bpl);
|
||||
dst_ptr = dst_ptr + (bpl * y);
|
||||
w -= 7;
|
||||
if (buf->priv.x11.xcb.bit_swap)
|
||||
{
|
||||
for (x = 0; x < w; x += 8)
|
||||
{
|
||||
*dst_ptr =
|
||||
((A_VAL(&(src_ptr[ 0])) >> 7) << 7) |
|
||||
((A_VAL(&(src_ptr[-1])) >> 7) << 6) |
|
||||
((A_VAL(&(src_ptr[-2])) >> 7) << 5) |
|
||||
((A_VAL(&(src_ptr[-3])) >> 7) << 4) |
|
||||
((A_VAL(&(src_ptr[-4])) >> 7) << 3) |
|
||||
((A_VAL(&(src_ptr[-5])) >> 7) << 2) |
|
||||
((A_VAL(&(src_ptr[-6])) >> 7) << 1) |
|
||||
((A_VAL(&(src_ptr[-7])) >> 7) << 0);
|
||||
src_ptr -= 8;
|
||||
dst_ptr++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (x = 0; x < w; x += 8)
|
||||
{
|
||||
*dst_ptr =
|
||||
((A_VAL(&(src_ptr[ 0])) >> 7) << 0) |
|
||||
((A_VAL(&(src_ptr[-1])) >> 7) << 1) |
|
||||
((A_VAL(&(src_ptr[-2])) >> 7) << 2) |
|
||||
((A_VAL(&(src_ptr[-3])) >> 7) << 3) |
|
||||
((A_VAL(&(src_ptr[-4])) >> 7) << 4) |
|
||||
((A_VAL(&(src_ptr[-5])) >> 7) << 5) |
|
||||
((A_VAL(&(src_ptr[-6])) >> 7) << 6) |
|
||||
((A_VAL(&(src_ptr[-7])) >> 7) << 7);
|
||||
src_ptr -= 8;
|
||||
dst_ptr++;
|
||||
}
|
||||
}
|
||||
w += 7;
|
||||
for (; x < w; x ++)
|
||||
{
|
||||
xcb_image_put_pixel(xcbob->image, x, y, A_VAL(src_ptr) >> 7);
|
||||
src_ptr--;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
evas_software_xcb_x_write_mask_line_vert(Outbuf *buf,
|
||||
Xcb_Output_Buffer *xcbob,
|
||||
DATA32 *src,
|
||||
int h,
|
||||
int ym,
|
||||
int w)
|
||||
{
|
||||
int y;
|
||||
DATA32 *src_ptr;
|
||||
DATA8 *dst_ptr;
|
||||
int bpl = 0;
|
||||
|
||||
src_ptr = src;
|
||||
dst_ptr = evas_software_xcb_x_output_buffer_data(xcbob, &bpl);
|
||||
dst_ptr = dst_ptr + (bpl * ym);
|
||||
h -= 7;
|
||||
if (buf->priv.x11.xcb.bit_swap)
|
||||
{
|
||||
for (y = 0; y < h; y += 8)
|
||||
{
|
||||
*dst_ptr =
|
||||
((A_VAL(&(src_ptr[0 * w])) >> 7) << 7) |
|
||||
((A_VAL(&(src_ptr[1 * w])) >> 7) << 6) |
|
||||
((A_VAL(&(src_ptr[2 * w])) >> 7) << 5) |
|
||||
((A_VAL(&(src_ptr[3 * w])) >> 7) << 4) |
|
||||
((A_VAL(&(src_ptr[4 * w])) >> 7) << 3) |
|
||||
((A_VAL(&(src_ptr[5 * w])) >> 7) << 2) |
|
||||
((A_VAL(&(src_ptr[6 * w])) >> 7) << 1) |
|
||||
((A_VAL(&(src_ptr[7 * w])) >> 7) << 0);
|
||||
src_ptr += 8 * w;
|
||||
dst_ptr++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (y = 0; y < h; y += 8)
|
||||
{
|
||||
*dst_ptr =
|
||||
((A_VAL(&(src_ptr[0 * w])) >> 7) << 0) |
|
||||
((A_VAL(&(src_ptr[1 * w])) >> 7) << 1) |
|
||||
((A_VAL(&(src_ptr[2 * w])) >> 7) << 2) |
|
||||
((A_VAL(&(src_ptr[3 * w])) >> 7) << 3) |
|
||||
((A_VAL(&(src_ptr[4 * w])) >> 7) << 4) |
|
||||
((A_VAL(&(src_ptr[5 * w])) >> 7) << 5) |
|
||||
((A_VAL(&(src_ptr[6 * w])) >> 7) << 6) |
|
||||
((A_VAL(&(src_ptr[7 * w])) >> 7) << 7);
|
||||
src_ptr += 8 * w;
|
||||
dst_ptr++;
|
||||
}
|
||||
}
|
||||
h += 7;
|
||||
for (; y < h; y ++)
|
||||
{
|
||||
xcb_image_put_pixel(xcbob->image, y, ym, A_VAL(src_ptr) >> 7);
|
||||
src_ptr += w;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
evas_software_xcb_x_write_mask_line_vert_rev(Outbuf *buf,
|
||||
Xcb_Output_Buffer *xcbob,
|
||||
DATA32 *src,
|
||||
int h,
|
||||
int ym,
|
||||
int w)
|
||||
{
|
||||
int y;
|
||||
DATA32 *src_ptr;
|
||||
DATA8 *dst_ptr;
|
||||
int bpl = 0;
|
||||
|
||||
src_ptr = src + ((h - 1) * w);
|
||||
dst_ptr = evas_software_xcb_x_output_buffer_data(xcbob, &bpl);
|
||||
dst_ptr = dst_ptr + (bpl * ym);
|
||||
h -= 7;
|
||||
if (buf->priv.x11.xcb.bit_swap)
|
||||
{
|
||||
for (y = 0; y < h; y += 8)
|
||||
{
|
||||
*dst_ptr =
|
||||
((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 7) |
|
||||
((A_VAL(&(src_ptr[-1 * w])) >> 7) << 6) |
|
||||
((A_VAL(&(src_ptr[-2 * w])) >> 7) << 5) |
|
||||
((A_VAL(&(src_ptr[-3 * w])) >> 7) << 4) |
|
||||
((A_VAL(&(src_ptr[-4 * w])) >> 7) << 3) |
|
||||
((A_VAL(&(src_ptr[-5 * w])) >> 7) << 2) |
|
||||
((A_VAL(&(src_ptr[-6 * w])) >> 7) << 1) |
|
||||
((A_VAL(&(src_ptr[-7 * w])) >> 7) << 0);
|
||||
src_ptr -= 8 * w;
|
||||
dst_ptr++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (y = 0; y < h; y += 8)
|
||||
{
|
||||
*dst_ptr =
|
||||
((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 0) |
|
||||
((A_VAL(&(src_ptr[-1 * w])) >> 7) << 1) |
|
||||
((A_VAL(&(src_ptr[-2 * w])) >> 7) << 2) |
|
||||
((A_VAL(&(src_ptr[-3 * w])) >> 7) << 3) |
|
||||
((A_VAL(&(src_ptr[-4 * w])) >> 7) << 4) |
|
||||
((A_VAL(&(src_ptr[-5 * w])) >> 7) << 5) |
|
||||
((A_VAL(&(src_ptr[-6 * w])) >> 7) << 6) |
|
||||
((A_VAL(&(src_ptr[-7 * w])) >> 7) << 7);
|
||||
src_ptr -= 8 * w;
|
||||
dst_ptr++;
|
||||
}
|
||||
}
|
||||
h += 7;
|
||||
for (; y < h; y ++)
|
||||
{
|
||||
xcb_image_put_pixel(xcbob->image, y, ym, A_VAL(src_ptr) >> 7);
|
||||
src_ptr -= w;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
evas_software_xcb_x_can_do_shm(xcb_connection_t *c,
|
||||
xcb_screen_t *screen)
|
||||
|
|
|
@ -24,6 +24,23 @@ void evas_software_xcb_x_write_mask_line (Outbuf
|
|||
DATA32 *src,
|
||||
int w,
|
||||
int y);
|
||||
void evas_software_xcb_x_write_mask_line_rev (Outbuf *buf,
|
||||
Xcb_Output_Buffer *xcbob,
|
||||
DATA32 *src,
|
||||
int w,
|
||||
int y);
|
||||
void evas_software_xcb_x_write_mask_line_vert (Outbuf *buf,
|
||||
Xcb_Output_Buffer *xcbob,
|
||||
DATA32 *src,
|
||||
int h,
|
||||
int ym,
|
||||
int w);
|
||||
void evas_software_xcb_x_write_mask_line_vert_rev(Outbuf *buf,
|
||||
Xcb_Output_Buffer *xcbob,
|
||||
DATA32 *src,
|
||||
int h,
|
||||
int ym,
|
||||
int w);
|
||||
int evas_software_xcb_x_can_do_shm (xcb_connection_t *c,
|
||||
xcb_screen_t *screen);
|
||||
Xcb_Output_Buffer *evas_software_xcb_x_output_buffer_new (xcb_connection_t *c,
|
||||
|
|
|
@ -32,7 +32,7 @@ static Xcb_Output_Buffer *
|
|||
_find_xcbob(xcb_connection_t *conn, int depth, int w, int h, int shm, void *data)
|
||||
{
|
||||
Eina_List *l;
|
||||
Eina_List *xl;
|
||||
Eina_List *xl = NULL;
|
||||
Xcb_Output_Buffer *xcbob = NULL;
|
||||
Xcb_Output_Buffer *xcbob2;
|
||||
int fitness = 0x7fffffff;
|
||||
|
@ -458,23 +458,36 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
|||
evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
|
||||
im->extended_info = obr;
|
||||
if ((buf->rot == 0) || (buf->rot == 180))
|
||||
obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
buf->w, buf->h,
|
||||
use_shm,
|
||||
NULL);
|
||||
{
|
||||
obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
buf->w, buf->h,
|
||||
use_shm,
|
||||
NULL);
|
||||
if (buf->priv.x11.xcb.mask)
|
||||
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
buf->w, buf->h,
|
||||
use_shm,
|
||||
NULL);
|
||||
}
|
||||
else if ((buf->rot == 90) || (buf->rot == 270))
|
||||
obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
buf->h, buf->w,
|
||||
use_shm,
|
||||
NULL);
|
||||
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);
|
||||
{
|
||||
obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
buf->h, buf->w,
|
||||
use_shm,
|
||||
NULL);
|
||||
if (buf->priv.x11.xcb.mask)
|
||||
obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
buf->h, buf->w,
|
||||
use_shm,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
/* 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. */
|
||||
if (alpha)
|
||||
/* FIXME: faster memset! */
|
||||
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
||||
|
@ -520,7 +533,8 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
|||
im->extended_info = obr;
|
||||
if (buf->priv.x11.xcb.mask)
|
||||
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||
1, w, h,
|
||||
buf->priv.x11.xcb.depth,
|
||||
w, h,
|
||||
use_shm,
|
||||
NULL);
|
||||
/* obr->mxcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn, */
|
||||
|
@ -537,11 +551,19 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
|||
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
||||
im->extended_info = obr;
|
||||
if ((buf->rot == 0) || (buf->rot == 180))
|
||||
obr->xcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
w, h,
|
||||
use_shm,
|
||||
NULL);
|
||||
{
|
||||
obr->xcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
w, h,
|
||||
use_shm,
|
||||
NULL);
|
||||
if (buf->priv.x11.xcb.mask)
|
||||
obr->mxcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
w, h,
|
||||
use_shm,
|
||||
NULL);
|
||||
}
|
||||
/* obr->xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x11.xcb.conn, */
|
||||
/* buf->priv.x11.xcb.depth, */
|
||||
/* w, */
|
||||
|
@ -549,22 +571,32 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
|||
/* use_shm, */
|
||||
/* NULL); */
|
||||
else if ((buf->rot == 90) || (buf->rot == 270))
|
||||
obr->xcbob = _find_xcbob(buf->priv.x11.xcb.conn,
|
||||
buf->priv.x11.xcb.depth,
|
||||
h, w,
|
||||
use_shm,
|
||||
NULL);
|
||||
{
|
||||
obr->xcbob = _find_xcbob(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,
|
||||
buf->priv.x11.xcb.depth,
|
||||
h, w,
|
||||
use_shm,
|
||||
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, */
|
||||
|
@ -572,6 +604,8 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
|
|||
/* use_shm, */
|
||||
/* NULL); */
|
||||
}
|
||||
/* 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. */
|
||||
if ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha))
|
||||
/* FIXME: faster memset! */
|
||||
memset(im->image.data, 0, w * h * sizeof(DATA32));
|
||||
|
@ -874,11 +908,42 @@ evas_software_xcb_outbuf_push_updated_region(Outbuf *buf,
|
|||
#endif
|
||||
if (obr->mxcbob)
|
||||
{
|
||||
for (yy = 0; yy < obr->h; yy++)
|
||||
evas_software_xcb_x_write_mask_line(buf, obr->mxcbob,
|
||||
src_data + (yy * obr->w),
|
||||
obr->w,
|
||||
yy);
|
||||
if (buf->rot == 0)
|
||||
{
|
||||
for (yy = 0; yy < obr->h; yy++)
|
||||
evas_software_xcb_x_write_mask_line(buf, obr->mxcbob,
|
||||
src_data + (yy * obr->w),
|
||||
obr->w,
|
||||
yy);
|
||||
}
|
||||
else if (buf->rot == 90)
|
||||
{
|
||||
for (yy = 0; yy < obr->h; yy++)
|
||||
evas_software_xcb_x_write_mask_line_vert(buf, obr->mxcbob,
|
||||
src_data + yy,
|
||||
h, // h
|
||||
obr->h - yy - 1, // ym
|
||||
w); // w
|
||||
}
|
||||
else if (buf->rot == 180)
|
||||
{
|
||||
for (yy = 0; yy < obr->h; yy++)
|
||||
{
|
||||
evas_software_xcb_x_write_mask_line_rev(buf, obr->mxcbob,
|
||||
src_data + (yy * obr->w),
|
||||
obr->w,
|
||||
obr->h - yy - 1);
|
||||
}
|
||||
}
|
||||
else if (buf->rot == 270)
|
||||
{
|
||||
for (yy = 0; yy < obr->h; yy++)
|
||||
evas_software_xcb_x_write_mask_line_vert_rev(buf, obr->mxcbob,
|
||||
src_data + yy,
|
||||
h, // h
|
||||
yy, // ym
|
||||
w); // w
|
||||
}
|
||||
#if 1
|
||||
#else
|
||||
/* XX async push */
|
||||
|
|
|
@ -761,7 +761,7 @@ evas_software_xlib_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, i
|
|||
Outbuf_Region *obr;
|
||||
DATA32 *src_data;
|
||||
void *data;
|
||||
int bpl = 0, xx, yy;
|
||||
int bpl = 0, yy;
|
||||
|
||||
obr = update->extended_info;
|
||||
if (buf->priv.pal)
|
||||
|
|
Loading…
Reference in New Issue