forked from enlightenment/efl
Evas (wayland_shm): Support evas cserve2.
SVN revision: 73200
This commit is contained in:
parent
befdf76da4
commit
0219f765be
|
@ -5,11 +5,11 @@ AM_CPPFLAGS = \
|
||||||
-I. \
|
-I. \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/lib/include \
|
-I$(top_srcdir)/src/lib/include \
|
||||||
|
-I$(top_srcdir)/src/lib/cserve2 \
|
||||||
-I$(top_srcdir)/src/modules/engines \
|
-I$(top_srcdir)/src/modules/engines \
|
||||||
@FREETYPE_CFLAGS@ \
|
@FREETYPE_CFLAGS@ \
|
||||||
@PIXMAN_CFLAGS@ \
|
@PIXMAN_CFLAGS@ \
|
||||||
@EINA_CFLAGS@ \
|
@EINA_CFLAGS@ \
|
||||||
@FRIBIDI_CFLAGS@ \
|
|
||||||
@evas_engine_wayland_shm_cflags@
|
@evas_engine_wayland_shm_cflags@
|
||||||
|
|
||||||
if BUILD_ENGINE_WAYLAND_SHM
|
if BUILD_ENGINE_WAYLAND_SHM
|
||||||
|
|
|
@ -261,9 +261,9 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
|
||||||
re->rects = NULL;
|
re->rects = NULL;
|
||||||
re->end = EINA_TRUE;
|
re->end = EINA_TRUE;
|
||||||
}
|
}
|
||||||
if ((ux + uw) > re->ob->w) uw = re->ob->w - ux;
|
/* if ((ux + uw) > re->ob->w) uw = re->ob->w - ux; */
|
||||||
if ((uy + uh) > re->ob->h) uh = re->ob->h - uy;
|
/* if ((uy + uh) > re->ob->h) uh = re->ob->h - uy; */
|
||||||
if ((uw <= 0) || (uh <= 0)) return NULL;
|
/* if ((uw <= 0) || (uh <= 0)) return NULL; */
|
||||||
surface =
|
surface =
|
||||||
re->outbuf_new_region_for_update(re->ob, ux, uy, uw, uh, cx, cy, cw, ch);
|
re->outbuf_new_region_for_update(re->ob, ux, uy, uw, uh, cx, cy, cw, ch);
|
||||||
if (x) *x = ux;
|
if (x) *x = ux;
|
||||||
|
|
|
@ -46,7 +46,13 @@ struct _Outbuf
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
void *dest;
|
void *dest;
|
||||||
|
|
||||||
RGBA_Image *buffer;
|
RGBA_Image *buffer;
|
||||||
|
Eina_List *buffer_regions;
|
||||||
|
|
||||||
|
Eina_List *pending_writes;
|
||||||
|
Eina_List *prev_pending_writes;
|
||||||
|
|
||||||
Eina_Bool destination_alpha : 1;
|
Eina_Bool destination_alpha : 1;
|
||||||
} priv;
|
} priv;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef EVAS_CSERVE2
|
||||||
|
# include "evas_cs2_private.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "evas_common.h"
|
#include "evas_common.h"
|
||||||
#include "evas_engine.h"
|
#include "evas_engine.h"
|
||||||
|
|
||||||
|
@ -5,7 +13,16 @@ void
|
||||||
evas_outbuf_free(Outbuf *ob)
|
evas_outbuf_free(Outbuf *ob)
|
||||||
{
|
{
|
||||||
if (!ob) return;
|
if (!ob) return;
|
||||||
if (ob->priv.buffer) evas_cache_image_drop(&ob->priv.buffer->cache_entry);
|
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);
|
free(ob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +33,15 @@ evas_outbuf_resize(Outbuf *ob, int w, int h)
|
||||||
if ((ob->w == w) && (ob->h == h)) return;
|
if ((ob->w == w) && (ob->h == h)) return;
|
||||||
ob->w = w;
|
ob->w = w;
|
||||||
ob->h = h;
|
ob->h = h;
|
||||||
if (ob->priv.buffer) evas_cache_image_drop(&ob->priv.buffer->cache_entry);
|
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;
|
ob->priv.buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +58,22 @@ evas_outbuf_setup(int w, int h, int rot, Eina_Bool alpha, void *dest)
|
||||||
ob->priv.dest = dest;
|
ob->priv.dest = dest;
|
||||||
ob->priv.destination_alpha = alpha;
|
ob->priv.destination_alpha = alpha;
|
||||||
|
|
||||||
ob->priv.buffer =
|
#ifdef EVAS_CSERVE2
|
||||||
(RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
|
if (evas_cserve2_use_get())
|
||||||
w, h, ob->priv.dest,
|
{
|
||||||
1, EVAS_COLORSPACE_ARGB8888);
|
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;
|
return ob;
|
||||||
}
|
}
|
||||||
|
@ -54,11 +91,22 @@ evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *c
|
||||||
RGBA_Image *im;
|
RGBA_Image *im;
|
||||||
|
|
||||||
*cx = 0; *cy = 0; *cw = w; *ch = h;
|
*cx = 0; *cy = 0; *cw = w; *ch = h;
|
||||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
#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)
|
if (im)
|
||||||
{
|
{
|
||||||
im->cache_entry.flags.alpha = ob->priv.destination_alpha;
|
im->cache_entry.flags.alpha = ob->priv.destination_alpha;
|
||||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
#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 im;
|
||||||
|
@ -68,9 +116,20 @@ evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *c
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__, int y, int w, int h)
|
evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
|
DATA32 *dst, *src, *dest;
|
||||||
|
int bytes = 0;
|
||||||
|
|
||||||
if (!ob->priv.dest) return;
|
if (!ob->priv.dest) return;
|
||||||
|
|
||||||
|
bytes = ((w * sizeof(int)) * h);
|
||||||
|
dest = (DATA32 *)((DATA8 *)(ob->priv.dest) + (y * bytes) + (x * 4));
|
||||||
|
/* if (ob->func.new_update_region) */
|
||||||
|
/* { */
|
||||||
|
/* dest = ob->func.new_update_region(x, y, w, h, &bytes); */
|
||||||
|
/* } */
|
||||||
|
|
||||||
if (!ob->priv.buffer)
|
if (!ob->priv.buffer)
|
||||||
{
|
{
|
||||||
Gfx_Func_Copy func;
|
Gfx_Func_Copy func;
|
||||||
|
@ -78,10 +137,8 @@ evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__
|
||||||
func = evas_common_draw_func_copy_get(w, 0);
|
func = evas_common_draw_func_copy_get(w, 0);
|
||||||
if (func)
|
if (func)
|
||||||
{
|
{
|
||||||
DATA32 *dst, *src;
|
int yy = 0;
|
||||||
int yy = 0, bytes = 0;
|
|
||||||
|
|
||||||
bytes = ((w * sizeof(int)) * h);
|
|
||||||
for (yy = 0; yy < h; yy++)
|
for (yy = 0; yy < h; yy++)
|
||||||
{
|
{
|
||||||
src = update->image.data + (yy * update->cache_entry.w);
|
src = update->image.data + (yy * update->cache_entry.w);
|
||||||
|
@ -91,11 +148,21 @@ evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* if (ob->func.free_update_region) */
|
||||||
|
/* ob->func.free_update_region(x, y, w, h, dest); */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update)
|
evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update)
|
||||||
{
|
{
|
||||||
if (!ob) return;
|
if (!ob) return;
|
||||||
if (update != ob->priv.buffer) evas_cache_image_drop(&update->cache_entry);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue