summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-08-17 15:10:59 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-08-18 14:27:32 -0500
commit51768ff62bad8ff6de6f941943d953a516e86f8e (patch)
tree0b269563fa1937ee518567b988375e71052f8359 /src/lib/ecore_wl2
parent90a032587a73545265a5790e3e72f0712e741978 (diff)
ecore_wl2: Add ecore_wl2_window_buffer_attach API
Let ecore_wl2 track some buffer related state so we can more easily sync things between ecore_evas and the evas_engines.
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h18
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c12
3 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 21b623e24a..e09c42e9ce 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1925,6 +1925,24 @@ EAPI Ecore_Wl2_Frame_Cb_Handle *ecore_wl2_window_frame_callback_add(Ecore_Wl2_Wi
1925 */ 1925 */
1926EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle); 1926EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle);
1927 1927
1928/**
1929 * Attach a buffer to a window
1930 *
1931 * Note that the GL stack my attach buffers to a surface - we should call this
1932 * function at that time (with a NULL buffer) to track whether a surface
1933 * has a valid buffer. That is, call with implicit true and buffer NULL at
1934 * the time of glSwapBuffers.
1935 *
1936 * @window the target window
1937 * @buffer the buffer to attach
1938 * @x x offset from corner
1939 * @y y offset from corner
1940 * @implicit true if an external library is doing the actual attaching
1941 *
1942 * @since 1.20
1943 */
1944EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, struct wl_buffer *buffer, int x, int y, Eina_Bool implicit);
1945
1928# endif 1946# endif
1929 1947
1930# undef EAPI 1948# undef EAPI
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index 240e9062ad..85661ecba3 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -162,6 +162,7 @@ struct _Ecore_Wl2_Window
162 const char *role; 162 const char *role;
163 163
164 struct wl_surface *surface; 164 struct wl_surface *surface;
165 struct wl_buffer *buffer;
165 struct wl_callback *callback; 166 struct wl_callback *callback;
166 struct www_surface *www_surface; 167 struct www_surface *www_surface;
167 struct zxdg_surface_v6 *zxdg_surface; 168 struct zxdg_surface_v6 *zxdg_surface;
@@ -225,6 +226,7 @@ struct _Ecore_Wl2_Window
225 int *available_rots; 226 int *available_rots;
226 unsigned int count; 227 unsigned int count;
227 } wm_rot; 228 } wm_rot;
229 Eina_Bool has_buffer : 1;
228}; 230};
229 231
230struct _Ecore_Wl2_Output 232struct _Ecore_Wl2_Output
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index c6d0ed4709..b0be628334 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1417,3 +1417,15 @@ EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle)
1417 handle->win->frame_callbacks = eina_list_remove(handle->win->frame_callbacks, handle); 1417 handle->win->frame_callbacks = eina_list_remove(handle->win->frame_callbacks, handle);
1418 free(handle); 1418 free(handle);
1419} 1419}
1420
1421EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, struct wl_buffer *buffer, int x, int y, Eina_Bool implicit)
1422{
1423 EINA_SAFETY_ON_NULL_RETURN(win);
1424 EINA_SAFETY_ON_NULL_RETURN(win->surface);
1425
1426 /* FIXME: Haven't given any thought to x and y since we always use 0... */
1427 if (!implicit) wl_surface_attach(win->surface, buffer, x, y);
1428 win->buffer = buffer;
1429 if (!implicit && !buffer) win->has_buffer = EINA_FALSE;
1430 else win->has_buffer = EINA_TRUE;
1431}