diff --git a/src/blur.cpp b/src/blur.cpp index 72f435167..54139b519 100644 --- a/src/blur.cpp +++ b/src/blur.cpp @@ -109,7 +109,6 @@ BlurEffect::BlurEffect() m_texture.textureSizeLocation = m_texture.shader->uniformLocation("textureSize"); m_texture.texStartPosLocation = m_texture.shader->uniformLocation("texStartPos"); m_texture.blurSizeLocation = m_texture.shader->uniformLocation("blurSize"); - m_texture.scaleLocation = m_texture.shader->uniformLocation("scale"); m_texture.topCornerRadiusLocation = m_texture.shader->uniformLocation("topCornerRadius"); m_texture.bottomCornerRadiusLocation = m_texture.shader->uniformLocation("bottomCornerRadius"); m_texture.antialiasingLocation = m_texture.shader->uniformLocation("antialiasing"); @@ -958,9 +957,8 @@ void BlurEffect::blur(BlurRenderData &renderInfo, const RenderTarget &renderTarg m_texture.shader->setUniform(m_texture.mvpMatrixLocation, projectionMatrix); m_texture.shader->setUniform(m_texture.textureSizeLocation, QVector2D(fakeBlurTexture->size().width(), fakeBlurTexture->size().height())); - m_texture.shader->setUniform(m_texture.texStartPosLocation, QVector2D(backgroundRect.x() - screenGeometry.x(), backgroundRect.y() - screenGeometry.y())); - m_texture.shader->setUniform(m_texture.blurSizeLocation, QVector2D(backgroundRect.width(), backgroundRect.height())); - m_texture.shader->setUniform(m_texture.scaleLocation, (float)viewport.scale()); + m_texture.shader->setUniform(m_texture.texStartPosLocation, QVector2D(deviceBackgroundRect.x() - screenGeometry.x(), deviceBackgroundRect.y() - screenGeometry.y())); + m_texture.shader->setUniform(m_texture.blurSizeLocation, QVector2D(deviceBackgroundRect.width(), deviceBackgroundRect.height())); m_texture.shader->setUniform(m_texture.topCornerRadiusLocation, topCornerRadius); m_texture.shader->setUniform(m_texture.bottomCornerRadiusLocation, bottomCornerRadius); m_texture.shader->setUniform(m_texture.antialiasingLocation, m_settings.roundedCorners.antialiasing); @@ -1050,7 +1048,7 @@ void BlurEffect::blur(BlurRenderData &renderInfo, const RenderTarget &renderTarg m_upsamplePass.shader->setUniform(m_upsamplePass.topCornerRadiusLocation, topCornerRadius); m_upsamplePass.shader->setUniform(m_upsamplePass.bottomCornerRadiusLocation, bottomCornerRadius); m_upsamplePass.shader->setUniform(m_upsamplePass.antialiasingLocation, m_settings.roundedCorners.antialiasing); - m_upsamplePass.shader->setUniform(m_upsamplePass.blurSizeLocation, QVector2D(backgroundRect.width(), backgroundRect.height())); + m_upsamplePass.shader->setUniform(m_upsamplePass.blurSizeLocation, QVector2D(deviceBackgroundRect.width(), deviceBackgroundRect.height())); m_upsamplePass.shader->setUniform(m_upsamplePass.opacityLocation, static_cast(opacity)); projectionMatrix = viewport.projectionMatrix(); diff --git a/src/blur.h b/src/blur.h index d783edf85..e4ba1ee0d 100644 --- a/src/blur.h +++ b/src/blur.h @@ -168,7 +168,6 @@ public Q_SLOTS: int mvpMatrixLocation; int textureSizeLocation; int texStartPosLocation; - int scaleLocation; int topCornerRadiusLocation; int bottomCornerRadiusLocation; diff --git a/src/shaders/texture.glsl b/src/shaders/texture.glsl index 706cc8480..d15c19a08 100644 --- a/src/shaders/texture.glsl +++ b/src/shaders/texture.glsl @@ -3,12 +3,11 @@ uniform sampler2D texUnit; uniform vec2 textureSize; uniform vec2 texStartPos; -uniform float scale; varying vec2 uv; void main(void) { - vec2 tex = (texStartPos.xy + vec2(uv.x, 1.0 - uv.y) * blurSize) / textureSize * scale; + vec2 tex = (texStartPos.xy + vec2(uv.x, 1.0 - uv.y) * blurSize) / textureSize; gl_FragColor = roundedRectangle(uv * blurSize, texture2D(texUnit, tex).rgb); } \ No newline at end of file diff --git a/src/shaders/texture_core.glsl b/src/shaders/texture_core.glsl index 9a126bae3..d2828d61e 100644 --- a/src/shaders/texture_core.glsl +++ b/src/shaders/texture_core.glsl @@ -5,7 +5,6 @@ uniform sampler2D texUnit; uniform vec2 textureSize; uniform vec2 texStartPos; -uniform float scale; in vec2 uv; @@ -13,6 +12,6 @@ out vec4 fragColor; void main(void) { - vec2 tex = (texStartPos.xy + vec2(uv.x, 1.0 - uv.y) * blurSize) / textureSize * scale; + vec2 tex = (texStartPos.xy + vec2(uv.x, 1.0 - uv.y) * blurSize) / textureSize; fragColor = roundedRectangle(uv * blurSize, texture(texUnit, tex).rgb); }