OpenGL: Fix frame sizing regression
Vicki Pfau vi@endrift.com
Wed, 15 May 2019 10:16:06 -0700
2 files changed,
4 insertions(+),
5 deletions(-)
M
src/platform/opengl/gles2.c
→
src/platform/opengl/gles2.c
@@ -192,14 +192,13 @@ if (v->lockIntegerScaling) {
drawW -= drawW % v->width; drawH -= drawH % v->height; } - glViewport(0, 0, w, h); - glClearColor(0.f, 0.f, 0.f, 1.f); - glClear(GL_COLOR_BUFFER_BIT); + glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport((w - drawW) / 2, (h - drawH) / 2, drawW, drawH); } static void mGLES2ContextClear(struct VideoBackend* v) { UNUSED(v); + glBindFramebuffer(GL_FRAMEBUFFER, 0); glClearColor(0.f, 0.f, 0.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); }
M
src/platform/qt/DisplayGL.cpp
→
src/platform/qt/DisplayGL.cpp
@@ -321,8 +321,6 @@ }
void PainterGL::resize(const QSize& size) { m_size = size; - float r = m_surface->devicePixelRatio(); - m_backend->resized(m_backend, m_size.width() * r, m_size.height() * r); if (m_started && !m_active) { forceDraw(); }@@ -419,6 +417,8 @@ }
void PainterGL::performDraw() { m_painter.beginNativePainting(); + float r = m_surface->devicePixelRatio(); + m_backend->resized(m_backend, m_size.width() * r, m_size.height() * r); m_backend->drawFrame(m_backend); m_painter.endNativePainting(); if (m_messagePainter) {