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
m_backend->prepareRenderingFrame();
for (int i = 0; i < screens()->count(); ++i) {
const QRect &geo = screens()->geometry(i);
const qreal scaling = screens()->scale(i);
QRegion update;
QRegion valid;
// prepare rendering makes context current on the output
QRegion repaint = m_backend->prepareRenderingForScreen(i);
GLVertexBuffer::setVirtualScreenGeometry(geo);
GLRenderTarget::setVirtualScreenGeometry(geo);
GLVertexBuffer::setVirtualScreenScale(screens()->scale(i));
GLRenderTarget::setVirtualScreenScale(screens()->scale(i));
GLVertexBuffer::setVirtualScreenScale(scaling);
GLRenderTarget::setVirtualScreenScale(scaling);
const GLenum status = glGetGraphicsResetStatus();
if (status != GL_NO_ERROR) {
......@@ -644,7 +645,8 @@ qint64 SceneOpenGL::paint(const QRegion &damage, const QList<Toplevel *> &toplev
int mask = 0;
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();
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