summaryrefslogtreecommitdiff
path: root/src/protocols/Screencopy.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-23 01:02:32 +0000
committerVaxry <vaxry@vaxry.net>2024-02-23 01:02:32 +0000
commit8c3613632a6ccebf9fb797ec756ecfce99514eec (patch)
tree6c788a5b79f0dda977b81fddc473b53ff3271b99 /src/protocols/Screencopy.cpp
parentc1ef361e02e4c4a52fbc5dbd9e67b79e0afab4f3 (diff)
renderer: nuke lastFrameDamage and rework finalDamage
this fucking SUCKED
Diffstat (limited to 'src/protocols/Screencopy.cpp')
-rw-r--r--src/protocols/Screencopy.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp
index 6f0bca14..6dc787fb 100644
--- a/src/protocols/Screencopy.cpp
+++ b/src/protocols/Screencopy.cpp
@@ -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);