summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-05 15:09:26 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-05 15:09:26 +0200
commit8fb3ad8bf16f4bad025e158f02b88ecf094146f5 (patch)
tree4a857999a4fee3bcac8f1d8a2368a9a230c198c0 /src/render
parent77d37cd72ab87f67dd47930c61fa0ad8792f26c2 (diff)
log damage debug opt
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Renderer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 2909ce55..6f59c045 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -455,6 +455,9 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) {
}
pixman_region32_fini(&damageBox);
+
+ if (g_pConfigManager->getInt("debug:log_damage"))
+ Debug::log(LOG, "Damage: Surface (extents): xy: %d, %d wh: %d, %d", damageBox.extents.x1, damageBox.extents.y1, damageBox.extents.x2 - damageBox.extents.x1, damageBox.extents.y2 - damageBox.extents.y1);
}
void CHyprRenderer::damageWindow(CWindow* pWindow) {
@@ -469,6 +472,9 @@ void CHyprRenderer::damageWindow(CWindow* pWindow) {
fixedDamageBox.y -= m.vecPosition.y;
wlr_output_damage_add_box(m.damage, &fixedDamageBox);
}
+
+ if (g_pConfigManager->getInt("debug:log_damage"))
+ Debug::log(LOG, "Damage: Window floated (%s): xy: %d, %d wh: %d, %d", pWindow->m_szTitle.c_str(), damageBox.x, damageBox.y, damageBox.width, damageBox.height);
} else {
// damage by real size & pos + border size * 2 (JIC)
const auto BORDERSIZE = g_pConfigManager->getInt("general:border_size");
@@ -479,6 +485,9 @@ void CHyprRenderer::damageWindow(CWindow* pWindow) {
fixedDamageBox.y -= m.vecPosition.y;
wlr_output_damage_add_box(m.damage, &fixedDamageBox);
}
+
+ if (g_pConfigManager->getInt("debug:log_damage"))
+ Debug::log(LOG, "Damage: Window tiled (%s): xy: %d, %d wh: %d, %d", pWindow->m_szTitle.c_str(), damageBox.x, damageBox.y, damageBox.width, damageBox.height);
}
}
@@ -486,6 +495,9 @@ void CHyprRenderer::damageMonitor(SMonitor* pMonitor) {
wlr_box damageBox = {0, 0, pMonitor->vecSize.x, pMonitor->vecSize.y};
scaleBox(&damageBox, pMonitor->scale);
wlr_output_damage_add_box(pMonitor->damage, &damageBox);
+
+ if (g_pConfigManager->getInt("debug:log_damage"))
+ Debug::log(LOG, "Damage: Monitor %s", pMonitor->szName.c_str());
}
void CHyprRenderer::damageBox(wlr_box* pBox) {
@@ -493,6 +505,9 @@ void CHyprRenderer::damageBox(wlr_box* pBox) {
wlr_box damageBox = {pBox->x - m.vecPosition.x, pBox->y - m.vecPosition.y, pBox->width, pBox->height};
wlr_output_damage_add_box(m.damage, &damageBox);
}
+
+ if (g_pConfigManager->getInt("debug:log_damage"))
+ Debug::log(LOG, "Damage: Box: xy: %d, %d wh: %d, %d", pBox->x, pBox->y, pBox->width, pBox->height);
}
void CHyprRenderer::damageBox(const int& x, const int& y, const int& w, const int& h) {