aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2016-11-23 16:19:13 +0000
committerDavid Edmundson <[email protected]>2017-03-29 20:53:22 +0100
commit61bb907bb4bb8953c422f5311f9cd4d2f4e3967c (patch)
tree6619d07e812728af44aedffc85adbabbe61632b2
parentebebc6ca82b16fb28723742dd2fdc1b4f7c499cf (diff)
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
-rw-r--r--scene_opengl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene_opengl.cpp b/scene_opengl.cpp
index 3003e62..8ebebae 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();
}