Avoid setting unnecessary parameters in QOpenGLWidget
QOpenGLFramebufferObject sets the texture parameters already, do not set them again. Especially not GL_REPEAT, which is wrong and breaks on devices that do not support REPEAT on NPOT textures. What QOpenGLFramebufferObject does is just fine (it sets NEAREST/ NEAREST and CLAMP_TO_EDGE). This is important for WebEngine where the QWidget-based web view is using QOpenGLWidget. Change-Id: I264d30118ce7adf50f68f2c7b9a5599a406b4362 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>bb10
parent
e26ed09102
commit
72558e810d
|
|
@ -170,12 +170,6 @@ void QOpenGLWidget::resizeEvent(QResizeEvent *)
|
|||
d->fbo = new QOpenGLFramebufferObject(size() * devicePixelRatio(), QOpenGLFramebufferObject::CombinedDepthStencil);
|
||||
d->fbo->bind();
|
||||
QOpenGLFunctions *funcs = d->context.functions();
|
||||
funcs->glBindTexture(GL_TEXTURE_2D, d->fbo->texture());
|
||||
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
resizeGL(width(), height());
|
||||
paintGL();
|
||||
funcs->glFlush();
|
||||
|
|
|
|||
Loading…
Reference in New Issue