plugins/screenshot: Round texture size

To prevent window screenshot blurring with fractional scaling
This commit is contained in:
Volodymyr Zolotopupov 2024-03-24 22:12:28 +02:00 committed by Vlad Zahorodnii
parent 1ca7524853
commit f4232bc391

View file

@ -243,11 +243,12 @@ void ScreenShotEffect::takeScreenShot(ScreenShotWindowData *screenshot)
}
}
const QRect scaledGeometry = snapToPixelGrid(scaledRect(geometry, devicePixelRatio));
bool validTarget = true;
std::unique_ptr<GLTexture> offscreenTexture;
std::unique_ptr<GLFramebuffer> target;
if (effects->isOpenGLCompositing()) {
offscreenTexture = GLTexture::allocate(GL_RGBA8, QSizeF(geometry.size() * devicePixelRatio).toSize());
offscreenTexture = GLTexture::allocate(GL_RGBA8, scaledGeometry.size());
if (!offscreenTexture) {
return;
}