Remove old wayland shm engine code.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 83211
This commit is contained in:
Christopher Michael 2013-01-24 09:13:54 +00:00 committed by Christopher Michael
parent 6f9d4f9fd4
commit 0b5e371bc7
4 changed files with 0 additions and 625 deletions

View File

@ -1,27 +0,0 @@
#ifndef _EVAS_ENGINE_WAYLAND_SHM_H
# define _EVAS_ENGINE_WAYLAND_SHM_H
#include <Evas.h>
/*
* Wayland supoprt is considered experimental as wayland itself is still
* unstable and liable to change core protocol. If you use this api, it is
* possible it will break in future, until this notice is removed.
*/
typedef struct _Evas_Engine_Info_Wayland_Shm Evas_Engine_Info_Wayland_Shm;
struct _Evas_Engine_Info_Wayland_Shm
{
Evas_Engine_Info magic;
struct
{
void *dest;
int rotation;
Eina_Bool destination_alpha : 1;
} info;
Evas_Engine_Render_Mode render_mode;
};
#endif

View File

@ -1,375 +0,0 @@
#include "evas_common.h"
#include "evas_private.h"
#include "evas_engine.h"
#include "Evas_Engine_Wayland_Shm.h"
/* local structures */
typedef struct _Render_Engine Render_Engine;
struct _Render_Engine
{
Tilebuf *tb;
Tilebuf_Rect *rects;
Outbuf *ob;
Eina_Inlist *cur_rect;
Eina_Bool end : 1;
void (*outbuf_free)(Outbuf *ob);
void (*outbuf_resize)(Outbuf *ob, int w, int h);
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 *surface, int x, int y, int w, int h);
void (*outbuf_free_region_for_update)(Outbuf *ob, RGBA_Image *update);
};
/* local variables */
static Evas_Func func, pfunc;
/* external variables */
int _evas_engine_way_shm_log_dom = -1;
/* local function prototypes */
static void *_output_setup(int w, int h, int rotation, Eina_Bool alpha, void *dest);
/* engine function prototypes */
static void *eng_info(Evas *eo_evas EINA_UNUSED);
static void eng_info_free(Evas *eo_evas EINA_UNUSED, void *info);
static int eng_setup(Evas *eo_evas, 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);
static Eina_Bool eng_canvas_alpha_get(void *data, void *context EINA_UNUSED);
/* local functions */
static void *
_output_setup(int w, int h, int rotation, Eina_Bool alpha, void *dest)
{
Render_Engine *re = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
if (!(re->ob = evas_outbuf_setup(w, h, rotation, alpha, dest)))
{
free(re);
return NULL;
}
if (!(re->tb = evas_common_tilebuf_new(w, h)))
{
evas_outbuf_free(re->ob);
free(re);
return NULL;
}
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
return re;
}
/* engine functions */
static void *
eng_info(Evas *eo_evas EINA_UNUSED)
{
Evas_Engine_Info_Wayland_Shm *info;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(info = calloc(1, sizeof(Evas_Engine_Info_Wayland_Shm))))
return NULL;
info->magic.magic = rand();
info->render_mode = EVAS_RENDER_MODE_BLOCKING;
return info;
}
static void
eng_info_free(Evas *eo_evas EINA_UNUSED, void *info)
{
Evas_Engine_Info_Wayland_Shm *in;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(in = (Evas_Engine_Info_Wayland_Shm *)info)) return;
free(in);
}
static int
eng_setup(Evas *eo_evas, void *info)
{
Evas_Public_Data *evas = eo_data_get(eo_evas, EVAS_CLASS);
Evas_Engine_Info_Wayland_Shm *in;
Render_Engine *re = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(in = (Evas_Engine_Info_Wayland_Shm *)info)) return 0;
if (!evas->engine.data.output)
{
evas_common_cpu_init();
evas_common_blend_init();
evas_common_image_init();
evas_common_convert_init();
evas_common_scale_init();
evas_common_rectangle_init();
evas_common_polygon_init();
evas_common_line_init();
evas_common_font_init();
evas_common_draw_init();
evas_common_tilebuf_init();
re = _output_setup(evas->output.w, evas->output.h,
in->info.rotation, in->info.destination_alpha,
in->info.dest);
if (!re) return 0;
re->outbuf_free = evas_outbuf_free;
re->outbuf_resize = evas_outbuf_resize;
re->outbuf_new_region_for_update = evas_outbuf_new_region_for_update;
re->outbuf_push_updated_region = evas_outbuf_push_updated_region;
re->outbuf_free_region_for_update = evas_outbuf_free_region_for_update;
}
else
{
if (!(re = evas->engine.data.output)) return 0;
if (re->ob) re->outbuf_free(re->ob);
re->ob = evas_outbuf_setup(evas->output.w, evas->output.h,
in->info.rotation,
in->info.destination_alpha, in->info.dest);
if (re->tb) evas_common_tilebuf_free(re->tb);
if ((re->tb = evas_common_tilebuf_new(evas->output.w, evas->output.h)))
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
}
evas->engine.data.output = re;
if (!evas->engine.data.context)
{
evas->engine.data.context =
evas->engine.func->context_new(evas->engine.data.output);
}
return 1;
}
static void
eng_output_free(void *data)
{
Render_Engine *re = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((re = (Render_Engine *)data))
{
if (re->ob) re->outbuf_free(re->ob);
if (re->tb) evas_common_tilebuf_free(re->tb);
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
free(re);
}
evas_common_font_shutdown();
evas_common_image_shutdown();
}
static void
eng_output_resize(void *data, int w, int h)
{
Render_Engine *re = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(re = (Render_Engine *)data)) return;
if (re->ob) re->outbuf_resize(re->ob, w, h);
if (re->tb) evas_common_tilebuf_free(re->tb);
if ((re->tb = evas_common_tilebuf_new(w, h)))
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 = NULL;
if (!(re = (Render_Engine *)data)) return;
if (re->tb) 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 = NULL;
if (!(re = (Render_Engine *)data)) return;
if (re->tb) 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 = NULL;
if (!(re = (Render_Engine *)data)) return;
if (re->tb) evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
}
static void
eng_output_redraws_clear(void *data)
{
Render_Engine *re = NULL;
if (!(re = (Render_Engine *)data)) return;
if (re->tb) evas_common_tilebuf_clear(re->tb);
}
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 = NULL;
RGBA_Image *surface;
Tilebuf_Rect *rect;
int ux = 0, uy = 0, uw = 0, uh = 0;
if (!(re = (Render_Engine *)data)) return NULL;
if (re->end)
{
re->end = EINA_FALSE;
return NULL;
}
if (!re->rects)
{
re->rects = evas_common_tilebuf_get_render_rects(re->tb);
re->cur_rect = EINA_INLIST_GET(re->rects);
}
if (!re->cur_rect) return NULL;
rect = (Tilebuf_Rect *)re->cur_rect;
ux = rect->x;
uy = rect->y;
uw = rect->w;
uh = rect->h;
re->cur_rect = re->cur_rect->next;
if (!re->cur_rect)
{
evas_common_tilebuf_free_render_rects(re->rects);
re->rects = NULL;
re->end = EINA_TRUE;
}
if ((ux + uw) > re->ob->w) uw = re->ob->w - ux;
if ((uy + uh) > re->ob->h) uh = re->ob->h - uy;
if ((uw <= 0) || (uh <= 0)) return NULL;
surface =
re->outbuf_new_region_for_update(re->ob, ux, uy, uw, uh, cx, cy, cw, ch);
if (x) *x = ux;
if (y) *y = uy;
if (w) *w = uw;
if (h) *h = uh;
return surface;
}
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 = NULL;
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
if (!(re = (Render_Engine *)data)) return;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_map_begin(surface);
#endif
if (re->ob)
{
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 = NULL;
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
if (!(re = (Render_Engine *)data)) return;
}
static void
eng_output_idle_flush(void *data)
{
Render_Engine *re = NULL;
if (!(re = (Render_Engine *)data)) return;
}
static Eina_Bool
eng_canvas_alpha_get(void *data, void *context EINA_UNUSED)
{
Render_Engine *re = NULL;
if (!(re = (Render_Engine *)data)) return EINA_FALSE;
return (re->ob->priv.destination_alpha);
}
/* module functions */
static int
module_open(Evas_Module *em)
{
if (!em) return 0;
if (!_evas_module_engine_inherit(&pfunc, "software_generic"))
return 0;
_evas_engine_way_shm_log_dom =
eina_log_domain_register("evas-wayland_shm", EVAS_DEFAULT_LOG_COLOR);
if (_evas_engine_way_shm_log_dom < 0)
{
EINA_LOG_ERR("Could not create a module log domain.");
return 0;
}
func = pfunc;
#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
ORD(info);
ORD(info_free);
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);
em->functions = (void *)(&func);
return 1;
}
static void
module_close(Evas_Module *em EINA_UNUSED)
{
eina_log_domain_unregister(_evas_engine_way_shm_log_dom);
}
static Evas_Module_Api evas_modapi =
{
EVAS_MODULE_API_VERSION, "wayland_shm", "none", {module_open, module_close}
};
EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, wayland_shm);
#ifndef EVAS_STATIC_BUILD_WAYLAND_SHM
EVAS_EINA_MODULE_DEFINE(engine, wayland_shm);
#endif

