summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-10-04 13:46:34 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-10-12 12:24:03 -0500
commit0a185d3efd51e3af2ba45b2ed1c8ec67d1eedd60 (patch)
tree4bf2016ab1bded9139e356c52f50d4c4ee02e4c5 /src/lib/ecore_wl2
parent0badc0522b1d08fddf9676883d37da06a264db28 (diff)
ecore_wl2: Add new API to latch window state for updates
Add an API to call at the beginning of render to latch state at that moment, and use it for the wayland engine.
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h15
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h1
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c9
3 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 288ffda65b..70edf4d719 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1957,6 +1957,21 @@ EAPI void ecore_wl2_display_flush(Ecore_Wl2_Display *display);
1957 1957
1958EAPI Eina_Bool ecore_wl2_window_resizing_get(Ecore_Wl2_Window *window); 1958EAPI Eina_Bool ecore_wl2_window_resizing_get(Ecore_Wl2_Window *window);
1959 1959
1960/**
1961 * Latch window state at the start of an update
1962 *
1963 * When async render takes place we continue to dispatch wayland
1964 * events from the main loop. We need to defer any changes to
1965 * window state from those events until the update is complete.
1966 *
1967 * Events deferred during an update will automatically fire
1968 * immediately after the caller calls ecore_wl2_window_commit.
1969 *
1970 * @param window
1971 * @since 1.21
1972 */
1973EAPI void ecore_wl2_window_update_begin(Ecore_Wl2_Window *window);
1974
1960# endif 1975# endif
1961 1976
1962# undef EAPI 1977# undef EAPI
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index 743c05bf2f..ff78a82579 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -233,6 +233,7 @@ struct _Ecore_Wl2_Window
233 unsigned int count; 233 unsigned int count;
234 } wm_rot; 234 } wm_rot;
235 Eina_Bool has_buffer : 1; 235 Eina_Bool has_buffer : 1;
236 Eina_Bool updating : 1;
236}; 237};
237 238
238struct _Ecore_Wl2_Output 239struct _Ecore_Wl2_Output
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index ed9732df72..9b223190ce 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1408,6 +1408,7 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
1408 wl_surface_commit(window->surface); 1408 wl_surface_commit(window->surface);
1409 ecore_wl2_display_flush(window->display); 1409 ecore_wl2_display_flush(window->display);
1410 } 1410 }
1411 window->updating = EINA_FALSE;
1411} 1412}
1412 1413
1413EAPI Eina_Bool 1414EAPI Eina_Bool
@@ -1468,3 +1469,11 @@ ecore_wl2_window_resizing_get(Ecore_Wl2_Window *window)
1468 1469
1469 return window->req_config.resizing; 1470 return window->req_config.resizing;
1470} 1471}
1472
1473EAPI void ecore_wl2_window_update_begin(Ecore_Wl2_Window *window)
1474{
1475 EINA_SAFETY_ON_NULL_RETURN(window);
1476 EINA_SAFETY_ON_TRUE_RETURN(window->updating);
1477
1478 window->updating = EINA_TRUE;
1479}