diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-06-15 11:51:27 +0200 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-06-15 11:51:27 +0200 |
| commit | 57d20a1bf67676dc63347e4f1df2e4b66133733f (patch) | |
| tree | c4501a5de1e3017c7e9a0e01272b5afee24ada4d /src/render/Renderer.cpp | |
| parent | 472b52bc067c4d786c892df85672e6cefe44a7f2 (diff) | |
internal: clean up dead snapshot code
Diffstat (limited to 'src/render/Renderer.cpp')
| -rw-r--r-- | src/render/Renderer.cpp | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 67832df1..ecc46a36 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -2381,51 +2381,7 @@ void CHyprRenderer::addWindowToRenderUnfocused(PHLWINDOW window) { m_renderUnfocusedTimer->updateTimeout(std::chrono::milliseconds(1000 / *PFPS)); } -void CHyprRenderer::makeRawWindowSnapshot(PHLWINDOW pWindow, CFramebuffer* pFramebuffer) { - // we trust the window is valid. - const auto PMONITOR = pWindow->m_monitor.lock(); - - if (!PMONITOR || !PMONITOR->m_output || PMONITOR->m_pixelSize.x <= 0 || PMONITOR->m_pixelSize.y <= 0) - return; - - // we need to "damage" the entire monitor - // so that we render the entire window - // this is temporary, doesnt mess with the actual damage - CRegion fakeDamage{0, 0, (int)PMONITOR->m_transformedSize.x, (int)PMONITOR->m_transformedSize.y}; - - makeEGLCurrent(); - - pFramebuffer->alloc(PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, DRM_FORMAT_ABGR8888); - pFramebuffer->addStencil(g_pHyprOpenGL->m_renderData.pCurrentMonData->stencilTex); - - beginRender(PMONITOR, fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, pFramebuffer); - - g_pHyprOpenGL->clear(CHyprColor(0, 0, 0, 0)); // JIC - - // this is a hack but it works :P - // we need to disable blur or else we will get a black background, as the shader - // will try to copy the bg to apply blur. - // this isn't entirely correct, but like, oh well. - // small todo: maybe make this correct? :P - static auto* const PBLUR = (Hyprlang::INT* const*)(g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")); - const auto BLURVAL = **PBLUR; - **PBLUR = 0; - - // TODO: how can we make this the size of the window? setting it to window's size makes the entire screen render with the wrong res forever more. odd. - glViewport(0, 0, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y); - - g_pHyprOpenGL->m_renderData.currentFB = pFramebuffer; - - g_pHyprOpenGL->clear(CHyprColor(0, 0, 0, 0)); // JIC - - renderWindow(pWindow, PMONITOR, Time::steadyNow(), false, RENDER_PASS_ALL, true); - - **PBLUR = BLURVAL; - - endRender(); -} - -void CHyprRenderer::makeWindowSnapshot(PHLWINDOW pWindow) { +void CHyprRenderer::makeSnapshot(PHLWINDOW pWindow) { // we trust the window is valid. const auto PMONITOR = pWindow->m_monitor.lock(); @@ -2461,7 +2417,7 @@ void CHyprRenderer::makeWindowSnapshot(PHLWINDOW pWindow) { m_bRenderingSnapshot = false; } -void CHyprRenderer::makeLayerSnapshot(PHLLS pLayer) { +void CHyprRenderer::makeSnapshot(PHLLS pLayer) { // we trust the window is valid. const auto PMONITOR = pLayer->m_monitor.lock(); |
