mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-22 23:43:50 -07:00
helpers: refactor class member vars (#10218)
This commit is contained in:
@@ -18,7 +18,7 @@ void CHyprMonitorDebugOverlay::renderData(PHLMONITOR pMonitor, float durationUs)
|
||||
|
||||
m_lastRenderTimes.emplace_back(durationUs / 1000.f);
|
||||
|
||||
if (m_lastRenderTimes.size() > (long unsigned int)pMonitor->refreshRate)
|
||||
if (m_lastRenderTimes.size() > (long unsigned int)pMonitor->m_refreshRate)
|
||||
m_lastRenderTimes.pop_front();
|
||||
|
||||
if (!m_monitor)
|
||||
@@ -33,7 +33,7 @@ void CHyprMonitorDebugOverlay::renderDataNoOverlay(PHLMONITOR pMonitor, float du
|
||||
|
||||
m_lastRenderTimesNoOverlay.emplace_back(durationUs / 1000.f);
|
||||
|
||||
if (m_lastRenderTimesNoOverlay.size() > (long unsigned int)pMonitor->refreshRate)
|
||||
if (m_lastRenderTimesNoOverlay.size() > (long unsigned int)pMonitor->m_refreshRate)
|
||||
m_lastRenderTimesNoOverlay.pop_front();
|
||||
|
||||
if (!m_monitor)
|
||||
@@ -48,7 +48,7 @@ void CHyprMonitorDebugOverlay::frameData(PHLMONITOR pMonitor) {
|
||||
|
||||
m_lastFrametimes.emplace_back(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - m_lastFrame).count() / 1000.f);
|
||||
|
||||
if (m_lastFrametimes.size() > (long unsigned int)pMonitor->refreshRate)
|
||||
if (m_lastFrametimes.size() > (long unsigned int)pMonitor->m_refreshRate)
|
||||
m_lastFrametimes.pop_front();
|
||||
|
||||
m_lastFrame = std::chrono::high_resolution_clock::now();
|
||||
@@ -59,7 +59,7 @@ void CHyprMonitorDebugOverlay::frameData(PHLMONITOR pMonitor) {
|
||||
// anim data too
|
||||
const auto PMONITORFORTICKS = g_pHyprRenderer->m_pMostHzMonitor ? g_pHyprRenderer->m_pMostHzMonitor.lock() : g_pCompositor->m_lastMonitor.lock();
|
||||
if (PMONITORFORTICKS) {
|
||||
if (m_lastAnimationTicks.size() > (long unsigned int)PMONITORFORTICKS->refreshRate)
|
||||
if (m_lastAnimationTicks.size() > (long unsigned int)PMONITORFORTICKS->m_refreshRate)
|
||||
m_lastAnimationTicks.pop_front();
|
||||
|
||||
m_lastAnimationTicks.push_back(g_pAnimationManager->m_fLastTickTime);
|
||||
@@ -166,7 +166,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) {
|
||||
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
std::string text;
|
||||
showText(m_monitor->szName.c_str(), 10);
|
||||
showText(m_monitor->m_name.c_str(), 10);
|
||||
|
||||
if (FPS > idealFPS * 0.95f)
|
||||
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 0.2f, 1.f, 0.2f, 1.f);
|
||||
@@ -199,7 +199,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) {
|
||||
cairo_get_current_point(cr, &posX, &posY);
|
||||
|
||||
g_pHyprRenderer->damageBox(m_lastDrawnBox);
|
||||
m_lastDrawnBox = {(int)g_pCompositor->m_monitors.front()->vecPosition.x + MARGIN_LEFT - 1, (int)g_pCompositor->m_monitors.front()->vecPosition.y + offset + MARGIN_TOP - 1,
|
||||
m_lastDrawnBox = {(int)g_pCompositor->m_monitors.front()->m_position.x + MARGIN_LEFT - 1, (int)g_pCompositor->m_monitors.front()->m_position.y + offset + MARGIN_TOP - 1,
|
||||
(int)maxTextW + 2, posY - offset - MARGIN_TOP + 2};
|
||||
g_pHyprRenderer->damageBox(m_lastDrawnBox);
|
||||
|
||||
@@ -238,7 +238,7 @@ void CHyprDebugOverlay::draw() {
|
||||
const auto PMONITOR = g_pCompositor->m_monitors.front();
|
||||
|
||||
if (!m_cairoSurface || !m_cairo) {
|
||||
m_cairoSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y);
|
||||
m_cairoSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y);
|
||||
m_cairo = cairo_create(m_cairoSurface);
|
||||
}
|
||||
|
||||
@@ -269,10 +269,10 @@ void CHyprDebugOverlay::draw() {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||
#endif
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||
|
||||
CTexPassElement::SRenderData data;
|
||||
data.tex = m_texture;
|
||||
data.box = {0, 0, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y};
|
||||
data.box = {0, 0, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y};
|
||||
g_pHyprRenderer->m_sRenderPass.add(makeShared<CTexPassElement>(data));
|
||||
}
|
||||
|
Reference in New Issue
Block a user