summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Ecore_Wl2.am1
-rw-r--r--src/Makefile_Evas.am1
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h8
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h18
-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.h4
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 \
17lib/ecore_wl2/ecore_wl2.c \ 17lib/ecore_wl2/ecore_wl2.c \
18lib/ecore_wl2/ecore_wl2_private.h \ 18lib/ecore_wl2/ecore_wl2_private.h \
19lib/ecore_wl2/ecore_wl2_buffer.c \ 19lib/ecore_wl2/ecore_wl2_buffer.c \
20lib/ecore_wl2/ecore_wl2_surface.c \
20static_libs/libdrm/drm_fourcc.h \ 21static_libs/libdrm/drm_fourcc.h \
21static_libs/libdrm/drm.h \ 22static_libs/libdrm/drm.h \
22static_libs/libdrm/drm_mode.h \ 23static_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 = \
1320modules/evas/engines/wayland_common/Evas_Engine_Wayland.h \ 1320modules/evas/engines/wayland_common/Evas_Engine_Wayland.h \
1321modules/evas/engines/wayland_shm/evas_engine.c \ 1321modules/evas/engines/wayland_shm/evas_engine.c \
1322modules/evas/engines/wayland_shm/evas_engine.h \ 1322modules/evas/engines/wayland_shm/evas_engine.h \
1323modules/evas/engines/wayland_shm/evas_dmabuf.c \
1324modules/evas/engines/wayland_shm/evas_outbuf.c 1323modules/evas/engines/wayland_shm/evas_outbuf.c
1325 1324
1326NODIST_WAYLAND_SHM_SOURCES = \ 1325NODIST_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;
44typedef struct _Ecore_Wl2_Keyboard Ecore_Wl2_Keyboard; 44typedef struct _Ecore_Wl2_Keyboard Ecore_Wl2_Keyboard;
45typedef struct _Ecore_Wl2_Touch Ecore_Wl2_Touch; 45typedef struct _Ecore_Wl2_Touch Ecore_Wl2_Touch;
46typedef struct _Ecore_Wl2_Offer Ecore_Wl2_Offer; 46typedef struct _Ecore_Wl2_Offer Ecore_Wl2_Offer;
47typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
47 48
48/* matches protocol values */ 49/* matches protocol values */
49typedef enum 50typedef enum
@@ -2015,6 +2016,13 @@ EAPI void ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf);
2015EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b); 2016EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b);
2016EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b); 2017EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b);
2017 2018
2019EAPI Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
2020EAPI void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
2021EAPI void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
2022EAPI void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h);
2023EAPI int ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface);
2024EAPI 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
526typedef 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
526Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface); 544Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface);
527void _display_event_free(void *d, void *event EINA_UNUSED); 545void _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
10typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface; 12#define MAX_BUFFERS 4
11struct _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
29static void 14static 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
168void 153EAPI void
169ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface) 154ecore_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
176void 161EAPI void
177ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force) 162ecore_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
184void * 169EAPI void *
185ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h) 170ecore_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
192int 177EAPI int
193ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface) 178ecore_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
200void 185EAPI void
201ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count) 186ecore_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
208Ecore_Wl2_Surface * 193EAPI Ecore_Wl2_Surface *
209ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) 194ecore_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
74typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
75
76struct _Outbuf 72struct _Outbuf
77{ 73{
78 int w, h; 74 int w, h;