evas: make X11 use more generic logic.

This commit is contained in:
Cedric BAIL 2014-06-18 08:47:23 +02:00
parent 3e3fde5db9
commit edafa5344b
6 changed files with 109 additions and 475 deletions

View File

@ -30,25 +30,9 @@ typedef struct _Render_Engine Render_Engine;
struct _Render_Engine
{
Tilebuf *tb;
Outbuf *ob;
Tilebuf_Rect *rects;
Tilebuf_Rect *rects_prev[4];
Eina_Inlist *cur_rect;
short mode;
unsigned char end : 1;
unsigned char lost_back : 1;
void (*outbuf_free)(Outbuf *ob);
void (*outbuf_reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
int (*outbuf_get_rot)(Outbuf *ob);
RGBA_Image *(*outbuf_new_region_for_update)(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
void (*outbuf_push_updated_region)(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
void (*outbuf_free_region_for_update)(Outbuf *ob, RGBA_Image *update);
void (*outbuf_flush)(Outbuf *ob);
void (*outbuf_idle_flush)(Outbuf *ob);
int (*outbuf_swap_mode_get)(Outbuf *ob);
Render_Engine_Software_Generic generic;
Eina_Bool (*outbuf_alpha_get)(Outbuf *ob);
struct {
void *disp;
void *config;
@ -65,15 +49,6 @@ static void *eng_info(Evas *eo_e);
static void eng_info_free(Evas *eo_e, void *info);
static int eng_setup(Evas *eo_e, void *info);
static void eng_output_free(void *data);
static void eng_output_resize(void *data, int w, int h);
static void eng_output_tile_size_set(void *data, int w, int h);
static void eng_output_redraws_rect_add(void *data, int x, int y, int w, int h);
static void eng_output_redraws_rect_del(void *data, int x, int y, int w, int h);
static void eng_output_redraws_clear(void *data);
static void *eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
static void eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h, Evas_Render_Mode render_mode);
static void eng_output_flush(void *data, Evas_Render_Mode render_mode);
static void eng_output_idle_flush(void *data);
/* internal engine routines */
@ -159,6 +134,7 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
int shape_dither, int destination_alpha)
{
Render_Engine *re;
Outbuf *ob;
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
@ -166,16 +142,12 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
evas_software_xlib_x_color_init();
evas_software_xlib_outbuf_init();
re->ob =
evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp,
ob =
evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp,
draw, vis, cmap, depth, grayscale,
max_colors, mask, shape_dither,
destination_alpha);
if (!re->ob)
{
free(re);
return NULL;
}
if (!ob) goto on_error;
/* for updates return 1 big buffer, but only use portions of it, also cache
* it and keepit around until an idle_flush */
@ -187,19 +159,25 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
*/
// re->ob->onebuf = 1;
evas_software_xlib_outbuf_debug_set(re->ob, debug);
if (re->tb) evas_common_tilebuf_free(re->tb);
re->tb = evas_common_tilebuf_new(w, h);
if (!re->tb)
{
evas_software_xlib_outbuf_free(re->ob);
free(re);
return NULL;
}
evas_software_xlib_outbuf_debug_set(ob, debug);
if (!evas_render_engine_software_generic_init(&re->generic, ob, NULL,
evas_software_xlib_outbuf_get_rot,
evas_software_xlib_outbuf_reconfigure,
evas_software_xlib_outbuf_new_region_for_update,
evas_software_xlib_outbuf_push_updated_region,
evas_software_xlib_outbuf_free_region_for_update,
evas_software_xlib_outbuf_idle_flush,
evas_software_xlib_outbuf_flush,
evas_software_xlib_outbuf_free,
w, h))
goto on_error;
/* in preliminary tests 16x16 gave highest framerates */
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
return re;
on_error:
if (ob) evas_software_xlib_outbuf_free(ob);
free(re);
return NULL;
}
static void *
@ -210,35 +188,39 @@ _output_swapbuf_setup(int w, int h, int rot, Display *disp, Drawable draw,
int shape_dither, int destination_alpha)
{
Render_Engine *re;
Outbuf *ob;
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
evas_software_xlib_x_init();
evas_software_xlib_x_color_init();
evas_software_xlib_swapbuf_init();
re->ob =
evas_software_xlib_swapbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp,
ob =
evas_software_xlib_swapbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp,
draw, vis, cmap, depth, grayscale,
max_colors, mask, shape_dither,
destination_alpha);
if (!re->ob)
{
free(re);
return NULL;
}
if (!ob) goto on_error;
if (re->tb) evas_common_tilebuf_free(re->tb);
re->tb = evas_common_tilebuf_new(w, h);
if (!re->tb)
{
evas_software_xlib_swapbuf_free(re->ob);
free(re);
return NULL;
}
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
if (!evas_render_engine_software_generic_init(&re->generic, ob,
evas_software_xlib_swapbuf_buffer_state_get,
evas_software_xlib_swapbuf_get_rot,
evas_software_xlib_swapbuf_reconfigure,
evas_software_xlib_swapbuf_new_region_for_update,
evas_software_xlib_swapbuf_push_updated_region,
evas_software_xlib_swapbuf_free_region_for_update,
evas_software_xlib_swapbuf_idle_flush,
evas_software_xlib_swapbuf_flush,
evas_software_xlib_swapbuf_free,
w, h))
goto on_error;
return re;
on_error:
if (ob) evas_software_xlib_swapbuf_free(ob);
free(re);
return NULL;
}
#endif
@ -251,24 +233,21 @@ _output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn,
int shape_dither, int destination_alpha)
{
Render_Engine *re;
Outbuf *ob;
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
evas_software_xcb_init();
evas_software_xcb_color_init();
evas_software_xcb_outbuf_init();
re->ob =
evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn,
screen, draw, vis, cmap, depth,
grayscale, max_colors, mask,
shape_dither, destination_alpha);
if (!re->ob)
{
free(re);
return NULL;
}
/* for updates return 1 big buffer, but only use portions of it, also cache
ob = evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn
screen, draw, vis, cmap, depth,
grayscale, max_colors, mask,
shape_dither, destination_alpha);
if (!ob) goto on_error;
/* for updates return 1 big buffer, but only use portions of it, also cache
* it and keepit around until an idle_flush */
/* disable for now - i am hunting down why some expedite tests are slower,
@ -278,20 +257,25 @@ _output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn,
*/
// re->ob->onebuf = 1;
evas_software_xcb_outbuf_debug_set(re->ob, debug);
evas_software_xcb_outbuf_debug_set(ob, debug);
if (re->tb) evas_common_tilebuf_free(re->tb);
re->tb = evas_common_tilebuf_new(w, h);
if (!re->tb)
{
evas_software_xcb_outbuf_free(re->ob);
free(re);
return NULL;
}
/* in preliminary tests 16x16 gave highest framerates */
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
if (!evas_render_engine_software_generic_init(re, ob, NULL,
evas_software_xcb_outbuf_rotation_get,
evas_software_xcb_outbuf_reconfigure,
evas_software_xcb_outbuf_new_region_for_update,
evas_software_xcb_outbuf_push_updated_region,
evas_software_xcb_outbuf_free_region_for_update,
evas_software_xcb_outbuf_idle_flush,
evas_software_xcb_outbuf_flush,
evas_software_xcb_outbuf_free,
w, h))
goto on_error;
return re;
on_error:
if (ob) evas_software_xcb_outbuf_free(ob);
free(re);
return NULL;
}
#endif
@ -459,7 +443,7 @@ eng_setup(Evas *eo_e, void *in)
if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB)
{
static int try_swapbuf = -1;
if (try_swapbuf == -1)
{
if (getenv("EVAS_NO_DRI_SWAPBUF")) try_swapbuf = 0;
@ -475,21 +459,8 @@ eng_setup(Evas *eo_e, void *in)
info->info.alloc_colors_max,
info->info.mask, info->info.shape_dither,
info->info.destination_alpha);
if (re)
{
re->outbuf_free = evas_software_xlib_swapbuf_free;
re->outbuf_reconfigure = evas_software_xlib_swapbuf_reconfigure;
re->outbuf_get_rot = evas_software_xlib_swapbuf_get_rot;
re->outbuf_new_region_for_update = evas_software_xlib_swapbuf_new_region_for_update;
re->outbuf_push_updated_region = evas_software_xlib_swapbuf_push_updated_region;
re->outbuf_free_region_for_update = evas_software_xlib_swapbuf_free_region_for_update;
re->outbuf_flush = evas_software_xlib_swapbuf_flush;
re->outbuf_idle_flush = evas_software_xlib_swapbuf_idle_flush;
re->outbuf_alpha_get = evas_software_xlib_swapbuf_alpha_get;
re->outbuf_swap_mode_get = evas_software_xlib_swapbuf_buffer_state_get;
}
if (!re)
if (re) re->outbuf_alpha_get = evas_software_xlib_swapbuf_alpha_get;
else if (!re)
{
re = _output_xlib_setup(e->output.w, e->output.h,
info->info.rotation, info->info.connection,
@ -500,17 +471,7 @@ eng_setup(Evas *eo_e, void *in)
info->info.alloc_colors_max,
info->info.mask, info->info.shape_dither,
info->info.destination_alpha);
re->outbuf_free = evas_software_xlib_outbuf_free;
re->outbuf_reconfigure = evas_software_xlib_outbuf_reconfigure;
re->outbuf_get_rot = evas_software_xlib_outbuf_get_rot;
re->outbuf_new_region_for_update = evas_software_xlib_outbuf_new_region_for_update;
re->outbuf_push_updated_region = evas_software_xlib_outbuf_push_updated_region;
re->outbuf_free_region_for_update = evas_software_xlib_outbuf_free_region_for_update;
re->outbuf_flush = evas_software_xlib_outbuf_flush;
re->outbuf_idle_flush = evas_software_xlib_outbuf_idle_flush;
re->outbuf_alpha_get = evas_software_xlib_outbuf_alpha_get;
re->outbuf_swap_mode_get = NULL;
re->outbuf_alpha_get = evas_software_xlib_outbuf_alpha_get;
}
}
#endif
@ -519,25 +480,15 @@ eng_setup(Evas *eo_e, void *in)
if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB)
{
re = _output_xcb_setup(e->output.w, e->output.h,
info->info.rotation, info->info.connection,
info->info.screen, info->info.drawable,
info->info.visual, info->info.colormap,
info->info.depth, info->info.debug,
info->info.rotation, info->info.connection,
info->info.screen, info->info.drawable,
info->info.visual, info->info.colormap,
info->info.depth, info->info.debug,
info->info.alloc_grayscale,
info->info.alloc_colors_max,
info->info.mask, info->info.shape_dither,
info->info.destination_alpha);
re->outbuf_free = evas_software_xcb_outbuf_free;
re->outbuf_reconfigure = evas_software_xcb_outbuf_reconfigure;
re->outbuf_get_rot = evas_software_xcb_outbuf_rotation_get;
re->outbuf_new_region_for_update = evas_software_xcb_outbuf_new_region_for_update;
re->outbuf_push_updated_region = evas_software_xcb_outbuf_push_updated_region;
re->outbuf_free_region_for_update = evas_software_xcb_outbuf_free_region_for_update;
re->outbuf_flush = evas_software_xcb_outbuf_flush;
re->outbuf_idle_flush = evas_software_xcb_outbuf_idle_flush;
re->outbuf_alpha_get = evas_software_xcb_outbuf_alpha_get;
re->outbuf_swap_mode_get = NULL;
re->outbuf_alpha_get = evas_software_xcb_outbuf_alpha_get;
}
#endif
@ -545,20 +496,18 @@ eng_setup(Evas *eo_e, void *in)
}
else
{
int ponebuf = 0;
Outbuf *ob = NULL;
/* int ponebuf = 0; */
re = e->engine.data.output;
if ((re) && (re->ob)) ponebuf = re->ob->onebuf;
re = e->engine.data.output;
/* if ((re) && (re->ob)) ponebuf = re->ob->onebuf; */
#ifdef BUILD_ENGINE_SOFTWARE_XLIB
if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB)
{
// XXX
re->outbuf_free(re->ob);
if (re->outbuf_free == evas_software_xlib_swapbuf_free)
if (re->generic.outbuf_free == evas_software_xlib_swapbuf_free)
{
re->ob =
ob =
evas_software_xlib_swapbuf_setup_x(e->output.w, e->output.h,
info->info.rotation,
OUTBUF_DEPTH_INHERIT,
@ -575,7 +524,7 @@ eng_setup(Evas *eo_e, void *in)
}
else
{
re->ob =
ob =
evas_software_xlib_outbuf_setup_x(e->output.w, e->output.h,
info->info.rotation,
OUTBUF_DEPTH_INHERIT,
@ -589,7 +538,7 @@ eng_setup(Evas *eo_e, void *in)
info->info.mask,
info->info.shape_dither,
info->info.destination_alpha);
evas_software_xlib_outbuf_debug_set(re->ob, info->info.debug);
evas_software_xlib_outbuf_debug_set(ob, info->info.debug);
}
}
#endif
@ -598,7 +547,7 @@ eng_setup(Evas *eo_e, void *in)
if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB)
{
evas_software_xcb_outbuf_free(re->ob);
re->ob =
ob =
evas_software_xcb_outbuf_setup(e->output.w, e->output.h,
info->info.rotation,
OUTBUF_DEPTH_INHERIT,
@ -616,12 +565,18 @@ eng_setup(Evas *eo_e, void *in)
evas_software_xcb_outbuf_debug_set(re->ob, info->info.debug);
}
#endif
if ((re) && (re->ob)) re->ob->onebuf = ponebuf;
if (ob)
{
evas_render_engine_software_generic_update(&re->generic, ob);
}
/* if ((re) && (re->ob)) re->ob->onebuf = ponebuf; */
}
if (!e->engine.data.output) return 0;
if (!e->engine.data.context)
if (!e->engine.data.context)
{
e->engine.data.context =
e->engine.data.context =
e->engine.func->context_new(e->engine.data.output);
}
@ -637,13 +592,7 @@ eng_output_free(void *data)
if ((re = (Render_Engine *)data))
{
re->outbuf_free(re->ob);
evas_common_tilebuf_free(re->tb);
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
if (re->rects_prev[0]) evas_common_tilebuf_free_render_rects(re->rects_prev[0]);
if (re->rects_prev[1]) evas_common_tilebuf_free_render_rects(re->rects_prev[1]);
if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]);
if (re->rects_prev[3]) evas_common_tilebuf_free_render_rects(re->rects_prev[3]);
evas_render_engine_software_generic_clean(&re->generic);
#ifdef BUILD_ENGINE_SOFTWARE_XLIB
_output_egl_shutdown(re);
#endif
@ -654,298 +603,14 @@ eng_output_free(void *data)
evas_common_image_shutdown();
}
static void
eng_output_resize(void *data, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
re->outbuf_reconfigure(re->ob, w, h, re->outbuf_get_rot(re->ob),
OUTBUF_DEPTH_INHERIT);
evas_common_tilebuf_free(re->tb);
re->tb = evas_common_tilebuf_new(w, h);
if (re->tb)
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
}
static void
eng_output_tile_size_set(void *data, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_set_tile_size(re->tb, w, h);
}
static void
eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
}
static void
eng_output_redraws_rect_del(void *data, int x, int y, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
}
static void
eng_output_redraws_clear(void *data)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_clear(re->tb);
}
static Tilebuf_Rect *
_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3, Tilebuf_Rect *r4)
{
Tilebuf_Rect *r, *rects;
// int px1, py1, px2, py2;
if (r1)
{
EINA_INLIST_FOREACH(EINA_INLIST_GET(r1), r)
{
evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
}
}
if (r2)
{
EINA_INLIST_FOREACH(EINA_INLIST_GET(r2), r)
{
evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
}
}
if (r3)
{
EINA_INLIST_FOREACH(EINA_INLIST_GET(r3), r)
{
evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
}
}
if (r4)
{
EINA_INLIST_FOREACH(EINA_INLIST_GET(r4), r)
{
evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
}
}
rects = evas_common_tilebuf_get_render_rects(tb);
/*
// bounding box -> make a bounding box single region update of all regions.
// yes we could try and be smart and figure out size of regions, how far
// apart etc. etc. to try and figure out an optimal "set". this is a tradeoff
// between multiple update regions to render and total pixels to render.
if (rects)
{
int px1, py1, px2, py2;
px1 = rects->x; py1 = rects->y;
px2 = rects->x + rects->w; py2 = rects->y + rects->h;
EINA_INLIST_FOREACH(EINA_INLIST_GET(rects), r)
{
if (r->x < px1) px1 = r->x;
if (r->y < py1) py1 = r->y;
if ((r->x + r->w) > px2) px2 = r->x + r->w;
if ((r->y + r->h) > py2) py2 = r->y + r->h;
}
evas_common_tilebuf_free_render_rects(rects);
rects = calloc(1, sizeof(Tilebuf_Rect));
if (rects)
{
rects->x = px1;
rects->y = py1;
rects->w = px2 - px1;
rects->h = py2 - py1;
}
}
*/
evas_common_tilebuf_clear(tb);
return rects;
}
static void *
eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch)
{
Render_Engine *re;
RGBA_Image *surface;
Tilebuf_Rect *rect;
Eina_Bool first_rect = EINA_FALSE;
#define CLEAR_PREV_RECTS(x) \
do { \
if (re->rects_prev[x]) \
evas_common_tilebuf_free_render_rects(re->rects_prev[x]); \
re->rects_prev[x] = NULL; \
} while (0)
re = (Render_Engine *)data;
if (re->end)
{
re->end = 0;
return NULL;
}
if (!re->rects)
{
int mode = MODE_COPY;
re->rects = evas_common_tilebuf_get_render_rects(re->tb);
if (re->rects)
{
if (re->outbuf_swap_mode_get) mode = re->outbuf_swap_mode_get(re->ob);
re->mode = mode;
if ((re->lost_back) || (re->mode == MODE_FULL))
{
/* if we lost our backbuffer since the last frame redraw all */
re->lost_back = 0;
evas_common_tilebuf_add_redraw(re->tb, 0, 0, re->ob->w, re->ob->h);
evas_common_tilebuf_free_render_rects(re->rects);
re->rects = evas_common_tilebuf_get_render_rects(re->tb);
}
/* ensure we get rid of previous rect lists we dont need if mode
* changed/is appropriate */
evas_common_tilebuf_clear(re->tb);
CLEAR_PREV_RECTS(3);
re->rects_prev[3] = re->rects_prev[2];
re->rects_prev[2] = re->rects_prev[1];
re->rects_prev[1] = re->rects_prev[0];
re->rects_prev[0] = re->rects;
re->rects = NULL;
switch (re->mode)
{
case MODE_FULL:
case MODE_COPY: // no prev rects needed
re->rects = _merge_rects(re->tb, re->rects_prev[0], NULL, NULL, NULL);
break;
case MODE_DOUBLE: // double mode - only 1 level of prev rect
re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], NULL, NULL);
break;
case MODE_TRIPLE: // triple mode - 2 levels of prev rect
re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], NULL);
break;
case MODE_QUADRUPLE: // keep all
re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], re->rects_prev[3]);
break;
default:
break;
}
first_rect = EINA_TRUE;
}
evas_common_tilebuf_clear(re->tb);
re->cur_rect = EINA_INLIST_GET(re->rects);
}
if (!re->cur_rect) return NULL;
rect = (Tilebuf_Rect *)re->cur_rect;
if (re->rects)
{
switch (re->mode)
{
case MODE_COPY:
case MODE_DOUBLE:
case MODE_TRIPLE:
case MODE_QUADRUPLE:
rect = (Tilebuf_Rect *)re->cur_rect;
*x = rect->x;
*y = rect->y;
*w = rect->w;
*h = rect->h;
*cx = rect->x;
*cy = rect->y;
*cw = rect->w;
*ch = rect->h;
re->cur_rect = re->cur_rect->next;
break;
case MODE_FULL:
re->cur_rect = NULL;
if (x) *x = 0;
if (y) *y = 0;
if (w) *w = re->ob->w;
if (h) *h = re->ob->h;
if (cx) *cx = 0;
if (cy) *cy = 0;
if (cw) *cw = re->ob->w;
if (ch) *ch = re->ob->h;
break;
default:
break;
}
if (first_rect)
{
// do anything needed fir the first frame
}
surface =
re->outbuf_new_region_for_update(re->ob,
*x, *y, *w, *h,
cx, cy, cw, ch);
if (!re->cur_rect)
{
re->end = 1;
}
return surface;
}
return NULL;
}
static void
eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h, Evas_Render_Mode render_mode)
{
Render_Engine *re;
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
re = (Render_Engine *)data;
#if defined(BUILD_PIPE_RENDER)
evas_common_pipe_map_begin(surface);
#endif /* BUILD_PIPE_RENDER */
re->outbuf_push_updated_region(re->ob, surface, x, y, w, h);
re->outbuf_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt();
}
static void
eng_output_flush(void *data, Evas_Render_Mode render_mode)
{
Render_Engine *re;
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
re = (Render_Engine *)data;
re->outbuf_flush(re->ob);
if (re->rects)
{
evas_common_tilebuf_free_render_rects(re->rects);
re->rects = NULL;
}
}
static void
eng_output_idle_flush(void *data)
{
Render_Engine *re;
re = (Render_Engine *)data;
re->outbuf_idle_flush(re->ob);
}
static Eina_Bool
eng_canvas_alpha_get(void *data, void *context EINA_UNUSED)
{
Render_Engine *re;
re = (Render_Engine *)data;
return (re->ob->priv.destination_alpha) || (re->outbuf_alpha_get(re->ob));
return (re->generic.ob->priv.destination_alpha) ||
(re->outbuf_alpha_get(re->generic.ob));
}
@ -977,15 +642,6 @@ module_open(Evas_Module *em)
ORD(setup);
ORD(canvas_alpha_get);
ORD(output_free);
ORD(output_resize);
ORD(output_tile_size_set);
ORD(output_redraws_rect_add);
ORD(output_redraws_rect_del);
ORD(output_redraws_clear);
ORD(output_redraws_next_update_get);
ORD(output_redraws_next_update_push);
ORD(output_flush);
ORD(output_idle_flush);
/* now advertise out own api */
em->functions = (void *)(&func);

