Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/egl_gbm_backend.cpp
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Line(s) | 175 | if (eglSurface == EGL_NO_SURFACE) { | |||
---|---|---|---|---|---|
177 | return EGL_NO_SURFACE; | 177 | return EGL_NO_SURFACE; | ||
178 | } | 178 | } | ||
179 | return eglSurface; | 179 | return eglSurface; | ||
180 | } | 180 | } | ||
181 | 181 | | |||
182 | bool EglGbmBackend::resetOutput(Output &output, DrmOutput *drmOutput) | 182 | bool EglGbmBackend::resetOutput(Output &output, DrmOutput *drmOutput) | ||
183 | { | 183 | { | ||
184 | output.output = drmOutput; | 184 | output.output = drmOutput; | ||
185 | const QSize size = drmOutput->pixelSize(); | 185 | const QSize size = drmOutput->viewGeometry().size(); | ||
186 | 186 | | |||
187 | auto gbmSurface = createGbmSurface(size); | 187 | auto gbmSurface = createGbmSurface(size); | ||
188 | if (!gbmSurface) { | 188 | if (!gbmSurface) { | ||
189 | return false; | 189 | return false; | ||
190 | } | 190 | } | ||
191 | auto eglSurface = createEglSurface(gbmSurface); | 191 | auto eglSurface = createEglSurface(gbmSurface); | ||
192 | if (eglSurface == EGL_NO_SURFACE) { | 192 | if (eglSurface == EGL_NO_SURFACE) { | ||
193 | return false; | 193 | return false; | ||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | |||||
354 | { | 354 | { | ||
355 | startRenderTimer(); | 355 | startRenderTimer(); | ||
356 | return QRegion(); | 356 | return QRegion(); | ||
357 | } | 357 | } | ||
358 | 358 | | |||
359 | void EglGbmBackend::setViewport(const Output &output) const | 359 | void EglGbmBackend::setViewport(const Output &output) const | ||
360 | { | 360 | { | ||
361 | const QSize &overall = screens()->size(); | 361 | const QSize &overall = screens()->size(); | ||
362 | const QRect &v = output.output->geometry(); | 362 | const QRect &geo = output.output->geometry(); | ||
363 | const QRect &view = output.output->viewGeometry(); | ||||
363 | qreal scale = output.output->scale(); | 364 | qreal scale = output.output->scale(); | ||
364 | 365 | | |||
365 | glViewport(-v.x() * scale, (v.height() - overall.height() + v.y()) * scale, | 366 | glViewport(-geo.x() * scale, | ||
davidedmundson: By passing just a logical size, the scale value is effectively broken, which is a problem as we… | |||||
romangg: Yes, I forgot to replace the scale usage here two times. | |||||
366 | overall.width() * scale, overall.height() * scale); | 367 | (geo.height() - overall.height() + geo.y()) * scale, | ||
368 | overall.width() * view.width() / (double)geo.width(), | ||||
369 | overall.height() * view.height() / (double)geo.height() | ||||
370 | ); | ||||
367 | } | 371 | } | ||
368 | 372 | | |||
369 | QRegion EglGbmBackend::prepareRenderingForScreen(int screenId) | 373 | QRegion EglGbmBackend::prepareRenderingForScreen(int screenId) | ||
370 | { | 374 | { | ||
371 | const Output &output = m_outputs.at(screenId); | 375 | const Output &output = m_outputs.at(screenId); | ||
372 | 376 | | |||
373 | makeContextCurrent(output); | 377 | makeContextCurrent(output); | ||
374 | setViewport(output); | 378 | setViewport(output); | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |
By passing just a logical size, the scale value is effectively broken, which is a problem as we rely on it here.