new_data = surf->funcs.data_get(surf, NULL, NULL);
for (y = 0; y < h; y++)
memcpy(new_data + y * w * 4, old_data + y * b->stride, w * 4);
- surf->funcs.post(surf, NULL, 0);
+ surf->funcs.post(surf, NULL, 0, EINA_FALSE);
buffer_manager->unmap(b);
out:
}
static void
-_evas_dmabuf_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
+_evas_dmabuf_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden)
{
Dmabuf_Surface *surface;
Dmabuf_Buffer *b;
return;
}
surface->pre = NULL;
- wl_surface_attach(surface->wl_surface, b->wl_buffer, 0, 0);
- _evas_surface_damage(surface->wl_surface, surface->compositor_version,
- b->w, b->h, rects, count);
+
+ if (!hidden)
+ {
+ wl_surface_attach(surface->wl_surface, b->wl_buffer, 0, 0);
+ _evas_surface_damage(surface->wl_surface, surface->compositor_version,
+ b->w, b->h, rects, count);
+ }
+ else
+ wl_surface_attach(surface->wl_surface, NULL, 0, 0);
+
wl_surface_commit(surface->wl_surface);
}
void (*reconfigure)(Surface *surface, int w, int h, uint32_t flags);
void *(*data_get)(Surface *surface, int *w, int *h);
int (*assign)(Surface *surface);
- void (*post)(Surface *surface, Eina_Rectangle *rects, unsigned int count);
+ void (*post)(Surface *surface, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden);
} funcs;
};
/* Eina_Bool redraw : 1; */
Eina_Bool destination_alpha : 1;
} priv;
+
+ Eina_Bool hidden : 1;
};
Eina_Bool _evas_dmabuf_surface_create(Surface *s, int w, int h, int num_buff);
ob->rotation = info->info.rotation;
ob->depth = info->info.depth;
ob->priv.destination_alpha = info->info.destination_alpha;
+ ob->hidden = info->info.hidden;
/* default to triple buffer */
ob->num_buff = 3;
sw = h;
sh = w;
}
- else goto unhandled_rotation;
+ else
+ goto unhandled_rotation;
ob->surface = _evas_surface_create(info, sw, sh, ob->num_buff);
if (!ob->surface) goto surf_err;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (ob->hidden) return;
+
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
if (ob->priv.rect_count) free(ob->priv.rects);
ob->depth = depth;
ob->priv.destination_alpha = alpha;
+ if (ob->hidden) return;
+
if ((ob->rotation == 0) || (ob->rotation == 180))
{
ob->surface->funcs.reconfigure(ob->surface, w, h, resize);
{
if (!ob->priv.rect_count) return;
if (ob->info->info.wl_surface)
- ob->surface->funcs.post(ob->surface, ob->priv.rects, ob->priv.rect_count);
+ ob->surface->funcs.post(ob->surface, ob->priv.rects, ob->priv.rect_count, ob->hidden);
free(ob->priv.rects);
ob->priv.rect_count = 0;
}
}
void
-_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
+_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden)
{
- /* struct wl_callback *frame_cb; */
Shm_Surface *surf;
Shm_Leaf *leaf;
if (!surf->surface) return;
- wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0);
+ if (!hidden)
+ {
+ wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0);
- _evas_surface_damage(surf->surface, surf->compositor_version,
- leaf->w, leaf->h, rects, count);
- /* frame_cb = wl_surface_frame(surface->surface); */
- /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */
+ _evas_surface_damage(surf->surface, surf->compositor_version,
+ leaf->w, leaf->h, rects, count);
+ }
+ else
+ wl_surface_attach(surf->surface, NULL, 0, 0);
wl_surface_commit(surf->surface);