Evas (wayland_shm): Support setting destination alpha.

SVN revision: 69072
This commit is contained in:
Christopher Michael 2012-03-09 02:33:37 +00:00
parent 394e8af271
commit ec001b86a2
4 changed files with 14 additions and 9 deletions

View File

@ -11,7 +11,8 @@ struct _Evas_Engine_Info_Wayland_Shm
void *dest; void *dest;
int rotation; int rotation;
unsigned char debug : 1; Eina_Bool destination_alpha : 1;
Eina_Bool debug : 1;
} info; } info;
Evas_Engine_Render_Mode render_mode; Evas_Engine_Render_Mode render_mode;

View File

@ -28,7 +28,7 @@ static Evas_Func func, pfunc;
int _evas_engine_way_shm_log_dom = -1; int _evas_engine_way_shm_log_dom = -1;
/* local function prototypes */ /* local function prototypes */
static void *_output_setup(int w, int h, int rotation, void *dest); static void *_output_setup(int w, int h, int rotation, Eina_Bool alpha, void *dest);
/* engine function prototypes */ /* engine function prototypes */
static void *eng_info(Evas *evas __UNUSED__); static void *eng_info(Evas *evas __UNUSED__);
@ -48,7 +48,7 @@ static Eina_Bool eng_canvas_alpha_get(void *data, void *context __UNUSED__);
/* local functions */ /* local functions */
static void * static void *
_output_setup(int w, int h, int rotation, void *dest) _output_setup(int w, int h, int rotation, Eina_Bool alpha, void *dest)
{ {
Render_Engine *re = NULL; Render_Engine *re = NULL;
@ -56,7 +56,7 @@ _output_setup(int w, int h, int rotation, void *dest)
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
if (!(re->ob = evas_outbuf_setup(w, h, rotation, dest))) if (!(re->ob = evas_outbuf_setup(w, h, rotation, alpha, dest)))
{ {
free(re); free(re);
return NULL; return NULL;
@ -127,7 +127,8 @@ eng_setup(Evas *evas, void *info)
evas_common_tilebuf_init(); evas_common_tilebuf_init();
re = _output_setup(evas->output.w, evas->output.h, re = _output_setup(evas->output.w, evas->output.h,
in->info.rotation, in->info.dest); in->info.rotation, in->info.destination_alpha,
in->info.dest);
if (!re) return 0; if (!re) return 0;
re->outbuf_free = evas_outbuf_free; re->outbuf_free = evas_outbuf_free;
@ -141,7 +142,8 @@ eng_setup(Evas *evas, void *info)
if (!(re = evas->engine.data.output)) return 0; if (!(re = evas->engine.data.output)) return 0;
if (re->ob) re->outbuf_free(re->ob); if (re->ob) re->outbuf_free(re->ob);
re->ob = evas_outbuf_setup(evas->output.w, evas->output.h, re->ob = evas_outbuf_setup(evas->output.w, evas->output.h,
in->info.rotation, in->info.dest); 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_free(re->tb);
if ((re->tb = evas_common_tilebuf_new(evas->output.w, evas->output.h))) if ((re->tb = evas_common_tilebuf_new(evas->output.w, evas->output.h)))
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);

View File

@ -47,12 +47,13 @@ struct _Outbuf
{ {
void *dest; void *dest;
RGBA_Image *buffer; RGBA_Image *buffer;
Eina_Bool destination_alpha : 1;
} priv; } priv;
}; };
void evas_outbuf_free(Outbuf *ob); void evas_outbuf_free(Outbuf *ob);
void evas_outbuf_resize(Outbuf *ob, int w, int h); void evas_outbuf_resize(Outbuf *ob, int w, int h);
Outbuf *evas_outbuf_setup(int w, int h, int rot, void *dest); 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); 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 __UNUSED__, int y, int w, int h); void evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__, int y, int w, int h);
void evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update); void evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update);

View File

@ -21,7 +21,7 @@ evas_outbuf_resize(Outbuf *ob, int w, int h)
} }
Outbuf * Outbuf *
evas_outbuf_setup(int w, int h, int rot, void *dest) evas_outbuf_setup(int w, int h, int rot, Eina_Bool alpha, void *dest)
{ {
Outbuf *ob = NULL; Outbuf *ob = NULL;
@ -31,6 +31,7 @@ evas_outbuf_setup(int w, int h, int rot, void *dest)
ob->h = h; ob->h = h;
ob->rotation = rot; ob->rotation = rot;
ob->priv.dest = dest; ob->priv.dest = dest;
ob->priv.destination_alpha = alpha;
ob->priv.buffer = ob->priv.buffer =
(RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
@ -56,7 +57,7 @@ evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *c
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) if (im)
{ {
im->cache_entry.flags.alpha = 1; im->cache_entry.flags.alpha = ob->priv.destination_alpha;
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h); im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
} }