From 016cf2b2b09d2bba4f43a44a51004088573729d7 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Fri, 14 Aug 2020 05:24:59 +0900 Subject: [PATCH] subsurface: Add a hook point for SUBSURFACE_COMMIT_TO_CACHE. 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 | 1 + src/bin/e_comp_wl_subsurface.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 553c7c15f4..1180a35ba1 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -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, diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index 985b0ebbd4..5c8d6bf0e2 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -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; } -- 2.34.1