2024-12-22 17:12:09 +01:00
|
|
|
#include "TexPassElement.hpp"
|
|
|
|
|
#include "../OpenGL.hpp"
|
|
|
|
|
|
|
|
|
|
#include <hyprutils/utils/ScopeGuard.hpp>
|
|
|
|
|
using namespace Hyprutils::Utils;
|
|
|
|
|
|
|
|
|
|
CTexPassElement::CTexPassElement(const CTexPassElement::SRenderData& data_) : data(data_) {
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CTexPassElement::draw(const CRegion& damage) {
|
|
|
|
|
g_pHyprOpenGL->m_bEndFrame = data.flipEndFrame;
|
|
|
|
|
|
|
|
|
|
CScopeGuard x = {[]() {
|
|
|
|
|
//
|
2025-01-31 13:32:36 +00:00
|
|
|
g_pHyprOpenGL->m_bEndFrame = false;
|
|
|
|
|
g_pHyprOpenGL->m_RenderData.clipBox = {};
|
2024-12-22 17:12:09 +01:00
|
|
|
}};
|
|
|
|
|
|
2025-01-31 13:32:36 +00:00
|
|
|
if (!data.clipBox.empty())
|
|
|
|
|
g_pHyprOpenGL->m_RenderData.clipBox = data.clipBox;
|
|
|
|
|
|
2024-12-22 17:12:09 +01:00
|
|
|
if (data.replaceProjection)
|
|
|
|
|
g_pHyprOpenGL->m_RenderData.monitorProjection = *data.replaceProjection;
|
2025-01-26 15:05:34 +00:00
|
|
|
g_pHyprOpenGL->renderTextureInternalWithDamage(data.tex, data.box, data.a, data.damage.empty() ? damage : data.damage, data.round, data.roundingPower, data.syncTimeline,
|
2025-01-05 12:38:49 -06:00
|
|
|
data.syncPoint);
|
2024-12-22 17:12:09 +01:00
|
|
|
if (data.replaceProjection)
|
|
|
|
|
g_pHyprOpenGL->m_RenderData.monitorProjection = g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CTexPassElement::needsLiveBlur() {
|
|
|
|
|
return false; // TODO?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CTexPassElement::needsPrecomputeBlur() {
|
|
|
|
|
return false; // TODO?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::optional<CBox> CTexPassElement::boundingBox() {
|
|
|
|
|
return data.box.copy().scale(1.F / g_pHyprOpenGL->m_RenderData.pMonitor->scale).round();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CRegion CTexPassElement::opaqueRegion() {
|
|
|
|
|
return {}; // TODO:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CTexPassElement::discard() {
|
|
|
|
|
;
|
|
|
|
|
}
|