From: Seunghun Lee Date: Wed, 6 Dec 2023 08:35:23 +0000 (+0900) Subject: surface: Add cache event X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48cd4d294cb5b8a9c57a12f9933a17f848945495;p=platform%2Fcore%2Fuifw%2Flibds.git surface: Add cache event --- diff --git a/include/libds/types/ds_surface.h b/include/libds/types/ds_surface.h index 1447a2e..c1bb45a 100644 --- a/include/libds/types/ds_surface.h +++ b/include/libds/types/ds_surface.h @@ -81,6 +81,7 @@ struct ds_surface struct { struct wl_signal commit; + struct wl_signal cache; struct wl_signal new_subsurface; struct wl_signal destroy; } events; diff --git a/src/compositor/subsurface.c b/src/compositor/subsurface.c index 07f35e7..aabdb39 100644 --- a/src/compositor/subsurface.c +++ b/src/compositor/subsurface.c @@ -120,6 +120,7 @@ subsurface_commit(struct ds_subsurface *subsurface) subsurface->has_cache = true; wl_signal_emit_mutable(&subsurface->events.cached, subsurface); + wl_signal_emit_mutable(&surface->events.cache, surface); } else { if (subsurface->has_cache) { diff --git a/src/compositor/surface.c b/src/compositor/surface.c index 8b8a135..3a3f771 100644 --- a/src/compositor/surface.c +++ b/src/compositor/surface.c @@ -31,6 +31,13 @@ ds_surface_add_commit_listener(struct ds_surface *surface, } WL_EXPORT void +ds_surface_add_cache_listener(struct ds_surface *surface, + struct wl_listener *listener) +{ + wl_signal_add(&surface->events.cache, listener); +} + +WL_EXPORT void ds_surface_add_new_subsurface_listener(struct ds_surface *surface, struct wl_listener *listener) { @@ -236,6 +243,7 @@ create_surface(struct wl_client *client, uint32_t version, uint32_t id) surface_state_init(&surface->pending); wl_signal_init(&surface->events.commit); + wl_signal_init(&surface->events.cache); wl_signal_init(&surface->events.destroy); wl_signal_init(&surface->events.new_subsurface);