From kde-commits Mon Apr 30 16:02:35 2018 From: Alex Nemeth Date: Mon, 30 Apr 2018 16:02:35 +0000 To: kde-commits Subject: [kwin] effects/blur: Fix blur noise effect using incorrect scaling value Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=152510416820718 Git commit 16a0e241156716c2a97cc231311ba1f4d403127b by Alex Nemeth. Committed on 30/04/2018 at 16:02. Pushed by anemeth into branch 'master'. Fix blur noise effect using incorrect scaling value Summary: `QGuiApplication::primaryScreen()->logicalDotsPerInch()` sometimes reports = incorrect scale value, for example 95.951 (or even lower) instead of 96.0 a= t 1x scale and this caused to simply darken blurred areas instead of noisin= g them. This patch sets a minimum 1x scale for the noise texture, because realistic= ally we will never be below that. Reviewers: davidedmundson Reviewed By: davidedmundson Subscribers: davidedmundson, kwin, #kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D12519 M +1 -1 effects/blur/blur.cpp https://commits.kde.org/kwin/16a0e241156716c2a97cc231311ba1f4d403127b diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 728d5691c..02ba94638 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -236,7 +236,7 @@ void BlurEffect::reconfigure(ReconfigureFlags flags) m_expandSize =3D blurOffsets[m_downSampleIterations - 1].expandSize; m_noiseStrength =3D BlurConfig::noiseStrength(); = - m_scalingFactor =3D QGuiApplication::primaryScreen()->logicalDotsPerIn= ch() / 96.0; + m_scalingFactor =3D qMax(1.0, QGuiApplication::primaryScreen()->logica= lDotsPerInch() / 96.0); = updateTexture(); =20