Remove older QGLContext calls in favour of new QOpenGLContext.

Change-Id: I2669f48ebac5c14f5aaf85135f3d0adbf541d877
Reviewed-on: http://codereview.qt-project.org/5339
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
Michael Goddard
2011-09-22 12:28:40 +10:00
committed by Qt by Nokia
parent 9a3237d533
commit db79e08675
2 changed files with 5 additions and 2 deletions

View File

@@ -255,7 +255,7 @@ void QSGVideoNode_I420::setCurrentFrame(const QVideoFrame &frame)
void QSGVideoNode_I420::bindTexture(int id, int unit, int w, int h, const uchar *bits) void QSGVideoNode_I420::bindTexture(int id, int unit, int w, int h, const uchar *bits)
{ {
QGLFunctions *functions = QGLContext::currentContext()->functions(); QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions();
functions->glActiveTexture(unit); functions->glActiveTexture(unit);
glBindTexture(GL_TEXTURE_2D, id); glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, w, h, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, bits); glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, w, h, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, bits);

View File

@@ -42,6 +42,9 @@
#include <QtDeclarative/qsgtexture.h> #include <QtDeclarative/qsgtexture.h>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
QList<QVideoFrame::PixelFormat> QSGVideoNodeFactory_RGB32::supportedPixelFormats( QList<QVideoFrame::PixelFormat> QSGVideoNodeFactory_RGB32::supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const QAbstractVideoBuffer::HandleType handleType) const
{ {
@@ -101,7 +104,7 @@ void QSGVideoTexture_RGB32::bind()
} }
if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) {
QGLFunctions *functions = QGLContext::currentContext()->functions(); QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions();
const uchar *bits = m_frame.bits(); const uchar *bits = m_frame.bits();
functions->glActiveTexture(GL_TEXTURE0); functions->glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_textureId); glBindTexture(GL_TEXTURE_2D, m_textureId);