View File

@ -1,63 +0,0 @@
#ifndef _EVAS_ENGINE_H
# define _EVAS_ENGINE_H
//# define LOGFNS 1
# ifdef LOGFNS
# include <stdio.h>
# define LOGFN(fl, ln, fn) printf("-EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
# else
# define LOGFN(fl, ln, fn)
# endif
extern int _evas_engine_way_shm_log_dom;
# ifdef ERR
# undef ERR
# endif
# define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_way_shm_log_dom, __VA_ARGS__)
# ifdef DBG
# undef DBG
# endif
# define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_way_shm_log_dom, __VA_ARGS__)
# ifdef INF
# undef INF
# endif
# define INF(...) EINA_LOG_DOM_INFO(_evas_engine_way_shm_log_dom, __VA_ARGS__)
# ifdef WRN
# undef WRN
# endif
# define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_way_shm_log_dom, __VA_ARGS__)
# ifdef CRIT
# undef CRIT
# endif
# define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_way_shm_log_dom, __VA_ARGS__)
typedef struct _Outbuf Outbuf;
struct _Outbuf
{
int w, h;
int rotation;
struct
{
void *dest;
RGBA_Image *buffer;
Eina_Bool destination_alpha : 1;
} priv;
};
void evas_outbuf_free(Outbuf *ob);
void evas_outbuf_resize(Outbuf *ob, int w, int h);
Outbuf *evas_outbuf_setup(int w, int h, int rot, Eina_Bool alpha, void *dest);
RGBA_Image *evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
void evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
void evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update);
#endif

View File

@ -1,160 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef EVAS_CSERVE2
# include "evas_cs2_private.h"
#endif
#include "evas_common.h"
#include "evas_engine.h"
void
evas_outbuf_free(Outbuf *ob)
{
if (!ob) return;
if (ob->priv.buffer)
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_close(&ob->priv.buffer->cache_entry);
else
#endif
evas_cache_image_drop(&ob->priv.buffer->cache_entry);
}
free(ob);
}
void
evas_outbuf_resize(Outbuf *ob, int w, int h)
{
if (!ob) return;
if ((ob->w == w) && (ob->h == h)) return;
ob->w = w;
ob->h = h;
if (ob->priv.buffer)
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_close(&ob->priv.buffer->cache_entry);
else
#endif
evas_cache_image_drop(&ob->priv.buffer->cache_entry);
}
ob->priv.buffer = NULL;
}
Outbuf *
evas_outbuf_setup(int w, int h, int rot, Eina_Bool alpha, void *dest)
{
Outbuf *ob = NULL;
if (!(ob = calloc(1, sizeof(Outbuf)))) return NULL;
ob->w = w;
ob->h = h;
ob->rotation = rot;
ob->priv.dest = dest;
ob->priv.destination_alpha = alpha;
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
{
ob->priv.buffer =
(RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
w, h, ob->priv.dest,
1, EVAS_COLORSPACE_ARGB8888);
}
else
#endif
{
ob->priv.buffer =
(RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
w, h, ob->priv.dest,
1, EVAS_COLORSPACE_ARGB8888);
}
return ob;
}
RGBA_Image *
evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch)
{
if (ob->priv.buffer)
{
*cx = x; *cy = y; *cw = w; *ch = h;
return ob->priv.buffer;
}
else
{
RGBA_Image *im;
*cx = 0; *cy = 0; *cw = w; *ch = h;
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
else
#endif
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
if (im)
{
im->cache_entry.flags.alpha = ob->priv.destination_alpha;
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_size_set(&im->cache_entry, w, h);
else
#endif
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
}
return im;
}
return NULL;
}
void
evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h)
{
DATA32 *dst, *src;
int bytes = 0;
if (!ob->priv.dest) return;
bytes = ((w * sizeof(int)) * h);
if (!ob->priv.buffer)
{
Gfx_Func_Copy func;
func = evas_common_draw_func_copy_get(w, 0);
if (func)
{
int yy = 0;
for (yy = 0; yy < h; yy++)
{
src = update->image.data + (yy * update->cache_entry.w);
dst = (DATA32 *)((DATA8 *)(ob->priv.dest) +
((y + yy) * bytes));
func(src, dst + x, w);
}
}
}
}
void
evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update)
{
if (!ob) return;
if (update != ob->priv.buffer)
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_close(&update->cache_entry);
else
#endif
evas_cache_image_drop(&update->cache_entry);
}
}