From da86db43d47141b9d7332d3cb756ff7c05dbb39a Mon Sep 17 00:00:00 2001 From: Ikalco <73481042+ikalco@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:03:27 -0500 Subject: core: refactor and improve surface commit (#9805) * make CHLBufferReference not a SP anymore * copy over release and acquire points in CHLBufferReference * use CHLBufferReference in screencopy and toplevel export TODO: use CHLBufferReference in direct scanout properly the only problem is the scanout buffer release timing, specifically the onBackendRelease mechanism * cleanup SSurfaceState and surface pending commit tracking * move surface code from DRMSyncobj, and move acquire to SSurfaceState * use queue for comitted pending surface states like proto says "The content update is placed in a queue until it becomes active." - wl_surface::commit * drop, not release, prev buffer if 2nd buffer wl_surface.attach is sent "A wl_buffer that has been attached and then replaced by another attach instead of committed will not receive a release event, and is not used by the compositor." - wl_surface::attach --- src/protocols/Viewporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/protocols/Viewporter.cpp') diff --git a/src/protocols/Viewporter.cpp b/src/protocols/Viewporter.cpp index d14e7ee5..674b8373 100644 --- a/src/protocols/Viewporter.cpp +++ b/src/protocols/Viewporter.cpp @@ -15,6 +15,8 @@ CViewportResource::CViewportResource(SP resource_, SPpending.updated.viewport = true; + if (x == -1 && y == -1) { surface->pending.viewport.hasDestination = false; return; @@ -35,6 +37,8 @@ CViewportResource::CViewportResource(SP resource_, SPpending.updated.viewport = true; + double x = wl_fixed_to_double(fx), y = wl_fixed_to_double(fy), w = wl_fixed_to_double(fw), h = wl_fixed_to_double(fh); if (x == -1 && y == -1 && w == -1 && h == -1) { -- cgit v1.2.3