subsurface: Add a hook point for SUBSURFACE_COMMIT_TO_CACHE. 89/242189/4
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 13 Aug 2020 20:24:59 +0000 (05:24 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 1 Sep 2020 01:17:14 +0000 (01:17 +0000)
This patch introduces a hook point for SUBSURFACE_COMMIT_TO_CACHE.
A function given to e_comp_wl_hook_add() with this hook point will be
called when changes of subsurface is committed to cache.
It will give a chance for others to cache its changes by itself.

An implementation of tizen_viewport as an extension of wayland protocol
for tizen will use this hook point for caching its changes in a
future patch.

NOTE:
Modules which listen to this hook event should apply its cached state to
current state first when wl_surface.commit occurs. Yet when there is no
cached state at that moment, it should apply pending state.

COMMIT TO CACHE
pending -> cache

wl_surface.commit
cache ? cache -> current : pending -> current

Change-Id: I35f908881d8ff06a40d90b4d78b381d31b259ef1

src/bin/e_comp_wl.h
src/bin/e_comp_wl_subsurface.c

index 553c7c15f4e12d71b0126402a95f97ed057dff50..1180a35ba186b3d407ab891e80600bafc2599925 100644 (file)
@@ -61,6 +61,7 @@ typedef enum _E_Comp_Wl_Hook_Point
 {
    E_COMP_WL_HOOK_SHELL_SURFACE_READY,
    E_COMP_WL_HOOK_SUBSURFACE_CREATE,
+   E_COMP_WL_HOOK_SUBSURFACE_COMMIT_TO_CACHE,
    E_COMP_WL_HOOK_BUFFER_CHANGE,
    E_COMP_WL_HOOK_CLIENT_REUSE,
    E_COMP_WL_HOOK_BUFFER_SIZE_CHANGE,
index 985b0ebbd45f5b9763467dbc56568ad864a0d3ac..5c8d6bf0e215aa27c258d446deb2e7e0680d9cdb 100644 (file)
@@ -431,6 +431,8 @@ _e_comp_wl_subsurface_commit_to_cache(E_Client *ec)
    e_presentation_time_container_feedback_merge(&sdata->cached.presentation_container,
                                                 &cdata->pending.presentation_container);
 
+   e_comp_wl_hook_call(E_COMP_WL_HOOK_SUBSURFACE_COMMIT_TO_CACHE, ec);
+
    sdata->cached.has_data = EINA_TRUE;
 }