summaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-05-03 18:54:50 +0200
committerGitHub <noreply@github.com>2025-05-03 18:54:50 +0200
commit46ac115bd19ee3aff5c816033de0b1d55a74e33f (patch)
treea731c290e62451d026c809b5bdd22c8034488208 /src/protocols
parent3465efcdc1d15402ca23e7ce609905c5814fb9ee (diff)
protocols: refactor class member vars (types) (#10261)
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/DataDeviceWlr.cpp6
-rw-r--r--src/protocols/LinuxDMABUF.cpp12
-rw-r--r--src/protocols/MesaDRM.cpp12
-rw-r--r--src/protocols/PrimarySelection.cpp6
-rw-r--r--src/protocols/Screencopy.cpp10
-rw-r--r--src/protocols/SinglePixel.cpp16
-rw-r--r--src/protocols/ToplevelExport.cpp10
-rw-r--r--src/protocols/core/Compositor.cpp12
-rw-r--r--src/protocols/core/DataDevice.cpp6
-rw-r--r--src/protocols/core/Shm.cpp10
-rw-r--r--src/protocols/types/Buffer.cpp72
-rw-r--r--src/protocols/types/Buffer.hpp14
-rw-r--r--src/protocols/types/DMABuffer.cpp46
-rw-r--r--src/protocols/types/DMABuffer.hpp6
-rw-r--r--src/protocols/types/DataDevice.cpp4
-rw-r--r--src/protocols/types/DataDevice.hpp4
-rw-r--r--src/protocols/types/WLBuffer.cpp28
-rw-r--r--src/protocols/types/WLBuffer.hpp6
18 files changed, 140 insertions, 140 deletions
diff --git a/src/protocols/DataDeviceWlr.cpp b/src/protocols/DataDeviceWlr.cpp
index 680840da..a79e71af 100644
--- a/src/protocols/DataDeviceWlr.cpp
+++ b/src/protocols/DataDeviceWlr.cpp
@@ -49,11 +49,11 @@ CWLRDataSource::CWLRDataSource(SP<CZwlrDataControlSourceV1> resource_, SP<CWLRDa
resource->setData(this);
resource->setDestroy([this](CZwlrDataControlSourceV1* r) {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::dataWlr->destroyResource(this);
});
resource->setOnDestroy([this](CZwlrDataControlSourceV1* r) {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::dataWlr->destroyResource(this);
});
@@ -61,7 +61,7 @@ CWLRDataSource::CWLRDataSource(SP<CZwlrDataControlSourceV1> resource_, SP<CWLRDa
}
CWLRDataSource::~CWLRDataSource() {
- events.destroy.emit();
+ m_events.destroy.emit();
}
SP<CWLRDataSource> CWLRDataSource::fromResource(wl_resource* res) {
diff --git a/src/protocols/LinuxDMABUF.cpp b/src/protocols/LinuxDMABUF.cpp
index 2a067bf7..189a2555 100644
--- a/src/protocols/LinuxDMABUF.cpp
+++ b/src/protocols/LinuxDMABUF.cpp
@@ -99,20 +99,20 @@ CDMABUFFormatTable::CDMABUFFormatTable(SDMABUFTranche _rendererTranche, std::vec
CLinuxDMABuffer::CLinuxDMABuffer(uint32_t id, wl_client* client, Aquamarine::SDMABUFAttrs attrs) {
buffer = makeShared<CDMABuffer>(id, client, attrs);
- buffer->resource->buffer = buffer;
+ buffer->m_resource->m_buffer = buffer;
listeners.bufferResourceDestroy = buffer->events.destroy.registerListener([this](std::any d) {
listeners.bufferResourceDestroy.reset();
PROTO::linuxDma->destroyResource(this);
});
- if (!buffer->success)
+ if (!buffer->m_success)
LOGM(ERR, "Possibly compositor bug: buffer failed to create");
}
CLinuxDMABuffer::~CLinuxDMABuffer() {
- if (buffer && buffer->resource)
- buffer->resource->sendRelease();
+ if (buffer && buffer->m_resource)
+ buffer->m_resource->sendRelease();
buffer.reset();
listeners.bufferResourceDestroy.reset();
@@ -219,14 +219,14 @@ void CLinuxDMABUFParamsResource::create(uint32_t id) {
auto buf = PROTO::linuxDma->m_vBuffers.emplace_back(makeShared<CLinuxDMABuffer>(id, resource->client(), *attrs));
- if UNLIKELY (!buf->good() || !buf->buffer->success) {
+ if UNLIKELY (!buf->good() || !buf->buffer->m_success) {
resource->sendFailed();
PROTO::linuxDma->m_vBuffers.pop_back();
return;
}
if (!id)
- resource->sendCreated(PROTO::linuxDma->m_vBuffers.back()->buffer->resource->getResource());
+ resource->sendCreated(PROTO::linuxDma->m_vBuffers.back()->buffer->m_resource->getResource());
createdBuffer = buf;
}
diff --git a/src/protocols/MesaDRM.cpp b/src/protocols/MesaDRM.cpp
index 41c34d89..be5a02cd 100644
--- a/src/protocols/MesaDRM.cpp
+++ b/src/protocols/MesaDRM.cpp
@@ -11,21 +11,21 @@ CMesaDRMBufferResource::CMesaDRMBufferResource(uint32_t id, wl_client* client, A
LOGM(LOG, " | plane {}: mod {} fd {} stride {} offset {}", i, attrs_.modifier, attrs_.fds[i], attrs_.strides[i], attrs_.offsets[i]);
}
- buffer = makeShared<CDMABuffer>(id, client, attrs_);
- buffer->resource->buffer = buffer;
+ buffer = makeShared<CDMABuffer>(id, client, attrs_);
+ buffer->m_resource->m_buffer = buffer;
listeners.bufferResourceDestroy = buffer->events.destroy.registerListener([this](std::any d) {
listeners.bufferResourceDestroy.reset();
PROTO::mesaDRM->destroyResource(this);
});
- if (!buffer->success)
+ if (!buffer->m_success)
LOGM(ERR, "Possibly compositor bug: buffer failed to create");
}
CMesaDRMBufferResource::~CMesaDRMBufferResource() {
- if (buffer && buffer->resource)
- buffer->resource->sendRelease();
+ if (buffer && buffer->m_resource)
+ buffer->m_resource->sendRelease();
buffer.reset();
listeners.bufferResourceDestroy.reset();
}
@@ -94,7 +94,7 @@ CMesaDRMResource::CMesaDRMResource(SP<CWlDrm> resource_) : resource(resource_) {
}
// append instance so that buffer knows its owner
- RESOURCE->buffer->resource->buffer = RESOURCE->buffer;
+ RESOURCE->buffer->m_resource->m_buffer = RESOURCE->buffer;
});
resource->sendDevice(PROTO::mesaDRM->nodeName.c_str());
diff --git a/src/protocols/PrimarySelection.cpp b/src/protocols/PrimarySelection.cpp
index 2cd610ec..d6eb5165 100644
--- a/src/protocols/PrimarySelection.cpp
+++ b/src/protocols/PrimarySelection.cpp
@@ -50,11 +50,11 @@ CPrimarySelectionSource::CPrimarySelectionSource(SP<CZwpPrimarySelectionSourceV1
resource->setData(this);
resource->setDestroy([this](CZwpPrimarySelectionSourceV1* r) {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::primarySelection->destroyResource(this);
});
resource->setOnDestroy([this](CZwpPrimarySelectionSourceV1* r) {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::primarySelection->destroyResource(this);
});
@@ -62,7 +62,7 @@ CPrimarySelectionSource::CPrimarySelectionSource(SP<CZwpPrimarySelectionSourceV1
}
CPrimarySelectionSource::~CPrimarySelectionSource() {
- events.destroy.emit();
+ m_events.destroy.emit();
}
SP<CPrimarySelectionSource> CPrimarySelectionSource::fromResource(wl_resource* res) {
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp
index 4539a463..391d13e7 100644
--- a/src/protocols/Screencopy.cpp
+++ b/src/protocols/Screencopy.cpp
@@ -100,7 +100,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
return;
}
- if UNLIKELY (PBUFFER->buffer->size != box.size()) {
+ if UNLIKELY (PBUFFER->m_buffer->size != box.size()) {
LOGM(ERR, "Invalid dimensions in {:x}", (uintptr_t)this);
resource->error(ZWLR_SCREENCOPY_FRAME_V1_ERROR_INVALID_BUFFER, "invalid buffer dimensions");
PROTO::screencopy->destroyResource(this);
@@ -114,7 +114,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
return;
}
- if (auto attrs = PBUFFER->buffer->dmabuf(); attrs.success) {
+ if (auto attrs = PBUFFER->m_buffer->dmabuf(); attrs.success) {
bufferDMA = true;
if (attrs.format != dmabufFormat) {
@@ -123,7 +123,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
PROTO::screencopy->destroyResource(this);
return;
}
- } else if (auto attrs = PBUFFER->buffer->shm(); attrs.success) {
+ } else if (auto attrs = PBUFFER->m_buffer->shm(); attrs.success) {
if (attrs.format != shmFormat) {
LOGM(ERR, "Invalid buffer shm format in {:x}", (uintptr_t)pFrame);
resource->error(ZWLR_SCREENCOPY_FRAME_V1_ERROR_INVALID_BUFFER, "invalid buffer format");
@@ -142,7 +142,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
return;
}
- buffer = CHLBufferReference(PBUFFER->buffer.lock());
+ buffer = CHLBufferReference(PBUFFER->m_buffer.lock());
PROTO::screencopy->m_vFramesAwaitingWrite.emplace_back(self);
@@ -193,7 +193,7 @@ void CScreencopyFrame::copyDmabuf(std::function<void(bool)> callback) {
CRegion fakeDamage = {0, 0, INT16_MAX, INT16_MAX};
- if (!g_pHyprRenderer->beginRender(pMonitor.lock(), fakeDamage, RENDER_MODE_TO_BUFFER, buffer.buffer, nullptr, true)) {
+ if (!g_pHyprRenderer->beginRender(pMonitor.lock(), fakeDamage, RENDER_MODE_TO_BUFFER, buffer.m_buffer, nullptr, true)) {
LOGM(ERR, "Can't copy: failed to begin rendering to dma frame");
callback(false);
return;
diff --git a/src/protocols/SinglePixel.cpp b/src/protocols/SinglePixel.cpp
index c383dbb3..1104ab42 100644
--- a/src/protocols/SinglePixel.cpp
+++ b/src/protocols/SinglePixel.cpp
@@ -10,13 +10,13 @@ CSinglePixelBuffer::CSinglePixelBuffer(uint32_t id, wl_client* client, CHyprColo
g_pHyprRenderer->makeEGLCurrent();
- opaque = col_.a >= 1.F;
+ m_opaque = col_.a >= 1.F;
- texture = makeShared<CTexture>(DRM_FORMAT_ARGB8888, (uint8_t*)&color, 4, Vector2D{1, 1});
+ m_texture = makeShared<CTexture>(DRM_FORMAT_ARGB8888, (uint8_t*)&color, 4, Vector2D{1, 1});
- resource = CWLBufferResource::create(makeShared<CWlBuffer>(client, 1, id));
+ m_resource = CWLBufferResource::create(makeShared<CWlBuffer>(client, 1, id));
- success = texture->m_iTexID;
+ success = m_texture->m_iTexID;
size = {1, 1};
@@ -25,8 +25,8 @@ CSinglePixelBuffer::CSinglePixelBuffer(uint32_t id, wl_client* client, CHyprColo
}
CSinglePixelBuffer::~CSinglePixelBuffer() {
- if (resource)
- resource->sendRelease();
+ if (m_resource)
+ m_resource->sendRelease();
}
Aquamarine::eBufferCapability CSinglePixelBuffer::caps() {
@@ -58,7 +58,7 @@ void CSinglePixelBuffer::endDataPtr() {
}
bool CSinglePixelBuffer::good() {
- return resource->good();
+ return m_resource->good();
}
CSinglePixelBufferResource::CSinglePixelBufferResource(uint32_t id, wl_client* client, CHyprColor color) {
@@ -67,7 +67,7 @@ CSinglePixelBufferResource::CSinglePixelBufferResource(uint32_t id, wl_client* c
if UNLIKELY (!buffer->good())
return;
- buffer->resource->buffer = buffer;
+ buffer->m_resource->m_buffer = buffer;
listeners.bufferResourceDestroy = buffer->events.destroy.registerListener([this](std::any d) {
listeners.bufferResourceDestroy.reset();
diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp
index 57fc415e..fd5d0b27 100644
--- a/src/protocols/ToplevelExport.cpp
+++ b/src/protocols/ToplevelExport.cpp
@@ -155,7 +155,7 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou
return;
}
- if UNLIKELY (PBUFFER->buffer->size != box.size()) {
+ if UNLIKELY (PBUFFER->m_buffer->size != box.size()) {
resource->error(HYPRLAND_TOPLEVEL_EXPORT_FRAME_V1_ERROR_INVALID_BUFFER, "invalid buffer dimensions");
PROTO::toplevelExport->destroyResource(this);
return;
@@ -167,7 +167,7 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou
return;
}
- if (auto attrs = PBUFFER->buffer->dmabuf(); attrs.success) {
+ if (auto attrs = PBUFFER->m_buffer->dmabuf(); attrs.success) {
bufferDMA = true;
if (attrs.format != dmabufFormat) {
@@ -175,7 +175,7 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou
PROTO::toplevelExport->destroyResource(this);
return;
}
- } else if (auto attrs = PBUFFER->buffer->shm(); attrs.success) {
+ } else if (auto attrs = PBUFFER->m_buffer->shm(); attrs.success) {
if (attrs.format != shmFormat) {
resource->error(HYPRLAND_TOPLEVEL_EXPORT_FRAME_V1_ERROR_INVALID_BUFFER, "invalid buffer format");
PROTO::toplevelExport->destroyResource(this);
@@ -191,7 +191,7 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou
return;
}
- buffer = CHLBufferReference(PBUFFER->buffer.lock());
+ buffer = CHLBufferReference(PBUFFER->m_buffer.lock());
m_ignoreDamage = ignoreDamage;
@@ -340,7 +340,7 @@ bool CToplevelExportFrame::copyDmabuf(const Time::steady_tp& now) {
g_pPointerManager->damageCursor(PMONITOR->m_self.lock());
}
- if (!g_pHyprRenderer->beginRender(PMONITOR, fakeDamage, RENDER_MODE_TO_BUFFER, buffer.buffer))
+ if (!g_pHyprRenderer->beginRender(PMONITOR, fakeDamage, RENDER_MODE_TO_BUFFER, buffer.m_buffer))
return false;
g_pHyprOpenGL->clear(CHyprColor(0, 0, 0, 1.0));
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index df1916ef..e6390dbf 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -82,11 +82,11 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re
auto buf = buffer ? CWLBufferResource::fromResource(buffer) : nullptr;
- if (buf && buf->buffer) {
- m_pending.buffer = CHLBufferReference(buf->buffer.lock());
- m_pending.texture = buf->buffer->texture;
- m_pending.size = buf->buffer->size;
- m_pending.bufferSize = buf->buffer->size;
+ if (buf && buf->m_buffer) {
+ m_pending.buffer = CHLBufferReference(buf->m_buffer.lock());
+ m_pending.texture = buf->m_buffer->m_texture;
+ m_pending.size = buf->m_buffer->size;
+ m_pending.bufferSize = buf->m_buffer->size;
} else {
m_pending.buffer = {};
m_pending.texture.reset();
@@ -157,7 +157,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re
whenReadable();
} else if (state->buffer->type() == Aquamarine::BUFFER_TYPE_DMABUF && state->buffer->dmabuf().success) {
// async buffer and is dmabuf, then we can wait on implicit fences
- auto syncFd = dynamic_cast<CDMABuffer*>(state->buffer.buffer.get())->exportSyncFile();
+ auto syncFd = dynamic_cast<CDMABuffer*>(state->buffer.m_buffer.get())->exportSyncFile();
if (syncFd.isValid())
g_pEventLoopManager->doOnReadable(std::move(syncFd), whenReadable);
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index a54ae7e1..63523cd9 100644
--- a/src/protocols/core/DataDevice.cpp
+++ b/src/protocols/core/DataDevice.cpp
@@ -134,12 +134,12 @@ CWLDataSourceResource::CWLDataSourceResource(SP<CWlDataSource> resource_, SP<CWL
m_resource->setData(this);
m_resource->setDestroy([this](CWlDataSource* r) {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::data->onDestroyDataSource(m_self);
PROTO::data->destroyResource(this);
});
m_resource->setOnDestroy([this](CWlDataSource* r) {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::data->onDestroyDataSource(m_self);
PROTO::data->destroyResource(this);
});
@@ -152,7 +152,7 @@ CWLDataSourceResource::CWLDataSourceResource(SP<CWlDataSource> resource_, SP<CWL
}
CWLDataSourceResource::~CWLDataSourceResource() {
- events.destroy.emit();
+ m_events.destroy.emit();
PROTO::data->onDestroyDataSource(m_self);
}
diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp
index 6ebfa64f..228884b9 100644
--- a/src/protocols/core/Shm.cpp
+++ b/src/protocols/core/Shm.cpp
@@ -20,9 +20,9 @@ CWLSHMBuffer::CWLSHMBuffer(SP<CWLSHMPoolResource> pool_, uint32_t id, int32_t of
m_stride = stride_;
m_fmt = fmt_;
m_offset = offset_;
- opaque = NFormatUtils::isFormatOpaque(NFormatUtils::shmToDRM(fmt_));
+ m_opaque = NFormatUtils::isFormatOpaque(NFormatUtils::shmToDRM(fmt_));
- resource = CWLBufferResource::create(makeShared<CWlBuffer>(pool_->m_resource->client(), 1, id));
+ m_resource = CWLBufferResource::create(makeShared<CWlBuffer>(pool_->m_resource->client(), 1, id));
m_listeners.bufferResourceDestroy = events.destroy.registerListener([this](std::any d) {
m_listeners.bufferResourceDestroy.reset();
@@ -31,8 +31,8 @@ CWLSHMBuffer::CWLSHMBuffer(SP<CWLSHMPoolResource> pool_, uint32_t id, int32_t of
}
CWLSHMBuffer::~CWLSHMBuffer() {
- if (resource)
- resource->sendRelease();
+ if (m_resource)
+ m_resource->sendRelease();
}
Aquamarine::eBufferCapability CWLSHMBuffer::caps() {
@@ -156,7 +156,7 @@ CWLSHMPoolResource::CWLSHMPoolResource(SP<CWlShmPool> resource_, CFileDescriptor
}
// append instance so that buffer knows its owner
- RESOURCE->resource->buffer = RESOURCE;
+ RESOURCE->m_resource->m_buffer = RESOURCE;
});
if UNLIKELY (m_pool->m_data == MAP_FAILED)
diff --git a/src/protocols/types/Buffer.cpp b/src/protocols/types/Buffer.cpp
index 73155c29..179a1b0e 100644
--- a/src/protocols/types/Buffer.cpp
+++ b/src/protocols/types/Buffer.cpp
@@ -1,104 +1,104 @@
#include "Buffer.hpp"
IHLBuffer::~IHLBuffer() {
- if (locked() && resource)
+ if (locked() && m_resource)
sendRelease();
}
void IHLBuffer::sendRelease() {
- resource->sendRelease();
- syncReleasers.clear();
+ m_resource->sendRelease();
+ m_syncReleasers.clear();
}
void IHLBuffer::lock() {
- nLocks++;
+ m_locks++;
}
void IHLBuffer::unlock() {
- nLocks--;
+ m_locks--;
- ASSERT(nLocks >= 0);
+ ASSERT(m_locks >= 0);
- if (nLocks == 0)
+ if (m_locks == 0)
sendRelease();
}
bool IHLBuffer::locked() {
- return nLocks > 0;
+ return m_locks > 0;
}
void IHLBuffer::onBackendRelease(const std::function<void()>& fn) {
- if (hlEvents.backendRelease) {
- hlEvents.backendRelease->emit(nullptr);
+ if (m_hlEvents.backendRelease) {
+ m_hlEvents.backendRelease->emit(nullptr);
Debug::log(LOG, "backendRelease emitted early");
}
- hlEvents.backendRelease = events.backendRelease.registerListener([this, fn](std::any) {
+ m_hlEvents.backendRelease = events.backendRelease.registerListener([this, fn](std::any) {
fn();
- hlEvents.backendRelease.reset();
+ m_hlEvents.backendRelease.reset();
});
}
void IHLBuffer::addReleasePoint(CDRMSyncPointState& point) {
ASSERT(locked());
if (point)
- syncReleasers.emplace_back(point.createSyncRelease());
+ m_syncReleasers.emplace_back(point.createSyncRelease());
}
-CHLBufferReference::CHLBufferReference() : buffer(nullptr) {
+CHLBufferReference::CHLBufferReference() : m_buffer(nullptr) {
;
}
-CHLBufferReference::CHLBufferReference(const CHLBufferReference& other) : buffer(other.buffer) {
- if (buffer)
- buffer->lock();
+CHLBufferReference::CHLBufferReference(const CHLBufferReference& other) : m_buffer(other.m_buffer) {
+ if (m_buffer)
+ m_buffer->lock();
}
-CHLBufferReference::CHLBufferReference(SP<IHLBuffer> buffer_) : buffer(buffer_) {
- if (buffer)
- buffer->lock();
+CHLBufferReference::CHLBufferReference(SP<IHLBuffer> buffer_) : m_buffer(buffer_) {
+ if (m_buffer)
+ m_buffer->lock();
}
CHLBufferReference::~CHLBufferReference() {
- if (buffer)
- buffer->unlock();
+ if (m_buffer)
+ m_buffer->unlock();
}
CHLBufferReference& CHLBufferReference::operator=(const CHLBufferReference& other) {
- if (other.buffer)
- other.buffer->lock();
- if (buffer)
- buffer->unlock();
- buffer = other.buffer;
+ if (other.m_buffer)
+ other.m_buffer->lock();
+ if (m_buffer)
+ m_buffer->unlock();
+ m_buffer = other.m_buffer;
return *this;
}
bool CHLBufferReference::operator==(const CHLBufferReference& other) const {
- return buffer == other.buffer;
+ return m_buffer == other.m_buffer;
}
bool CHLBufferReference::operator==(const SP<IHLBuffer>& other) const {
- return buffer == other;
+ return m_buffer == other;
}
bool CHLBufferReference::operator==(const SP<Aquamarine::IBuffer>& other) const {
- return buffer == other;
+ return m_buffer == other;
}
SP<IHLBuffer> CHLBufferReference::operator->() const {
- return buffer;
+ return m_buffer;
}
CHLBufferReference::operator bool() const {
- return buffer;
+ return m_buffer;
}
void CHLBufferReference::drop() {
- if (!buffer)
+ if (!m_buffer)
return;
- buffer->nLocks--;
- ASSERT(buffer->nLocks >= 0);
+ m_buffer->m_locks--;
+ ASSERT(m_buffer->m_locks >= 0);
- buffer = nullptr;
+ m_buffer = nullptr;
}
diff --git a/src/protocols/types/Buffer.hpp b/src/protocols/types/Buffer.hpp
index e4821ac0..692cb97c 100644
--- a/src/protocols/types/Buffer.hpp
+++ b/src/protocols/types/Buffer.hpp
@@ -26,18 +26,18 @@ class IHLBuffer : public Aquamarine::IBuffer {
void onBackendRelease(const std::function<void()>& fn);
void addReleasePoint(CDRMSyncPointState& point);
- SP<CTexture> texture;
- bool opaque = false;
- SP<CWLBufferResource> resource;
- std::vector<UP<CSyncReleaser>> syncReleasers;
+ SP<CTexture> m_texture;
+ bool m_opaque = false;
+ SP<CWLBufferResource> m_resource;
+ std::vector<UP<CSyncReleaser>> m_syncReleasers;
struct {
CHyprSignalListener backendRelease;
CHyprSignalListener backendRelease2; // for explicit ds
- } hlEvents;
+ } m_hlEvents;
private:
- int nLocks = 0;
+ int m_locks = 0;
friend class CHLBufferReference;
};
@@ -60,5 +60,5 @@ class CHLBufferReference {
// unlock and drop the buffer without sending release
void drop();
- SP<IHLBuffer> buffer;
+ SP<IHLBuffer> m_buffer;
};
diff --git a/src/protocols/types/DMABuffer.cpp b/src/protocols/types/DMABuffer.cpp
index d08925ff..d8e41959 100644
--- a/src/protocols/types/DMABuffer.cpp
+++ b/src/protocols/types/DMABuffer.cpp
@@ -12,40 +12,40 @@
using namespace Hyprutils::OS;
-CDMABuffer::CDMABuffer(uint32_t id, wl_client* client, Aquamarine::SDMABUFAttrs const& attrs_) : attrs(attrs_) {
+CDMABuffer::CDMABuffer(uint32_t id, wl_client* client, Aquamarine::SDMABUFAttrs const& attrs_) : m_attrs(attrs_) {
g_pHyprRenderer->makeEGLCurrent();
- listeners.resourceDestroy = events.destroy.registerListener([this](std::any d) {
+ m_listeners.resourceDestroy = events.destroy.registerListener([this](std::any d) {
closeFDs();
- listeners.resourceDestroy.reset();
+ m_listeners.resourceDestroy.reset();
});
- size = attrs.size;
- resource = CWLBufferResource::create(makeShared<CWlBuffer>(client, 1, id));
+ size = m_attrs.size;
+ m_resource = CWLBufferResource::create(makeShared<CWlBuffer>(client, 1, id));
- auto eglImage = g_pHyprOpenGL->createEGLImage(attrs);
+ auto eglImage = g_pHyprOpenGL->createEGLImage(m_attrs);
if UNLIKELY (!eglImage) {
Debug::log(ERR, "CDMABuffer: failed to import EGLImage, retrying as implicit");
- attrs.modifier = DRM_FORMAT_MOD_INVALID;
- eglImage = g_pHyprOpenGL->createEGLImage(attrs);
+ m_attrs.modifier = DRM_FORMAT_MOD_INVALID;
+ eglImage = g_pHyprOpenGL->createEGLImage(m_attrs);
if UNLIKELY (!eglImage) {
Debug::log(ERR, "CDMABuffer: failed to import EGLImage");
return;
}
}
- texture = makeShared<CTexture>(attrs, eglImage); // texture takes ownership of the eglImage
- opaque = NFormatUtils::isFormatOpaque(attrs.format);
- success = texture->m_iTexID;
+ m_texture = makeShared<CTexture>(m_attrs, eglImage); // texture takes ownership of the eglImage
+ m_opaque = NFormatUtils::isFormatOpaque(m_attrs.format);
+ m_success = m_texture->m_iTexID;
- if UNLIKELY (!success)
+ if UNLIKELY (!m_success)
Debug::log(ERR, "Failed to create a dmabuf: texture is null");
}
CDMABuffer::~CDMABuffer() {
- if (resource)
- resource->sendRelease();
+ if (m_resource)
+ m_resource->sendRelease();
closeFDs();
}
@@ -67,7 +67,7 @@ bool CDMABuffer::isSynchronous() {
}
Aquamarine::SDMABUFAttrs CDMABuffer::dmabuf() {
- return attrs;
+ return m_attrs;
}
std::tuple<uint8_t*, uint32_t, size_t> CDMABuffer::beginDataPtr(uint32_t flags) {
@@ -80,17 +80,17 @@ void CDMABuffer::endDataPtr() {
}
bool CDMABuffer::good() {
- return success;
+ return m_success;
}
void CDMABuffer::closeFDs() {
- for (int i = 0; i < attrs.planes; ++i) {
- if (attrs.fds[i] == -1)
+ for (int i = 0; i < m_attrs.planes; ++i) {
+ if (m_attrs.fds[i] == -1)
continue;
- close(attrs.fds[i]);
- attrs.fds[i] = -1;
+ close(m_attrs.fds[i]);
+ m_attrs.fds[i] = -1;
}
- attrs.planes = 0;
+ m_attrs.planes = 0;
}
static int doIoctl(int fd, unsigned long request, void* arg) {
@@ -111,8 +111,8 @@ CFileDescriptor CDMABuffer::exportSyncFile() {
#if !defined(__linux__)
return {};
#else
- std::vector<CFileDescriptor> syncFds(attrs.fds.size());
- for (const auto& fd : attrs.fds) {
+ std::vector<CFileDescriptor> syncFds(m_attrs.fds.size());
+ for (const auto& fd : m_attrs.fds) {
if (fd == -1)
continue;
diff --git a/src/protocols/types/DMABuffer.hpp b/src/protocols/types/DMABuffer.hpp
index 5ebf7581..19f2ddf7 100644
--- a/src/protocols/types/DMABuffer.hpp
+++ b/src/protocols/types/DMABuffer.hpp
@@ -19,12 +19,12 @@ class CDMABuffer : public IHLBuffer {
void closeFDs();
Hyprutils::OS::CFileDescriptor exportSyncFile();
- bool success = false;
+ bool m_success = false;
private:
- Aquamarine::SDMABUFAttrs attrs;
+ Aquamarine::SDMABUFAttrs m_attrs;
struct {
CHyprSignalListener resourceDestroy;
- } listeners;
+ } m_listeners;
};
diff --git a/src/protocols/types/DataDevice.cpp b/src/protocols/types/DataDevice.cpp
index fef11b64..8c94b5b1 100644
--- a/src/protocols/types/DataDevice.cpp
+++ b/src/protocols/types/DataDevice.cpp
@@ -9,11 +9,11 @@ bool IDataSource::dndDone() {
}
bool IDataSource::used() {
- return wasUsed;
+ return m_wasUsed;
}
void IDataSource::markUsed() {
- wasUsed = true;
+ m_wasUsed = true;
}
eDataSourceType IDataSource::type() {
diff --git a/src/protocols/types/DataDevice.hpp b/src/protocols/types/DataDevice.hpp
index cbb4b271..857d818d 100644
--- a/src/protocols/types/DataDevice.hpp
+++ b/src/protocols/types/DataDevice.hpp
@@ -42,10 +42,10 @@ class IDataSource {
struct {
CSignal destroy;
- } events;
+ } m_events;
private:
- bool wasUsed = false;
+ bool m_wasUsed = false;
};
class IDataOffer {
diff --git a/src/protocols/types/WLBuffer.cpp b/src/protocols/types/WLBuffer.cpp
index f2b81c00..8e2f2b5f 100644
--- a/src/protocols/types/WLBuffer.cpp
+++ b/src/protocols/types/WLBuffer.cpp
@@ -5,43 +5,43 @@
#include "../../helpers/sync/SyncTimeline.hpp"
#include <xf86drm.h>
-CWLBufferResource::CWLBufferResource(WP<CWlBuffer> resource_) : resource(resource_.lock()) {
+CWLBufferResource::CWLBufferResource(WP<CWlBuffer> resource_) : m_resource(resource_.lock()) {
if UNLIKELY (!good())
return;
- resource->setOnDestroy([this](CWlBuffer* r) {
- if (buffer.expired())
+ m_resource->setOnDestroy([this](CWlBuffer* r) {
+ if (m_buffer.expired())
return;
- buffer->events.destroy.emit();
+ m_buffer->events.destroy.emit();
});
- resource->setDestroy([this](CWlBuffer* r) {
- if (buffer.expired())
+ m_resource->setDestroy([this](CWlBuffer* r) {
+ if (m_buffer.expired())
return;
- buffer->events.destroy.emit();
+ m_buffer->events.destroy.emit();
});
- resource->setData(this);
+ m_resource->setData(this);
}
bool CWLBufferResource::good() {
- return resource->resource();
+ return m_resource->resource();
}
void CWLBufferResource::sendRelease() {
- resource->sendRelease();
+ m_resource->sendRelease();
}
wl_resource* CWLBufferResource::getResource() {
- return resource->resource();
+ return m_resource->resource();
}
SP<CWLBufferResource> CWLBufferResource::fromResource(wl_resource* res) {
auto data = (CWLBufferResource*)(((CWlBuffer*)wl_resource_get_user_data(res))->data());
- return data ? data->self.lock() : nullptr;
+ return data ? data->m_self.lock() : nullptr;
}
SP<CWLBufferResource> CWLBufferResource::create(WP<CWlBuffer> resource) {
- auto p = SP<CWLBufferResource>(new CWLBufferResource(resource));
- p->self = p;
+ auto p = SP<CWLBufferResource>(new CWLBufferResource(resource));
+ p->m_self = p;
return p;
}
diff --git a/src/protocols/types/WLBuffer.hpp b/src/protocols/types/WLBuffer.hpp
index c7e21d4c..2e823c5e 100644
--- a/src/protocols/types/WLBuffer.hpp
+++ b/src/protocols/types/WLBuffer.hpp
@@ -18,14 +18,14 @@ class CWLBufferResource {
void sendRelease();
wl_resource* getResource();
- WP<IHLBuffer> buffer;
+ WP<IHLBuffer> m_buffer;
- WP<CWLBufferResource> self;
+ WP<CWLBufferResource> m_self;
private:
CWLBufferResource(WP<CWlBuffer> resource_);
- SP<CWlBuffer> resource;
+ SP<CWlBuffer> m_resource;
friend class IHLBuffer;
};