summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_shm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-04-15 10:29:14 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-19 15:11:10 -0400
commit0ada4d3d56e5b5ed447ba7fc89d40cbddfb95ad0 (patch)
tree91db32d83e36872c955d6172edd369d98c6ea5c7 /src/modules/evas/engines/wayland_shm/evas_shm.c
parent11cf0206e45092e491f7873622fd852ed54eba7b (diff)
wayland_shm: Pull the damage stuff out of evas_shm
This doesn't really care what the buffers were allocated with, so let's make this chunk of code useful to both the shm method and the upcoming dmabuf one
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 8b5e15f669..d2c02f5b3b 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -541,11 +541,9 @@ _evas_shm_surface_data_get(Surface *s, int *w, int *h)
541void 541void
542_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count) 542_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
543{ 543{
544 void (*damage)(struct wl_surface *, int32_t, int32_t, int32_t, int32_t);
545 /* struct wl_callback *frame_cb; */ 544 /* struct wl_callback *frame_cb; */
546 Shm_Surface *surf; 545 Shm_Surface *surf;
547 Shm_Leaf *leaf; 546 Shm_Leaf *leaf;
548 unsigned int k;
549 547
550 LOGFN(__FILE__, __LINE__, __FUNCTION__); 548 LOGFN(__FILE__, __LINE__, __FUNCTION__);
551 549
@@ -557,17 +555,8 @@ _evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
557 555
558 wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0); 556 wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0);
559 557
560 if (surf->compositor_version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) 558 _evas_surface_damage(surf->surface, surf->compositor_version,
561 damage = wl_surface_damage_buffer; 559 leaf->w, leaf->h, rects, count);
562 else
563 damage = wl_surface_damage;
564
565 if ((rects) && (count > 0))
566 for (k = 0; k < count; k++)
567 damage(surf->surface, rects[k].x, rects[k].y, rects[k].w, rects[k].h);
568 else
569 damage(surf->surface, 0, 0, leaf->w, leaf->h);
570
571 /* frame_cb = wl_surface_frame(surface->surface); */ 560 /* frame_cb = wl_surface_frame(surface->surface); */
572 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */ 561 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */
573 562