summaryrefslogtreecommitdiff
path: root/src/render/pass/SurfacePassElement.cpp
diff options
context:
space:
mode:
authorPollux <pollux@pollux.codes>2025-01-05 12:38:49 -0600
committerGitHub <noreply@github.com>2025-01-05 18:38:49 +0000
commita5c14370c11287cbf520c8f427179c665ac9c891 (patch)
tree72926e2db1259ab654b98d8d0d32374113fd6522 /src/render/pass/SurfacePassElement.cpp
parentb0bae15499ad57bbfeae8be958df8c022201e583 (diff)
renderer: Add supercircular window corners (#8943)
renderer: Add supercircular shadows and borders config: Add rounding_power to default and example configs rule: add `roundingpower` window rule
Diffstat (limited to 'src/render/pass/SurfacePassElement.cpp')
-rw-r--r--src/render/pass/SurfacePassElement.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/render/pass/SurfacePassElement.cpp b/src/render/pass/SurfacePassElement.cpp
index bdb21338..13e9e741 100644
--- a/src/render/pass/SurfacePassElement.cpp
+++ b/src/render/pass/SurfacePassElement.cpp
@@ -88,12 +88,15 @@ void CSurfacePassElement::draw(const CRegion& damage) {
if (MISALIGNEDFSV1)
g_pHyprOpenGL->m_RenderData.useNearestNeighbor = true;
- float rounding = data.rounding;
+ float rounding = data.rounding;
+ float roundingPower = data.roundingPower;
rounding -= 1; // to fix a border issue
- if (data.dontRound)
- rounding = 0;
+ if (data.dontRound) {
+ rounding = 0;
+ roundingPower = 2.0f;
+ }
const bool WINDOWOPAQUE = data.pWindow && data.pWindow->m_pWLSurface->resource() == data.surface ? data.pWindow->opaque() : false;
const bool CANDISABLEBLEND = ALPHA >= 1.f && OVERALL_ALPHA >= 1.f && rounding == 0 && WINDOWOPAQUE;
@@ -108,14 +111,14 @@ void CSurfacePassElement::draw(const CRegion& damage) {
// to what we do for misaligned surfaces (blur the entire thing and then render shit without blur)
if (data.surfaceCounter == 0 && !data.popup) {
if (BLUR)
- g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, ALPHA, data.surface, rounding, data.blockBlurOptimization, data.fadeAlpha, OVERALL_ALPHA);
+ g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, ALPHA, data.surface, rounding, roundingPower, data.blockBlurOptimization, data.fadeAlpha, OVERALL_ALPHA);
else
- g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, ALPHA * OVERALL_ALPHA, rounding, false, true);
+ g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
} else {
if (BLUR && data.popup)
- g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, ALPHA, data.surface, rounding, true, data.fadeAlpha, OVERALL_ALPHA);
+ g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, ALPHA, data.surface, rounding, roundingPower, true, data.fadeAlpha, OVERALL_ALPHA);
else
- g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, ALPHA * OVERALL_ALPHA, rounding, false, true);
+ g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
}
if (!g_pHyprRenderer->m_bBlockSurfaceFeedback)