renderer: use CRegion foreach over getRects (#10980)

instead of allocating and returning a vector, use forEach to directly
call a function on the rects.
This commit is contained in:
Tom Englund
2025-07-30 11:54:09 +02:00
committed by GitHub
parent 43966cc787
commit 36a8b2226f
4 changed files with 37 additions and 41 deletions

View File

@@ -1966,9 +1966,7 @@ void CHyprRenderer::damageBox(const int& x, const int& y, const int& w, const in
}
void CHyprRenderer::damageRegion(const CRegion& rg) {
for (auto const& RECT : rg.getRects()) {
damageBox(RECT.x1, RECT.y1, RECT.x2 - RECT.x1, RECT.y2 - RECT.y1);
}
rg.forEachRect([this](const auto& RECT) { damageBox(RECT.x1, RECT.y1, RECT.x2 - RECT.x1, RECT.y2 - RECT.y1); });
}
void CHyprRenderer::damageMirrorsWith(PHLMONITOR pMonitor, const CRegion& pRegion) {