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-13 13:58:15 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-19 15:11:10 -0400
commit11cf0206e45092e491f7873622fd852ed54eba7b (patch)
treeab445692fc0d4acd413b2982a6140f43a442ea83 /src/modules/evas/engines/wayland_shm/evas_shm.c
parent2c33bae2d51995a84a1a71b0fc9cdc8a5130de11 (diff)
wayland_shm: Minor clean up of _evas_shm_surface_post
Some gratuitous cosmetic fixes
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 6e8c711f97..8b5e15f669 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -541,49 +541,42 @@ _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);
544 /* struct wl_callback *frame_cb; */ 545 /* struct wl_callback *frame_cb; */
545 Shm_Surface *surface; 546 Shm_Surface *surf;
546 Shm_Leaf *leaf; 547 Shm_Leaf *leaf;
548 unsigned int k;
547 549
548 LOGFN(__FILE__, __LINE__, __FUNCTION__); 550 LOGFN(__FILE__, __LINE__, __FUNCTION__);
549 551
550 surface = s->surf.shm; 552 surf = s->surf.shm;
551 leaf = surface->current; 553 leaf = surf->current;
552 if (!leaf) return; 554 if (!leaf) return;
553 555
554 if (!surface->surface) return; 556 if (!surf->surface) return;
555 557
556 wl_surface_attach(surface->surface, leaf->data->buffer, 0, 0); 558 wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0);
559
560 if (surf->compositor_version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
561 damage = wl_surface_damage_buffer;
562 else
563 damage = wl_surface_damage;
557 564
558 if ((rects) && (count > 0)) 565 if ((rects) && (count > 0))
559 { 566 for (k = 0; k < count; k++)
560 unsigned int k = 0; 567 damage(surf->surface, rects[k].x, rects[k].y, rects[k].w, rects[k].h);
561
562 for (; k < count; k++)
563 if (surface->compositor_version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
564 wl_surface_damage_buffer(surface->surface,
565 rects[k].x, rects[k].y,
566 rects[k].w, rects[k].h);
567 else
568 wl_surface_damage(surface->surface,
569 rects[k].x, rects[k].y,
570 rects[k].w, rects[k].h);
571 }
572 else 568 else
573 if (surface->compositor_version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) 569 damage(surf->surface, 0, 0, leaf->w, leaf->h);
574 wl_surface_damage_buffer(surface->surface, 0, 0, leaf->w, leaf->h);
575 else
576 wl_surface_damage(surface->surface, 0, 0, leaf->w, leaf->h);
577 570
578 /* frame_cb = wl_surface_frame(surface->surface); */ 571 /* frame_cb = wl_surface_frame(surface->surface); */
579 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */ 572 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */
580 573
581 wl_surface_commit(surface->surface); 574 wl_surface_commit(surf->surface);
582 575
583 leaf->busy = EINA_TRUE; 576 leaf->busy = EINA_TRUE;
584 leaf->drawn = EINA_TRUE; 577 leaf->drawn = EINA_TRUE;
585 leaf->age = 0; 578 leaf->age = 0;
586 surface->current = NULL; 579 surf->current = NULL;
587} 580}
588 581
589Surface * 582Surface *