summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLee Bousfield <ljbousfield@gmail.com>2025-03-20 06:08:47 -0500
committerGitHub <noreply@github.com>2025-03-20 11:08:47 +0000
commit7ea4fbf0ba034d947339b3a94a10da022eca1988 (patch)
treeb11658530b257468b29c589c4c8dda7d39861442 /src
parentf6ca4bac51595555916f7403ae178680791f824c (diff)
types: Upgrade buffer ref from WP to SP (#9677)
Diffstat (limited to 'src')
-rw-r--r--src/helpers/Monitor.cpp4
-rw-r--r--src/protocols/core/Compositor.cpp4
-rw-r--r--src/protocols/types/Buffer.hpp2
-rw-r--r--src/render/Renderer.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 2af548d2..30c15e4e 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -1342,7 +1342,7 @@ bool CMonitor::attemptDirectScanout() {
const auto PSURFACE = g_pXWaylandManager->getWindowSurface(PCANDIDATE);
- if (!PSURFACE || !PSURFACE->current.texture || !PSURFACE->current.buffer || PSURFACE->current.buffer->buffer.expired())
+ if (!PSURFACE || !PSURFACE->current.texture || !PSURFACE->current.buffer)
return false;
if (PSURFACE->current.bufferSize != vecPixelSize || PSURFACE->current.transform != transform)
@@ -1355,7 +1355,7 @@ bool CMonitor::attemptDirectScanout() {
Debug::log(TRACE, "attemptDirectScanout: surface {:x} passed, will attempt, buffer {}", (uintptr_t)PSURFACE.get(), (uintptr_t)PSURFACE->current.buffer->buffer.get());
- auto PBUFFER = PSURFACE->current.buffer->buffer.lock();
+ auto PBUFFER = PSURFACE->current.buffer->buffer;
if (PBUFFER == output->state->state().buffer) {
if (scanoutNeedsCursorUpdate) {
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index a3576c7e..e922c93e 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -440,7 +440,7 @@ void CWLSurfaceResource::commitPendingState(SSurfaceState& state) {
if (current.texture)
current.texture->m_eTransform = wlTransformToHyprutils(current.transform);
- if (current.buffer && current.buffer->buffer) {
+ if (current.buffer) {
const auto DAMAGE = accumulateCurrentBufferDamage();
current.buffer->buffer->update(DAMAGE);
@@ -478,7 +478,7 @@ void CWLSurfaceResource::commitPendingState(SSurfaceState& state) {
}
void CWLSurfaceResource::updateCursorShm(CRegion damage) {
- auto buf = current.buffer ? current.buffer->buffer : WP<IHLBuffer>{};
+ auto buf = current.buffer ? current.buffer->buffer : SP<IHLBuffer>{};
if UNLIKELY (!buf)
return;
diff --git a/src/protocols/types/Buffer.hpp b/src/protocols/types/Buffer.hpp
index 287f8a24..a0b4e9a8 100644
--- a/src/protocols/types/Buffer.hpp
+++ b/src/protocols/types/Buffer.hpp
@@ -45,7 +45,7 @@ class CHLBufferReference {
CHLBufferReference(SP<IHLBuffer> buffer, SP<CWLSurfaceResource> surface);
~CHLBufferReference();
- WP<IHLBuffer> buffer;
+ SP<IHLBuffer> buffer;
UP<CDRMSyncPointState> acquire;
UP<CDRMSyncPointState> release;
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index b76d67e5..88f1f95a 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1531,7 +1531,7 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
Debug::log(TRACE, "Explicit: can't add sync, monitor has no EGLSync");
else {
for (auto const& e : explicitPresented) {
- if (!e->current.buffer || !e->current.buffer->buffer || !e->current.buffer->buffer->syncReleaser)
+ if (!e->current.buffer || !e->current.buffer->buffer->syncReleaser)
continue;
e->current.buffer->buffer->syncReleaser->addReleaseSync(pMonitor->eglSync);