summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_shm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-09-11 16:42:30 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-10-12 12:24:03 -0500
commit5fa7263440b559db98dbf5f92653eab0dc40ba09 (patch)
tree62c5ef0e3879a90c427568b9aa46b4a5b7d043ba /src/modules/evas/engines/wayland_shm/evas_shm.c
parent7faa20f3c84c8ed7911d2e2b47fba24ddbc22410 (diff)
wayland_shm: Pass Surface instead of Shm_Surface
Surface has some variables we'll need later.
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 8a622f693d..515b4e68df 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -72,7 +72,7 @@ struct _Shm_Surface
72 Eina_Bool alpha : 1; 72 Eina_Bool alpha : 1;
73}; 73};
74 74
75static Eina_Bool _shm_leaf_create(Shm_Surface *surface, Shm_Leaf *leaf, int w, int h); 75static Eina_Bool _shm_leaf_create(Surface *s, Shm_Leaf *leaf, int w, int h);
76static void _shm_leaf_release(Shm_Leaf *leaf); 76static void _shm_leaf_release(Shm_Leaf *leaf);
77static void _shm_leaf_destroy(Shm_Leaf *leaf); 77static void _shm_leaf_destroy(Shm_Leaf *leaf);
78 78
@@ -255,13 +255,15 @@ err:
255} 255}
256 256
257static void 257static void
258_shm_data_create(Shm_Pool *alt_pool, Shm_Data **ret, Shm_Surface *surface, int w, int h) 258_shm_data_create(Shm_Pool *alt_pool, Shm_Data **ret, Surface *s, int w, int h)
259{ 259{
260 Shm_Surface *surface;
260 Shm_Pool *pool; 261 Shm_Pool *pool;
261 Shm_Data *data; 262 Shm_Data *data;
262 263
263 LOGFN(__FILE__, __LINE__, __FUNCTION__); 264 LOGFN(__FILE__, __LINE__, __FUNCTION__);
264 265
266 surface = s->surf.shm;
265 if (ret) *ret = NULL; 267 if (ret) *ret = NULL;
266 268
267 if (alt_pool) 269 if (alt_pool)
@@ -303,13 +305,15 @@ _shm_data_destroy(Shm_Data *data)
303static void 305static void
304_shm_buffer_release(void *data, struct wl_buffer *buffer) 306_shm_buffer_release(void *data, struct wl_buffer *buffer)
305{ 307{
308 Surface *s;
306 Shm_Surface *surf; 309 Shm_Surface *surf;
307 Shm_Leaf *leaf; 310 Shm_Leaf *leaf;
308 int i = 0; 311 int i = 0;
309 312
310 LOGFN(__FILE__, __LINE__, __FUNCTION__); 313 LOGFN(__FILE__, __LINE__, __FUNCTION__);
311 314
312 surf = data; 315 s = data;
316 surf = s->surf.shm;
313 for (; i < surf->num_buff; i++) 317 for (; i < surf->num_buff; i++)
314 { 318 {
315 leaf = &surf->leaf[i]; 319 leaf = &surf->leaf[i];
@@ -321,7 +325,7 @@ _shm_buffer_release(void *data, struct wl_buffer *buffer)
321 if (leaf->reconfigure) 325 if (leaf->reconfigure)
322 { 326 {
323 _shm_leaf_release(leaf); 327 _shm_leaf_release(leaf);
324 _shm_leaf_create(surf, leaf, surf->w, surf->h); 328 _shm_leaf_create(s, leaf, surf->w, surf->h);
325 } 329 }
326 330
327 break; 331 break;
@@ -335,11 +339,11 @@ static const struct wl_buffer_listener _shm_buffer_listener =
335}; 339};
336 340
337static Eina_Bool 341static Eina_Bool
338_shm_leaf_create(Shm_Surface *surface, Shm_Leaf *leaf, int w, int h) 342_shm_leaf_create(Surface *s, Shm_Leaf *leaf, int w, int h)
339{ 343{
340 LOGFN(__FILE__, __LINE__, __FUNCTION__); 344 LOGFN(__FILE__, __LINE__, __FUNCTION__);
341 345
342 _shm_data_create(leaf->resize_pool, &leaf->data, surface, w, h); 346 _shm_data_create(leaf->resize_pool, &leaf->data, s, w, h);
343 if (!leaf->data) 347 if (!leaf->data)
344 { 348 {
345 CRI("Failed to create leaf data"); 349 CRI("Failed to create leaf data");
@@ -351,7 +355,7 @@ _shm_leaf_create(Shm_Surface *surface, Shm_Leaf *leaf, int w, int h)
351 leaf->valid = EINA_TRUE; 355 leaf->valid = EINA_TRUE;
352 leaf->drawn = EINA_FALSE; 356 leaf->drawn = EINA_FALSE;
353 leaf->age = 0; 357 leaf->age = 0;
354 wl_buffer_add_listener(leaf->data->buffer, &_shm_buffer_listener, surface); 358 wl_buffer_add_listener(leaf->data->buffer, &_shm_buffer_listener, s);
355 359
356 return EINA_TRUE; 360 return EINA_TRUE;
357} 361}
@@ -441,7 +445,7 @@ _evas_shm_surface_reconfigure(Surface *s, int w, int h, uint32_t flags, Eina_Boo
441 _shm_pool_create(surface->shm, 6 * 1024 * 1024); 445 _shm_pool_create(surface->shm, 6 * 1024 * 1024);
442 } 446 }
443 447
444 if (!_shm_leaf_create(surface, &surface->leaf[i], w, h)) 448 if (!_shm_leaf_create(s, &surface->leaf[i], w, h))
445 { 449 {
446 CRI("Failed to create leaf data"); 450 CRI("Failed to create leaf data");
447 abort(); 451 abort();
@@ -603,7 +607,7 @@ _evas_shm_surface_create(Surface *s, int w, int h, int num_buff)
603 /* create surface buffers */ 607 /* create surface buffers */
604 for (; i < surf->num_buff; i++) 608 for (; i < surf->num_buff; i++)
605 { 609 {
606 if (!_shm_leaf_create(surf, &(surf->leaf[i]), w, h)) 610 if (!_shm_leaf_create(s, &(surf->leaf[i]), w, h))
607 { 611 {
608 ERR("Could not create surface leaf"); 612 ERR("Could not create surface leaf");
609 goto err; 613 goto err;