#include "linux-dmabuf-unstable-v1-client-protocol.h"
-typedef struct _Surface Surface;
-struct _Surface
+typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
+struct _Ecore_Wl2_Surface
{
Ecore_Wl2_Window *wl2_win;
Ecore_Wl2_Buffer *current;
Eina_Bool alpha : 1;
struct
{
- void (*destroy)(Surface *surface);
- void (*reconfigure)(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
- void *(*data_get)(Surface *surface, int *w, int *h);
- int (*assign)(Surface *surface);
- void (*post)(Surface *surface, Eina_Rectangle *rects, unsigned int count);
+ void (*destroy)(Ecore_Wl2_Surface *surface);
+ void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
+ void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h);
+ int (*assign)(Ecore_Wl2_Surface *surface);
+ void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
} funcs;
};
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;
Eina_List *l, *tmp;
}
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;
void *ptr;
}
static Ecore_Wl2_Buffer *
-_evas_dmabuf_surface_wait(Surface *s)
+_evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
{
Ecore_Wl2_Buffer *b, *best = NULL;
Eina_List *l;
}
static int
-_evas_dmabuf_surface_assign(Surface *s)
+_evas_dmabuf_surface_assign(Ecore_Wl2_Surface *s)
{
Ecore_Wl2_Buffer *b;
Eina_List *l;
}
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;
}
static void
-_evas_dmabuf_surface_destroy(Surface *s)
+_evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s)
{
Ecore_Wl2_Buffer *b;
free(s);
}
-void surface_destroy(Surface *surface)
+void
+ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
{
EINA_SAFETY_ON_NULL_RETURN(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);
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);
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);
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);
surface->funcs.post(surface, rects, count);
}
-Surface *
-_evas_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
+Ecore_Wl2_Surface *
+ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
{
- Surface *out;
+ Ecore_Wl2_Surface *out;
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Buffer_Type types = 0;
# define MAX_BUFFERS 4
-typedef struct _Surface Surface;
+typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
struct _Outbuf
{
Ecore_Wl2_Display *ewd;
Evas_Engine_Info_Wayland *info;
- Surface *surface;
+ Ecore_Wl2_Surface *surface;
struct
{
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);
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_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
void _evas_outbuf_redraws_clear(Outbuf *ob);
-void surface_destroy(Surface *surface);
-void surface_reconfigure(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
-void *surface_data_get(Surface *surface, int *w, int *h);
-int surface_assign(Surface *surface);
-void surface_post(Surface *surface, Eina_Rectangle *rects, unsigned int count);
+Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
+void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
+void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
+void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h);
+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
ob->priv.destination_alpha = info->info.destination_alpha;
ob->ewd = ecore_wl2_window_display_get(info->info.wl2_win);
- ob->surface = _evas_surface_create(info->info.wl2_win,
- ob->priv.destination_alpha);
+ ob->surface = ecore_wl2_surface_create(info->info.wl2_win,
+ ob->priv.destination_alpha);
if (!ob->surface) goto surf_err;
eina_array_step_set(&ob->priv.onebuf_regions, sizeof(Eina_Array), 8);
_evas_outbuf_flush(ob, NULL, NULL, EVAS_RENDER_MODE_UNDEF);
_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);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- age = surface_assign(ob->surface);
+ age = ecore_wl2_surface_assign(ob->surface);
if (!age) return MODE_FULL;
else if (age == 1) return MODE_COPY;
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))
{
- surface_reconfigure(ob->surface, h, w, resize, dirty);
+ ecore_wl2_surface_reconfigure(ob->surface, h, w, resize, dirty);
}
_evas_outbuf_idle_flush(ob);
int bw = 0, bh = 0;
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"); */
return NULL;
bpp = depth / 8;
/* 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"); */
return;
if (!ob->priv.rect_count) return;
wls = ecore_wl2_window_surface_get(ob->info->info.wl2_win);
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);
ob->priv.rect_count = 0;
}