renderer: disable anti-aliasing on cursor:zoom_factor (#6135) (#11828)

use nearest-neighbor filtering for cursor scaling to avoid blurriness
This commit is contained in:
João V. Farias 2025-09-25 16:14:04 -03:00 committed by GitHub
parent 5212099b9f
commit 7ce451d20c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1760,6 +1760,16 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP<CTexture> tex, const CBox& box)
glActiveTexture(GL_TEXTURE0);
tex->bind();
// ensure the final blit uses the desired sampling filter
// when cursor zoom is active we want nearest-neighbor (no anti-aliasing)
if (m_renderData.useNearestNeighbor) {
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST);
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST);
} else {
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR);
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
useProgram(shader->program);
shader->setUniformMatrix3fv(SHADER_PROJ, 1, GL_TRUE, glMatrix.getMatrix());
shader->setUniformInt(SHADER_TEX, 0);