From 61bb907bb4bb8953c422f5311f9cd4d2f4e3967c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 23 Nov 2016 16:19:13 +0000 Subject: [PATCH] Scale openGL sub surfaces Test Plan: Opened a module in system settings that uses QtQuick, confirmed it's the right size Reviewers: #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3503 --- scene_opengl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 3003e62dd8..8ebebae451 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1452,12 +1452,17 @@ static void renderSubSurface(GLShader *shader, const QMatrix4x4 &mvp, const QMat QMatrix4x4 newWindowMatrix = windowMatrix; newWindowMatrix.translate(pixmap->subSurface()->position().x(), pixmap->subSurface()->position().y()); + qreal scale = 1.0; + if (pixmap->surface()) { + scale = pixmap->surface()->scale(); + } + if (!pixmap->texture()->isNull()) { // render this texture shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp * newWindowMatrix); auto texture = pixmap->texture(); texture->bind(); - texture->render(QRegion(), QRect(0, 0, texture->width(), texture->height())); + texture->render(QRegion(), QRect(0, 0, texture->width() / scale, texture->height() / scale)); texture->unbind(); }