diff options
-rw-r--r-- | src/Makefile_Ecore_Wl2.am | 1 | ||||
-rw-r--r-- | src/Makefile_Evas.am | 1 | ||||
-rw-r--r-- | src/lib/ecore_wl2/Ecore_Wl2.h | 8 | ||||
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_private.h | 18 | ||||
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_surface.c (renamed from src/modules/evas/engines/wayland_shm/evas_dmabuf.c) | 39 | ||||
-rw-r--r-- | src/modules/evas/engines/wayland_shm/evas_engine.h | 4 |
6 files changed, 39 insertions, 32 deletions
diff --git a/src/Makefile_Ecore_Wl2.am b/src/Makefile_Ecore_Wl2.am index 1c5971c..a794d0b 100644 --- a/src/Makefile_Ecore_Wl2.am +++ b/src/Makefile_Ecore_Wl2.am | |||
@@ -17,6 +17,7 @@ lib/ecore_wl2/ecore_wl2_display.c \ | |||
17 | lib/ecore_wl2/ecore_wl2.c \ | 17 | lib/ecore_wl2/ecore_wl2.c \ |
18 | lib/ecore_wl2/ecore_wl2_private.h \ | 18 | lib/ecore_wl2/ecore_wl2_private.h \ |
19 | lib/ecore_wl2/ecore_wl2_buffer.c \ | 19 | lib/ecore_wl2/ecore_wl2_buffer.c \ |
20 | lib/ecore_wl2/ecore_wl2_surface.c \ | ||
20 | static_libs/libdrm/drm_fourcc.h \ | 21 | static_libs/libdrm/drm_fourcc.h \ |
21 | static_libs/libdrm/drm.h \ | 22 | static_libs/libdrm/drm.h \ |
22 | static_libs/libdrm/drm_mode.h \ | 23 | static_libs/libdrm/drm_mode.h \ |
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 48e6440..43ad9f7 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am | |||
@@ -1320,7 +1320,6 @@ WAYLAND_SHM_SOURCES = \ | |||
1320 | modules/evas/engines/wayland_common/Evas_Engine_Wayland.h \ | 1320 | modules/evas/engines/wayland_common/Evas_Engine_Wayland.h \ |
1321 | modules/evas/engines/wayland_shm/evas_engine.c \ | 1321 | modules/evas/engines/wayland_shm/evas_engine.c \ |
1322 | modules/evas/engines/wayland_shm/evas_engine.h \ | 1322 | modules/evas/engines/wayland_shm/evas_engine.h \ |
1323 | modules/evas/engines/wayland_shm/evas_dmabuf.c \ | ||
1324 | modules/evas/engines/wayland_shm/evas_outbuf.c | 1323 | modules/evas/engines/wayland_shm/evas_outbuf.c |
1325 | 1324 | ||
1326 | NODIST_WAYLAND_SHM_SOURCES = \ | 1325 | NODIST_WAYLAND_SHM_SOURCES = \ |
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 88fbeda..b063983 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h | |||
@@ -44,6 +44,7 @@ typedef struct _Ecore_Wl2_Pointer Ecore_Wl2_Pointer; | |||
44 | typedef struct _Ecore_Wl2_Keyboard Ecore_Wl2_Keyboard; | 44 | typedef struct _Ecore_Wl2_Keyboard Ecore_Wl2_Keyboard; |
45 | typedef struct _Ecore_Wl2_Touch Ecore_Wl2_Touch; | 45 | typedef struct _Ecore_Wl2_Touch Ecore_Wl2_Touch; |
46 | typedef struct _Ecore_Wl2_Offer Ecore_Wl2_Offer; | 46 | typedef struct _Ecore_Wl2_Offer Ecore_Wl2_Offer; |
47 | typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface; | ||
47 | 48 | ||
48 | /* matches protocol values */ | 49 | /* matches protocol values */ |
49 | typedef enum | 50 | typedef enum |
@@ -2015,6 +2016,13 @@ EAPI void ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf); | |||
2015 | EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b); | 2016 | EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b); |
2016 | EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b); | 2017 | EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b); |
2017 | 2018 | ||
2019 | EAPI Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha); | ||
2020 | EAPI void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface); | ||
2021 | EAPI void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force); | ||
2022 | EAPI void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h); | ||
2023 | EAPI int ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface); | ||
2024 | EAPI void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count); | ||
2025 | |||
2018 | # endif | 2026 | # endif |
2019 | 2027 | ||
2020 | # undef EAPI | 2028 | # undef EAPI |
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h index b1df67f..8b87cff 100644 --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h | |||
@@ -523,6 +523,24 @@ typedef struct Ecore_Wl2_Event_Window_WWW_Drag | |||
523 | Eina_Bool dragging; | 523 | Eina_Bool dragging; |
524 | } Ecore_Wl2_Event_Window_WWW_Drag; | 524 | } Ecore_Wl2_Event_Window_WWW_Drag; |
525 | 525 | ||
526 | typedef struct _Ecore_Wl2_Surface | ||
527 | { | ||
528 | Ecore_Wl2_Window *wl2_win; | ||
529 | Ecore_Wl2_Buffer *current; | ||
530 | Eina_List *buffers; | ||
531 | |||
532 | int w, h; | ||
533 | Eina_Bool alpha : 1; | ||
534 | struct | ||
535 | { | ||
536 | void (*destroy)(Ecore_Wl2_Surface *surface); | ||
537 | void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force); | ||
538 | void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h); | ||
539 | int (*assign)(Ecore_Wl2_Surface *surface); | ||
540 | void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count); | ||
541 | } funcs; | ||
542 | } Ecore_Wl2_Surface; | ||
543 | |||
526 | Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface); | 544 | Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface); |
527 | void _display_event_free(void *d, void *event EINA_UNUSED); | 545 | void _display_event_free(void *d, void *event EINA_UNUSED); |
528 | 546 | ||
diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/lib/ecore_wl2/ecore_wl2_surface.c index bd4eb5e..9a1c8ea 100644 --- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c +++ b/src/lib/ecore_wl2/ecore_wl2_surface.c | |||
@@ -1,30 +1,15 @@ | |||
1 | #include "evas_common_private.h" | 1 | #ifdef HAVE_CONFIG_H |
2 | #include "evas_private.h" | 2 | # include <config.h> |
3 | #include "evas_engine.h" | 3 | #endif |
4 | |||
5 | #include "ecore_wl2_private.h" | ||
4 | 6 | ||
5 | #include <sys/types.h> | 7 | #include <sys/types.h> |
6 | #include <sys/stat.h> | 8 | #include <sys/stat.h> |
7 | 9 | ||
8 | #include "linux-dmabuf-unstable-v1-client-protocol.h" | 10 | #include "linux-dmabuf-unstable-v1-client-protocol.h" |
9 | 11 | ||
10 | typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface; | 12 | #define MAX_BUFFERS 4 |
11 | struct _Ecore_Wl2_Surface | ||
12 | { | ||
13 | Ecore_Wl2_Window *wl2_win; | ||
14 | Ecore_Wl2_Buffer *current; | ||
15 | Eina_List *buffers; | ||
16 | |||
17 | int w, h; | ||
18 | Eina_Bool alpha : 1; | ||
19 | struct | ||
20 | { | ||
21 | void (*destroy)(Ecore_Wl2_Surface *surface); | ||
22 | void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force); | ||
23 | void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h); | ||
24 | int (*assign)(Ecore_Wl2_Surface *surface); | ||
25 | void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count); | ||
26 | } funcs; | ||
27 | }; | ||
28 | 13 | ||
29 | static void | 14 | static void |
30 | _evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force) | 15 | _evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force) |
@@ -165,7 +150,7 @@ _evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s) | |||
165 | free(s); | 150 | free(s); |
166 | } | 151 | } |
167 | 152 | ||
168 | void | 153 | EAPI void |
169 | ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface) | 154 | ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface) |
170 | { | 155 | { |
171 | EINA_SAFETY_ON_NULL_RETURN(surface); | 156 | EINA_SAFETY_ON_NULL_RETURN(surface); |
@@ -173,7 +158,7 @@ ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface) | |||
173 | surface->funcs.destroy(surface); | 158 | surface->funcs.destroy(surface); |
174 | } | 159 | } |
175 | 160 | ||
176 | void | 161 | EAPI void |
177 | ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force) | 162 | ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force) |
178 | { | 163 | { |
179 | EINA_SAFETY_ON_NULL_RETURN(surface); | 164 | EINA_SAFETY_ON_NULL_RETURN(surface); |
@@ -181,7 +166,7 @@ ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t | |||
181 | surface->funcs.reconfigure(surface, w, h, flags, force); | 166 | surface->funcs.reconfigure(surface, w, h, flags, force); |
182 | } | 167 | } |
183 | 168 | ||
184 | void * | 169 | EAPI void * |
185 | ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h) | 170 | ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h) |
186 | { | 171 | { |
187 | EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); | 172 | EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); |
@@ -189,7 +174,7 @@ ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h) | |||
189 | return surface->funcs.data_get(surface, w, h); | 174 | return surface->funcs.data_get(surface, w, h); |
190 | } | 175 | } |
191 | 176 | ||
192 | int | 177 | EAPI int |
193 | ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface) | 178 | ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface) |
194 | { | 179 | { |
195 | EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0); | 180 | EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0); |
@@ -197,7 +182,7 @@ ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface) | |||
197 | return surface->funcs.assign(surface); | 182 | return surface->funcs.assign(surface); |
198 | } | 183 | } |
199 | 184 | ||
200 | void | 185 | EAPI void |
201 | ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count) | 186 | ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count) |
202 | { | 187 | { |
203 | EINA_SAFETY_ON_NULL_RETURN(surface); | 188 | EINA_SAFETY_ON_NULL_RETURN(surface); |
@@ -205,7 +190,7 @@ ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsign | |||
205 | surface->funcs.post(surface, rects, count); | 190 | surface->funcs.post(surface, rects, count); |
206 | } | 191 | } |
207 | 192 | ||
208 | Ecore_Wl2_Surface * | 193 | EAPI Ecore_Wl2_Surface * |
209 | ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) | 194 | ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) |
210 | { | 195 | { |
211 | Ecore_Wl2_Surface *out; | 196 | Ecore_Wl2_Surface *out; |
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h index 25ce2f3..7291b40 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.h +++ b/src/modules/evas/engines/wayland_shm/evas_engine.h | |||
@@ -69,10 +69,6 @@ extern int _evas_engine_way_shm_log_dom; | |||
69 | # include "../software_generic/Evas_Engine_Software_Generic.h" | 69 | # include "../software_generic/Evas_Engine_Software_Generic.h" |
70 | # include "Evas_Engine_Wayland.h" | 70 | # include "Evas_Engine_Wayland.h" |
71 | 71 | ||
72 | # define MAX_BUFFERS 4 | ||
73 | |||
74 | typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface; | ||
75 | |||
76 | struct _Outbuf | 72 | struct _Outbuf |
77 | { | 73 | { |
78 | int w, h; | 74 | int w, h; |