Fixed auto-test failure in tst_QOpenGL.

QOpenGLFramebufferObject::height() was returning the width...

Change-Id: I521c2df02e00015998dc31a74481113af26e1ba6
Reviewed-on: http://codereview.qt-project.org/4663
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
This commit is contained in:
Samuel Rødal 2011-09-12 13:00:30 +02:00 committed by Gunnar Sletta
parent 2ce969d7f0
commit 17511e199f
2 changed files with 8 additions and 9 deletions

View File

@ -93,7 +93,7 @@ public:
bool release(); bool release();
int width() const { return size().width(); } int width() const { return size().width(); }
int height() const { return size().width(); } int height() const { return size().height(); }
GLuint texture() const; GLuint texture() const;
QSize size() const; QSize size() const;

View File

@ -338,24 +338,23 @@ void tst_QOpenGL::fboRendering()
fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
// Uncomplicate things by using NPOT: // Uncomplicate things by using NPOT:
QOpenGLFramebufferObject *fbo = new QOpenGLFramebufferObject(256, 128, fboFormat); QOpenGLFramebufferObject fbo(256, 128, fboFormat);
if (fbo->attachment() != QOpenGLFramebufferObject::CombinedDepthStencil) { if (fbo.attachment() != QOpenGLFramebufferObject::CombinedDepthStencil)
delete fbo;
QSKIP("FBOs missing combined depth~stencil support", SkipSingle); QSKIP("FBOs missing combined depth~stencil support", SkipSingle);
}
fbo.bind();
QPainter fboPainter; QPainter fboPainter;
QOpenGLPaintDevice device(fbo->width(), fbo->height()); QOpenGLPaintDevice device(fbo.width(), fbo.height());
bool painterBegun = fboPainter.begin(&device); bool painterBegun = fboPainter.begin(&device);
QVERIFY(painterBegun); QVERIFY(painterBegun);
qt_opengl_draw_test_pattern(&fboPainter, fbo->width(), fbo->height()); qt_opengl_draw_test_pattern(&fboPainter, fbo.width(), fbo.height());
fboPainter.end(); fboPainter.end();
QImage fb = fbo->toImage().convertToFormat(QImage::Format_RGB32); QImage fb = fbo.toImage().convertToFormat(QImage::Format_RGB32);
delete fbo;
qt_opengl_check_test_pattern(fb); qt_opengl_check_test_pattern(fb);
} }