From a24d8f478610c498ef2207888ffe259fe7152155 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 30 Jul 2024 16:00:45 +0900 Subject: [PATCH] viewport: Use e_surface_buffer_try_get Change-Id: I01de45284a496c88084ff9f076eba517e0fb7caf --- src/bin/server/e_comp_wl_viewport.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/bin/server/e_comp_wl_viewport.c b/src/bin/server/e_comp_wl_viewport.c index 1073bbd..7b32959 100644 --- a/src/bin/server/e_comp_wl_viewport.c +++ b/src/bin/server/e_comp_wl_viewport.c @@ -1489,7 +1489,7 @@ e_comp_wl_viewport_apply(E_Client *ec) if (viewport) _e_comp_wl_viewport_parent_check(viewport); - if (viewport && ec->comp_data->buffer_ref.buffer) + if (viewport && e_surface_has_buffer(viewport->surface)) { E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; Eina_Bool changed = EINA_FALSE, src_changed = EINA_FALSE; @@ -1525,7 +1525,7 @@ e_comp_wl_viewport_apply(E_Client *ec) } } else if (viewport) - PIN("%p buffer", ec->comp_data->buffer_ref.buffer); + PIN("%p buffer", e_surface_buffer_try_get(viewport->surface)); EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) e_comp_wl_viewport_apply(subc); @@ -1577,6 +1577,7 @@ _e_comp_wl_viewport_cb_apply_viewport(struct wl_listener *listener, void *data) E_Client *ec; E_Client *topmost; Eina_Bool changed = EINA_FALSE; + E_Surface *parent_surface; viewport = container_of(listener, E_Viewport, surface_apply_viewport_listener); ec = viewport->ec; @@ -1604,8 +1605,14 @@ _e_comp_wl_viewport_cb_apply_viewport(struct wl_listener *listener, void *data) _e_comp_wl_viewport_parent_check(viewport); if (!viewport->current.changed) return; - if (!ec->comp_data->buffer_ref.buffer) return; - if (viewport->epc && !viewport->epc->comp_data->buffer_ref.buffer) return; + if (!e_surface_has_buffer(viewport->surface)) return; + + if (viewport->epc) + { + parent_surface = e_surface_from_ec(viewport->epc); + if (!e_surface_has_buffer(parent_surface)) + return; + } PDB("apply: topmost(%p)", topmost); -- 2.7.4