OpenGL: Fix frame sizing regression

This commit is contained in:
Vicki Pfau 2019-05-15 10:16:06 -07:00
parent 06cc738b00
commit 99d07c98c5
2 changed files with 4 additions and 5 deletions

View File

@ -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);
}

View File

@ -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) {