diff --git a/src/platform/opengl/gles2.c b/src/platform/opengl/gles2.c index d51dd568f..465820528 100644 --- a/src/platform/opengl/gles2.c +++ b/src/platform/opengl/gles2.c @@ -192,14 +192,13 @@ static void mGLES2ContextResized(struct VideoBackend* v, unsigned w, unsigned h) 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); } diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 2405cbe07..0df112e06 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -321,8 +321,6 @@ void PainterGL::setMessagePainter(MessagePainter* messagePainter) { 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::unpause() { 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) {