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
This commit is contained in:
parent
ebebc6ca82
commit
61bb907bb4
1 changed files with 6 additions and 1 deletions
|
@ -1452,12 +1452,17 @@ static void renderSubSurface(GLShader *shader, const QMatrix4x4 &mvp, const QMat
|
||||||
QMatrix4x4 newWindowMatrix = windowMatrix;
|
QMatrix4x4 newWindowMatrix = windowMatrix;
|
||||||
newWindowMatrix.translate(pixmap->subSurface()->position().x(), pixmap->subSurface()->position().y());
|
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()) {
|
if (!pixmap->texture()->isNull()) {
|
||||||
// render this texture
|
// render this texture
|
||||||
shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp * newWindowMatrix);
|
shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp * newWindowMatrix);
|
||||||
auto texture = pixmap->texture();
|
auto texture = pixmap->texture();
|
||||||
texture->bind();
|
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();
|
texture->unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue