summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_shm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-12-28 09:09:04 -0500
committerChris Michael <cpmichael@osg.samsung.com>2015-12-28 09:09:04 -0500
commitddae80af1ddfabfc7f6bb3a5bd2dbe0a3b3a8dc8 (patch)
tree2a6a2a9961fe0116f4fb48a664fd4f5f963c7a10 /src/modules/evas/engines/wayland_shm/evas_shm.c
parent71f578dc0b84b92db3a7aaf381717c496727ed14 (diff)
wayland: use wl_surface.damage_buffer if available
Summary: wl_surface.damage_buffer() takes surface damage in buffer co-ordinates. Right now since we don't use wayland's scaling, transforms, or viewports it's exactly the same as wl_surface.damage(). In the future if we start using those features it's much easier to do so with damage_buffer(). Reviewers: zmike, devilhorns Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3457
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 593a8ae475..04e7f7bedc 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -309,7 +309,7 @@ _shm_leaf_release(Shm_Leaf *leaf)
309} 309}
310 310
311Shm_Surface * 311Shm_Surface *
312_evas_shm_surface_create(struct wl_display *disp, struct wl_shm *shm, struct wl_surface *surface, int w, int h, int num_buff, Eina_Bool alpha) 312_evas_shm_surface_create(struct wl_display *disp, struct wl_shm *shm, struct wl_surface *surface, int w, int h, int num_buff, Eina_Bool alpha, int compositor_version)
313{ 313{
314 Shm_Surface *surf; 314 Shm_Surface *surf;
315 int i = 0; 315 int i = 0;
@@ -328,6 +328,7 @@ _evas_shm_surface_create(struct wl_display *disp, struct wl_shm *shm, struct wl_
328 surf->num_buff = num_buff; 328 surf->num_buff = num_buff;
329 surf->alpha = alpha; 329 surf->alpha = alpha;
330 surf->flags = 0; 330 surf->flags = 0;
331 surf->compositor_version = compositor_version;
331 332
332 /* create surface buffers */ 333 /* create surface buffers */
333 for (; i < surf->num_buff; i++) 334 for (; i < surf->num_buff; i++)
@@ -505,12 +506,24 @@ _evas_shm_surface_post(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int
505 unsigned int k = 0; 506 unsigned int k = 0;
506 507
507 for (; k < count; k++) 508 for (; k < count; k++)
508 wl_surface_damage(surface->surface, 509#ifdef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION
509 rects[k].x, rects[k].y, 510 if (surface->compositor_version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
510 rects[k].w, rects[k].h); 511 wl_surface_damage_buffer(surface->surface,
512 rects[k].x, rects[k].y,
513 rects[k].w, rects[k].h);
514 else
515#endif
516 wl_surface_damage(surface->surface,
517 rects[k].x, rects[k].y,
518 rects[k].w, rects[k].h);
511 } 519 }
512 else 520 else
513 wl_surface_damage(surface->surface, 0, 0, leaf->w, leaf->h); 521#ifdef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION
522 if (surface->compositor_version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
523 wl_surface_damage_buffer(surface->surface, 0, 0, leaf->w, leaf->h);
524 else
525#endif
526 wl_surface_damage(surface->surface, 0, 0, leaf->w, leaf->h);
514 527
515 /* frame_cb = wl_surface_frame(surface->surface); */ 528 /* frame_cb = wl_surface_frame(surface->surface); */
516 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */ 529 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */