summaryrefslogtreecommitdiff
path: root/src/protocols/core
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-07-30 11:54:09 +0200
committerGitHub <noreply@github.com>2025-07-30 11:54:09 +0200
commit36a8b2226f42c28092cb8f2d65c0a5ff0da4414f (patch)
treee1a37fe842b35e8b1d2f53ced3c8422b1e371964 /src/protocols/core
parent43966cc787c4a8844ac1e7affaadeedde8f4cc60 (diff)
renderer: use CRegion foreach over getRects (#10980)
instead of allocating and returning a vector, use forEach to directly call a function on the rects.
Diffstat (limited to 'src/protocols/core')
-rw-r--r--src/protocols/core/Compositor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index 10b554f6..bbb76cb2 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -606,14 +606,14 @@ void CWLSurfaceResource::updateCursorShm(CRegion damage) {
if (const auto RECTS = damage.getRects(); RECTS.size() == 1 && RECTS.at(0).x2 == buf->size.x && RECTS.at(0).y2 == buf->size.y)
memcpy(shmData.data(), pixelData, bufLen);
else {
- for (auto& box : damage.getRects()) {
+ damage.forEachRect([&pixelData, &shmData](const auto& box) {
for (auto y = box.y1; y < box.y2; ++y) {
// bpp is 32 INSALLAH
auto begin = 4 * box.y1 * (box.x2 - box.x1) + box.x1;
auto len = 4 * (box.x2 - box.x1);
memcpy((uint8_t*)shmData.data() + begin, (uint8_t*)pixelData + begin, len);
}
- }
+ });
}
}