if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
{
einfo->info.wl_shm = ecore_wl_shm_get();
+ einfo->info.wl_display = ecore_wl_display_get();
einfo->info.destination_alpha = EINA_TRUE;
einfo->info.rotation = ee->rotation;
einfo->info.wl_surface = ecore_wl_window_surface_create(wdata->win);
struct
{
/* the wayland shm object used to create new shm pool */
+ struct wl_display *wl_display;
struct wl_shm *wl_shm;
struct wl_surface *wl_surface;
/* LOCAL FUNCTIONS */
Render_Engine *
-_render_engine_swapbuf_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface)
+_render_engine_swapbuf_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *display)
{
Render_Engine *re;
Outbuf *ob;
/* try to allocate space for new render engine */
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
- ob = _evas_outbuf_setup(w, h, rotation, depth, alpha, shm, surface);
+ ob = _evas_outbuf_setup(w, h, rotation, depth, alpha, shm, surface, display);
if (!ob) goto err;
if (!evas_render_engine_software_generic_init(&re->generic, ob,
einfo->info.depth,
einfo->info.destination_alpha,
einfo->info.wl_shm,
- einfo->info.wl_surface);
+ einfo->info.wl_surface,
+ einfo->info.wl_display);
if (re)
re->generic.ob->info = einfo;
einfo->info.rotation, einfo->info.depth,
einfo->info.destination_alpha,
einfo->info.wl_shm,
- einfo->info.wl_surface);
+ einfo->info.wl_surface,
+ einfo->info.wl_display);
if (ob)
{
ob->info = einfo;
{
struct wl_shm *shm;
struct wl_surface *surface;
+ struct wl_display *display;
struct wl_callback *frame_cb;
uint32_t flags;
int w, h;
} priv;
};
-Shm_Surface *_evas_shm_surface_create(struct wl_shm *shm, struct wl_surface *surface, int w, int h, int num_buff, Eina_Bool alpha);
+Shm_Surface *_evas_shm_surface_create(struct wl_shm *shm, struct wl_surface *surface, struct wl_display *display, int w, int h, int num_buff, Eina_Bool alpha);
void _evas_shm_surface_destroy(Shm_Surface *surface);
void _evas_shm_surface_reconfigure(Shm_Surface *surface, int dx, int dy, int w, int h, int num_buff, uint32_t flags);
void _evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int count);
void *_evas_shm_surface_data_get(Shm_Surface *surface, int *w, int *h);
void _evas_shm_surface_redraw(Shm_Surface *surface);
-Outbuf *_evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface);
+Outbuf *_evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *display);
void _evas_outbuf_free(Outbuf *ob);
void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode);
void _evas_outbuf_idle_flush(Outbuf *ob);
#define BLUE_MASK 0x0000ff
Outbuf *
-_evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface)
+_evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *display)
{
Outbuf *ob = NULL;
char *num;
/* try to create the outbuf surface */
if (!(ob->surface =
- _evas_shm_surface_create(shm, surface, w, h, ob->num_buff, alpha)))
+ _evas_shm_surface_create(shm, surface, display, w, h, ob->num_buff, alpha)))
goto surf_err;
eina_array_step_set(&ob->priv.onebuf_regions, sizeof(Eina_Array), 8);
}
Shm_Surface *
-_evas_shm_surface_create(struct wl_shm *shm, struct wl_surface *surface, int w, int h, int num_buff, Eina_Bool alpha)
+_evas_shm_surface_create(struct wl_shm *shm, struct wl_surface *surface, struct wl_display *display, int w, int h, int num_buff, Eina_Bool alpha)
{
Shm_Surface *surf;
int i = 0;
surf->h = h;
surf->shm = shm;
surf->surface = surface;
+ surf->display = display;
surf->num_buff = num_buff;
surf->alpha = alpha;
surf->flags = 0;
if (!leaf)
{
- /* WRN("All buffers held by server"); */
+ if (surface->display)
+ {
+ if (wl_display_roundtrip(surface->display) != -1)
+ {
+ for (i = 0; i < surface->num_buff; i++)
+ {
+ if (surface->leaf[i].busy) continue;
+ if ((!leaf) || (leaf->valid))
+ {
+ leaf = &surface->leaf[i];
+ break;
+ }
+ }
+ }
+
+ }
+ if (!leaf)
+ {
+ /* WRN("All buffers held by server"); */
return NULL;
+ }
}
/* DBG("Leaf Data Get %d", (int)(leaf - &surface->leaf[0])); */