View File

@ -18,6 +18,8 @@
# include <xcb/xcb_image.h>
# endif
#include "../software_generic/Evas_Engine_Software_Generic.h"
extern int _evas_engine_soft_x11_log_dom;
# ifdef ERR
@ -46,30 +48,6 @@ extern int _evas_engine_soft_x11_log_dom;
# define CRI(...) \
EINA_LOG_DOM_CRIT(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
typedef enum _Outbuf_Depth Outbuf_Depth;
enum _Outbuf_Depth
{
OUTBUF_DEPTH_NONE,
OUTBUF_DEPTH_INHERIT,
OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED,
OUTBUF_DEPTH_RGB_32BPP_888_8888,
OUTBUF_DEPTH_LAST
};
enum {
MODE_FULL,
MODE_COPY,
MODE_DOUBLE,
MODE_TRIPLE,
MODE_QUADRUPLE
};
typedef struct _Outbuf Outbuf;
struct _Outbuf
{
Outbuf_Depth depth;

View File

@ -591,10 +591,10 @@ evas_software_xlib_swapbuf_alpha_get(Outbuf *buf)
return buf->priv.destination_alpha;
}
int
Render_Engine_Swap_Mode
evas_software_xlib_swapbuf_buffer_state_get(Outbuf *buf)
{
int mode;
Render_Engine_Swap_Mode mode;
if (!buf->priv.swapper) return MODE_FULL;
mode = evas_xlib_swapper_buffer_state_get(buf->priv.swapper);
return mode;

View File

@ -49,5 +49,5 @@ int evas_software_xlib_swapbuf_get_rot(Outbuf *buf);
void evas_software_xlib_swapbuf_rotation_set(Outbuf *buf,
int rot);
Eina_Bool evas_software_xlib_swapbuf_alpha_get(Outbuf *buf);
int evas_software_xlib_swapbuf_buffer_state_get(Outbuf *buf);
Render_Engine_Swap_Mode evas_software_xlib_swapbuf_buffer_state_get(Outbuf *buf);
#endif

View File

@ -253,7 +253,7 @@ evas_xlib_swapper_swap(X_Swapper *swp, Eina_Rectangle *rects, int nrects)
swp->buf_cur = (swp->buf_cur + 1) % swp->buf_num;
}
int
Render_Engine_Swap_Mode
evas_xlib_swapper_buffer_state_get(X_Swapper *swp)
{
int i, n, count = 0;
@ -818,7 +818,7 @@ evas_xlib_swapper_swap(X_Swapper *swp, Eina_Rectangle *rects, int nrects)
sym_XFixesDestroyRegion(swp->disp, region);
}
int
Render_Engine_Swap_Mode
evas_xlib_swapper_buffer_state_get(X_Swapper *swp)
{
DRI2BufferFlags *flags;
@ -929,7 +929,7 @@ evas_xlib_swapper_swap(X_Swapper *swp EINA_UNUSED, Eina_Rectangle *rects EINA_UN
{
}
int
Render_Engine_Swap_Mode
evas_xlib_swapper_buffer_state_get(X_Swapper *swp EINA_UNUSED)
{
return MODE_FULL;

View File

@ -8,7 +8,7 @@ void evas_xlib_swapper_free(X_Swapper *swp);
void *evas_xlib_swapper_buffer_map(X_Swapper *swp, int *bpl, int *w, int *h);
void evas_xlib_swapper_buffer_unmap(X_Swapper *swp);
void evas_xlib_swapper_swap(X_Swapper *swp, Eina_Rectangle *rects, int nrects);
int evas_xlib_swapper_buffer_state_get(X_Swapper *swp);
Render_Engine_Swap_Mode evas_xlib_swapper_buffer_state_get(X_Swapper *swp);
int evas_xlib_swapper_depth_get(X_Swapper *swp);
int evas_xlib_swapper_byte_order_get(X_Swapper *swp);
int evas_xlib_swapper_bit_order_get(X_Swapper *swp);