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

List:       kde-commits
Subject:    [kwin/scaling_merged] /: Scale openGL sub surfaces
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2016-11-24 20:48:40
Message-ID: E1cA0wi-0000TY-EW () code ! kde ! org
[Download RAW message or body]

Git commit 1f0efc2e68b19fc44e9ed39ad6827bcea2bb46c4 by David Edmundson.
Committed on 23/11/2016 at 17:15.
Pushed by davidedmundson into branch 'scaling_merged'.

Scale openGL sub surfaces

M  +6    -1    scene_opengl.cpp

https://commits.kde.org/kwin/1f0efc2e68b19fc44e9ed39ad6827bcea2bb46c4

diff --git a/scene_opengl.cpp b/scene_opengl.cpp
index f52da34..84d794a 100644
--- a/scene_opengl.cpp
+++ b/scene_opengl.cpp
@@ -1498,12 +1498,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();
     }
 


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

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