mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-20 22:43:47 -07:00
renderer: nuke lastFrameDamage and rework finalDamage
this fucking SUCKED
This commit is contained in:
@@ -431,16 +431,19 @@ void CScreencopyProtocolManager::sendFrameDamage(SScreencopyFrame* frame) {
|
||||
if (!frame->withDamage)
|
||||
return;
|
||||
|
||||
for (auto& RECT : frame->pMonitor->lastFrameDamage.getRects()) {
|
||||
// TODO:
|
||||
// add a damage ring for this.
|
||||
|
||||
if (frame->buffer->width < 1 || frame->buffer->height < 1 || frame->buffer->width - RECT.x1 < 1 || frame->buffer->height - RECT.y1 < 1) {
|
||||
Debug::log(ERR, "[sc] Failed to send damage");
|
||||
break;
|
||||
}
|
||||
// for (auto& RECT : frame->pMonitor->lastFrameDamage.getRects()) {
|
||||
|
||||
zwlr_screencopy_frame_v1_send_damage(frame->resource, std::clamp(RECT.x1, 0, frame->buffer->width), std::clamp(RECT.y1, 0, frame->buffer->height),
|
||||
std::clamp(RECT.x2 - RECT.x1, 0, frame->buffer->width - RECT.x1), std::clamp(RECT.y2 - RECT.y1, 0, frame->buffer->height - RECT.y1));
|
||||
}
|
||||
// if (frame->buffer->width < 1 || frame->buffer->height < 1 || frame->buffer->width - RECT.x1 < 1 || frame->buffer->height - RECT.y1 < 1) {
|
||||
// Debug::log(ERR, "[sc] Failed to send damage");
|
||||
// break;
|
||||
// }
|
||||
|
||||
// zwlr_screencopy_frame_v1_send_damage(frame->resource, std::clamp(RECT.x1, 0, frame->buffer->width), std::clamp(RECT.y1, 0, frame->buffer->height),
|
||||
// std::clamp(RECT.x2 - RECT.x1, 0, frame->buffer->width - RECT.x1), std::clamp(RECT.y2 - RECT.y1, 0, frame->buffer->height - RECT.y1));
|
||||
// }
|
||||
}
|
||||
|
||||
bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec* now) {
|
||||
@@ -531,8 +534,6 @@ bool CScreencopyProtocolManager::copyFrameDmabuf(SScreencopyFrame* frame) {
|
||||
g_pHyprOpenGL->renderTexture(sourceTex, &monbox, 1);
|
||||
g_pHyprOpenGL->setMonitorTransformEnabled(true);
|
||||
|
||||
frame->pMonitor->lastFrameDamage = fakeDamage;
|
||||
|
||||
g_pHyprRenderer->endRender();
|
||||
|
||||
wlr_texture_destroy(sourceTex);
|
||||
|
@@ -452,10 +452,6 @@ bool CToplevelExportProtocolManager::copyFrameDmabuf(SScreencopyFrame* frame, ti
|
||||
if (frame->overlayCursor)
|
||||
g_pHyprRenderer->renderSoftwareCursors(PMONITOR, fakeDamage, g_pInputManager->getMouseCoordsInternal() - frame->pWindow->m_vRealPosition.vec());
|
||||
|
||||
// introspection uses this as final damage.
|
||||
// TODO: dont. This fucking sucks.
|
||||
PMONITOR->lastFrameDamage = fakeDamage;
|
||||
|
||||
g_pHyprRenderer->endRender();
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user