diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2018-01-26 10:13:25 -0600 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2018-01-26 15:53:59 -0600 |
commit | e11bb10a4e14ec661f69a4acb2988f4b9de1d323 (patch) | |
tree | 7a2977d36f60ea0bc7e48b1583b85c70fdac8397 /src/lib/ecore_wl2/ecore_wl2_surface.c | |
parent | 1a5e307f7304ab998837fc2969a34811ccbec7c1 (diff) |
ecore_wl2: Move smarts from surface_map to buffer_map
This simplifies the surface code so that it no longer needs access to
buffer structure members.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_surface.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c index bb0d87c4ae..94804dd0f3 100644 --- a/src/lib/ecore_wl2/ecore_wl2_surface.c +++ b/src/lib/ecore_wl2/ecore_wl2_surface.c | |||
@@ -53,24 +53,20 @@ _evas_dmabuf_surface_data_get(Ecore_Wl2_Surface *s, int *w, int *h) | |||
53 | { | 53 | { |
54 | Ecore_Wl2_Buffer *b; | 54 | Ecore_Wl2_Buffer *b; |
55 | void *ptr; | 55 | void *ptr; |
56 | int stride; | ||
56 | 57 | ||
57 | b = s->current; | 58 | b = s->current; |
58 | if (!b) return NULL; | 59 | if (!b) return NULL; |
59 | 60 | ||
61 | ptr = ecore_wl2_buffer_map(b, NULL, h, &stride); | ||
62 | if (!ptr) return NULL; | ||
63 | |||
60 | /* We return stride/bpp because it may not match the allocated | 64 | /* We return stride/bpp because it may not match the allocated |
61 | * width. evas will figure out the clipping | 65 | * width. evas will figure out the clipping |
62 | */ | 66 | */ |
63 | if (w) *w = b->stride / 4; | 67 | if (w) *w = stride / 4; |
64 | if (h) *h = b->h; | ||
65 | if (b->locked) return b->mapping; | ||
66 | |||
67 | ptr = ecore_wl2_buffer_map(b); | ||
68 | if (!ptr) | ||
69 | return NULL; | ||
70 | 68 | ||
71 | b->mapping = ptr; | 69 | return ptr; |
72 | b->locked = EINA_TRUE; | ||
73 | return b->mapping; | ||
74 | } | 70 | } |
75 | 71 | ||
76 | static Ecore_Wl2_Buffer * | 72 | static Ecore_Wl2_Buffer * |