forked from enlightenment/efl
wayland_shm: Rename all the evas_dmabuf functions
These are going to find a home in ecore_wl2, and this is the last step before moving them all over there.
This commit is contained in:
parent
4e3016070a
commit
dd5edfae03
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
||||||
|
|
||||||
typedef struct _Surface Surface;
|
typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
|
||||||
struct _Surface
|
struct _Ecore_Wl2_Surface
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Window *wl2_win;
|
Ecore_Wl2_Window *wl2_win;
|
||||||
Ecore_Wl2_Buffer *current;
|
Ecore_Wl2_Buffer *current;
|
||||||
|
@ -18,16 +18,16 @@ struct _Surface
|
||||||
Eina_Bool alpha : 1;
|
Eina_Bool alpha : 1;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
void (*destroy)(Surface *surface);
|
void (*destroy)(Ecore_Wl2_Surface *surface);
|
||||||
void (*reconfigure)(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
|
void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
|
||||||
void *(*data_get)(Surface *surface, int *w, int *h);
|
void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h);
|
||||||
int (*assign)(Surface *surface);
|
int (*assign)(Ecore_Wl2_Surface *surface);
|
||||||
void (*post)(Surface *surface, Eina_Rectangle *rects, unsigned int count);
|
void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
|
||||||
} funcs;
|
} funcs;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force)
|
_evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force)
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Buffer *b;
|
Ecore_Wl2_Buffer *b;
|
||||||
Eina_List *l, *tmp;
|
Eina_List *l, *tmp;
|
||||||
|
@ -51,7 +51,7 @@ _evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_U
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
_evas_dmabuf_surface_data_get(Surface *s, int *w, int *h)
|
_evas_dmabuf_surface_data_get(Ecore_Wl2_Surface *s, int *w, int *h)
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Buffer *b;
|
Ecore_Wl2_Buffer *b;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
@ -76,7 +76,7 @@ _evas_dmabuf_surface_data_get(Surface *s, int *w, int *h)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Ecore_Wl2_Buffer *
|
static Ecore_Wl2_Buffer *
|
||||||
_evas_dmabuf_surface_wait(Surface *s)
|
_evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Buffer *b, *best = NULL;
|
Ecore_Wl2_Buffer *b, *best = NULL;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
@ -108,7 +108,7 @@ _evas_dmabuf_surface_wait(Surface *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_evas_dmabuf_surface_assign(Surface *s)
|
_evas_dmabuf_surface_assign(Ecore_Wl2_Surface *s)
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Buffer *b;
|
Ecore_Wl2_Buffer *b;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
@ -133,7 +133,7 @@ _evas_dmabuf_surface_assign(Surface *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_dmabuf_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
|
_evas_dmabuf_surface_post(Ecore_Wl2_Surface *s, Eina_Rectangle *rects, unsigned int count)
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Buffer *b;
|
Ecore_Wl2_Buffer *b;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ _evas_dmabuf_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_dmabuf_surface_destroy(Surface *s)
|
_evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s)
|
||||||
{
|
{
|
||||||
Ecore_Wl2_Buffer *b;
|
Ecore_Wl2_Buffer *b;
|
||||||
|
|
||||||
|
@ -165,45 +165,50 @@ _evas_dmabuf_surface_destroy(Surface *s)
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void surface_destroy(Surface *surface)
|
void
|
||||||
|
ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(surface);
|
EINA_SAFETY_ON_NULL_RETURN(surface);
|
||||||
|
|
||||||
surface->funcs.destroy(surface);
|
surface->funcs.destroy(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
void surface_reconfigure(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force)
|
void
|
||||||
|
ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(surface);
|
EINA_SAFETY_ON_NULL_RETURN(surface);
|
||||||
|
|
||||||
surface->funcs.reconfigure(surface, w, h, flags, force);
|
surface->funcs.reconfigure(surface, w, h, flags, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *surface_data_get(Surface *surface, int *w, int *h)
|
void *
|
||||||
|
ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
|
||||||
|
|
||||||
return surface->funcs.data_get(surface, w, h);
|
return surface->funcs.data_get(surface, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
int surface_assign(Surface *surface)
|
int
|
||||||
|
ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0);
|
||||||
|
|
||||||
return surface->funcs.assign(surface);
|
return surface->funcs.assign(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
void surface_post(Surface *surface, Eina_Rectangle *rects, unsigned int count)
|
void
|
||||||
|
ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(surface);
|
EINA_SAFETY_ON_NULL_RETURN(surface);
|
||||||
|
|
||||||
surface->funcs.post(surface, rects, count);
|
surface->funcs.post(surface, rects, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
Surface *
|
Ecore_Wl2_Surface *
|
||||||
_evas_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
|
ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
|
||||||
{
|
{
|
||||||
Surface *out;
|
Ecore_Wl2_Surface *out;
|
||||||
Ecore_Wl2_Display *ewd;
|
Ecore_Wl2_Display *ewd;
|
||||||
Ecore_Wl2_Buffer_Type types = 0;
|
Ecore_Wl2_Buffer_Type types = 0;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ extern int _evas_engine_way_shm_log_dom;
|
||||||
|
|
||||||
# define MAX_BUFFERS 4
|
# define MAX_BUFFERS 4
|
||||||
|
|
||||||
typedef struct _Surface Surface;
|
typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
|
||||||
|
|
||||||
struct _Outbuf
|
struct _Outbuf
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ struct _Outbuf
|
||||||
Ecore_Wl2_Display *ewd;
|
Ecore_Wl2_Display *ewd;
|
||||||
Evas_Engine_Info_Wayland *info;
|
Evas_Engine_Info_Wayland *info;
|
||||||
|
|
||||||
Surface *surface;
|
Ecore_Wl2_Surface *surface;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -107,8 +107,6 @@ struct _Outbuf
|
||||||
Eina_Bool dirty : 1;
|
Eina_Bool dirty : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
Surface *_evas_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
|
|
||||||
|
|
||||||
Outbuf *_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland *info);
|
Outbuf *_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland *info);
|
||||||
void _evas_outbuf_free(Outbuf *ob);
|
void _evas_outbuf_free(Outbuf *ob);
|
||||||
void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
|
void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
|
||||||
|
@ -121,11 +119,12 @@ void *_evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int
|
||||||
void _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
|
void _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
|
||||||
void _evas_outbuf_redraws_clear(Outbuf *ob);
|
void _evas_outbuf_redraws_clear(Outbuf *ob);
|
||||||
|
|
||||||
void surface_destroy(Surface *surface);
|
Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
|
||||||
void surface_reconfigure(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
|
void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
|
||||||
void *surface_data_get(Surface *surface, int *w, int *h);
|
void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
|
||||||
int surface_assign(Surface *surface);
|
void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h);
|
||||||
void surface_post(Surface *surface, Eina_Rectangle *rects, unsigned int count);
|
int ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface);
|
||||||
|
void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -28,8 +28,8 @@ _evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland *info)
|
||||||
ob->priv.destination_alpha = info->info.destination_alpha;
|
ob->priv.destination_alpha = info->info.destination_alpha;
|
||||||
ob->ewd = ecore_wl2_window_display_get(info->info.wl2_win);
|
ob->ewd = ecore_wl2_window_display_get(info->info.wl2_win);
|
||||||
|
|
||||||
ob->surface = _evas_surface_create(info->info.wl2_win,
|
ob->surface = ecore_wl2_surface_create(info->info.wl2_win,
|
||||||
ob->priv.destination_alpha);
|
ob->priv.destination_alpha);
|
||||||
if (!ob->surface) goto surf_err;
|
if (!ob->surface) goto surf_err;
|
||||||
|
|
||||||
eina_array_step_set(&ob->priv.onebuf_regions, sizeof(Eina_Array), 8);
|
eina_array_step_set(&ob->priv.onebuf_regions, sizeof(Eina_Array), 8);
|
||||||
|
@ -70,7 +70,7 @@ _evas_outbuf_free(Outbuf *ob)
|
||||||
_evas_outbuf_flush(ob, NULL, NULL, EVAS_RENDER_MODE_UNDEF);
|
_evas_outbuf_flush(ob, NULL, NULL, EVAS_RENDER_MODE_UNDEF);
|
||||||
_evas_outbuf_idle_flush(ob);
|
_evas_outbuf_idle_flush(ob);
|
||||||
|
|
||||||
if (ob->surface) surface_destroy(ob->surface);
|
if (ob->surface) ecore_wl2_surface_destroy(ob->surface);
|
||||||
|
|
||||||
eina_array_flush(&ob->priv.onebuf_regions);
|
eina_array_flush(&ob->priv.onebuf_regions);
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ _evas_outbuf_swap_mode_get(Outbuf *ob)
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
age = surface_assign(ob->surface);
|
age = ecore_wl2_surface_assign(ob->surface);
|
||||||
if (!age) return MODE_FULL;
|
if (!age) return MODE_FULL;
|
||||||
|
|
||||||
else if (age == 1) return MODE_COPY;
|
else if (age == 1) return MODE_COPY;
|
||||||
|
@ -290,11 +290,11 @@ _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth,
|
||||||
|
|
||||||
if ((ob->rotation == 0) || (ob->rotation == 180))
|
if ((ob->rotation == 0) || (ob->rotation == 180))
|
||||||
{
|
{
|
||||||
surface_reconfigure(ob->surface, w, h, resize, dirty);
|
ecore_wl2_surface_reconfigure(ob->surface, w, h, resize, dirty);
|
||||||
}
|
}
|
||||||
else if ((ob->rotation == 90) || (ob->rotation == 270))
|
else if ((ob->rotation == 90) || (ob->rotation == 270))
|
||||||
{
|
{
|
||||||
surface_reconfigure(ob->surface, h, w, resize, dirty);
|
ecore_wl2_surface_reconfigure(ob->surface, h, w, resize, dirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
_evas_outbuf_idle_flush(ob);
|
_evas_outbuf_idle_flush(ob);
|
||||||
|
@ -318,7 +318,7 @@ _evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx,
|
||||||
int bw = 0, bh = 0;
|
int bw = 0, bh = 0;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
if (!(data = surface_data_get(ob->surface, &bw, &bh)))
|
if (!(data = ecore_wl2_surface_data_get(ob->surface, &bw, &bh)))
|
||||||
{
|
{
|
||||||
/* ERR("Could not get surface data"); */
|
/* ERR("Could not get surface data"); */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -494,7 +494,7 @@ _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, in
|
||||||
bpp = depth / 8;
|
bpp = depth / 8;
|
||||||
|
|
||||||
/* check for valid desination data */
|
/* check for valid desination data */
|
||||||
if (!(dst = surface_data_get(ob->surface, &ww, &hh)))
|
if (!(dst = ecore_wl2_surface_data_get(ob->surface, &ww, &hh)))
|
||||||
{
|
{
|
||||||
/* ERR("Could not get surface data"); */
|
/* ERR("Could not get surface data"); */
|
||||||
return;
|
return;
|
||||||
|
@ -552,7 +552,7 @@ _evas_outbuf_redraws_clear(Outbuf *ob)
|
||||||
if (!ob->priv.rect_count) return;
|
if (!ob->priv.rect_count) return;
|
||||||
wls = ecore_wl2_window_surface_get(ob->info->info.wl2_win);
|
wls = ecore_wl2_window_surface_get(ob->info->info.wl2_win);
|
||||||
if (wls)
|
if (wls)
|
||||||
surface_post(ob->surface, ob->priv.rects, ob->priv.rect_count);
|
ecore_wl2_surface_post(ob->surface, ob->priv.rects, ob->priv.rect_count);
|
||||||
free(ob->priv.rects);
|
free(ob->priv.rects);
|
||||||
ob->priv.rect_count = 0;
|
ob->priv.rect_count = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue