Commit 76fbb437 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

Reduce repeated Screens::scale(int)

parent 75321a21
...@@ -627,14 +627,15 @@ qint64 SceneOpenGL::paint(const QRegion &damage, const QList<Toplevel *> &toplev ...@@ -627,14 +627,15 @@ qint64 SceneOpenGL::paint(const QRegion &damage, const QList<Toplevel *> &toplev
m_backend->prepareRenderingFrame(); m_backend->prepareRenderingFrame();
for (int i = 0; i < screens()->count(); ++i) { for (int i = 0; i < screens()->count(); ++i) {
const QRect &geo = screens()->geometry(i); const QRect &geo = screens()->geometry(i);
const qreal scaling = screens()->scale(i);
QRegion update; QRegion update;
QRegion valid; QRegion valid;
// prepare rendering makes context current on the output // prepare rendering makes context current on the output
QRegion repaint = m_backend->prepareRenderingForScreen(i); QRegion repaint = m_backend->prepareRenderingForScreen(i);
GLVertexBuffer::setVirtualScreenGeometry(geo); GLVertexBuffer::setVirtualScreenGeometry(geo);
GLRenderTarget::setVirtualScreenGeometry(geo); GLRenderTarget::setVirtualScreenGeometry(geo);
GLVertexBuffer::setVirtualScreenScale(screens()->scale(i)); GLVertexBuffer::setVirtualScreenScale(scaling);
GLRenderTarget::setVirtualScreenScale(screens()->scale(i)); GLRenderTarget::setVirtualScreenScale(scaling);
const GLenum status = glGetGraphicsResetStatus(); const GLenum status = glGetGraphicsResetStatus();
if (status != GL_NO_ERROR) { if (status != GL_NO_ERROR) {
...@@ -644,7 +645,8 @@ qint64 SceneOpenGL::paint(const QRegion &damage, const QList<Toplevel *> &toplev ...@@ -644,7 +645,8 @@ qint64 SceneOpenGL::paint(const QRegion &damage, const QList<Toplevel *> &toplev
int mask = 0; int mask = 0;
updateProjectionMatrix(); updateProjectionMatrix();
paintScreen(&mask, damage.intersected(geo), repaint, &update, &valid, projectionMatrix(), geo, screens()->scale(i)); // call generic implementation
paintScreen(&mask, damage.intersected(geo), repaint, &update, &valid, projectionMatrix(), geo, scaling); // call generic implementation
paintCursor(); paintCursor();
GLVertexBuffer::streamingBuffer()->endOfFrame(); GLVertexBuffer::streamingBuffer()->endOfFrame();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment