[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kwin] effects/blur: Fix blur noise effect using incorrect scaling value
From:       Alex Nemeth <null () kde ! org>
Date:       2018-04-30 16:02:35
Message-ID: E1fDBG7-0004Qb-7y () code ! kde ! org
[Download RAW message or body]

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 at 1x scale and this \
caused to simply darken blurred areas instead of noising them. This patch sets a \
minimum 1x scale for the noise texture, because realistically 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 = blurOffsets[m_downSampleIterations - 1].expandSize;
     m_noiseStrength = BlurConfig::noiseStrength();
 
-    m_scalingFactor = QGuiApplication::primaryScreen()->logicalDotsPerInch() / 96.0;
+    m_scalingFactor = qMax(1.0, \
QGuiApplication::primaryScreen()->logicalDotsPerInch() / 96.0);  
     updateTexture();
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic