diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-15 06:18:27 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-15 06:18:27 (GMT) |
commit | 4c472f1694aa9f35eda248f04decadbe0ef2dd75 (patch) | |
tree | 3480002bde8c6059272fb4d61829e0e3b8f2f504 /src/opengl/qgl.cpp | |
parent | 6ce4e6247fa6e438a34a498cd803a5542ff338b7 (diff) | |
parent | d20bf43e3f7b3d39fddd28eee5a5594de6930873 (diff) | |
download | Qt-4c472f1694aa9f35eda248f04decadbe0ef2dd75.zip Qt-4c472f1694aa9f35eda248f04decadbe0ef2dd75.tar.gz Qt-4c472f1694aa9f35eda248f04decadbe0ef2dd75.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix compilation of ShivaVG, which does not have EGL.
Move nativePaintingActive flag to GL2 engine's private
More adjustments to QTBUG-6800
Adjustments to QTBUG-6800 patch.
QTBUG-6800 patch included, but only for OpenGL 2.0
Support building with desktop OpenGL managed via EGL
Print more information when debugging X11 Visual selection
Fix gcc compile warning in qstatictext.cpp
Avoid taking sqrt of negative number in FT font engine
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 5595e02..394bcbc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -49,7 +49,7 @@ #include "private/qpixmap_x11_p.h" #define INT32 dummy_INT32 #define INT8 dummy_INT8 -#if !defined(QT_OPENGL_ES) +#ifdef QT_NO_EGL # include <GL/glx.h> #endif #undef INT32 @@ -1582,7 +1582,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format) # endif vi = 0; #endif -#if defined(QT_OPENGL_ES) +#ifndef QT_NO_EGL ownsEglContext = false; eglContext = 0; eglSurface = EGL_NO_SURFACE; @@ -2767,6 +2767,18 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text return; } #else + + if (d_ptr->active_engine && + d_ptr->active_engine->type() == QPaintEngine::OpenGL2) { + QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine); + if (!eng->isNativePaintingActive()) { + QRectF src(0, 0, target.width(), target.height()); + QSize size(target.width(), target.height()); + eng->drawTexture(target, textureId, size, src); + return; + } + } + const bool wasEnabled = glIsEnabled(GL_TEXTURE_2D); GLint oldTexture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldTexture); @@ -2817,6 +2829,7 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text Q_UNUSED(textureTarget); qWarning("drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget) not supported with OpenGL ES, use rect version instead"); #else + const bool wasEnabled = glIsEnabled(GL_TEXTURE_2D); GLint oldTexture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldTexture); @@ -2830,6 +2843,18 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_WIDTH, &textureWidth); glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &textureHeight); + if (d_ptr->active_engine && + d_ptr->active_engine->type() == QPaintEngine::OpenGL2) { + QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine); + if (!eng->isNativePaintingActive()) { + QRectF dest(point, QSizeF(textureWidth, textureHeight)); + QRectF src(0, 0, textureWidth, textureHeight); + QSize size(textureWidth, textureHeight); + eng->drawTexture(dest, textureId, size, src); + return; + } + } + qDrawTextureRect(QRectF(point, QSizeF(textureWidth, textureHeight)), textureWidth, textureHeight, textureTarget); if (!wasEnabled) @@ -3950,7 +3975,7 @@ bool QGLWidget::event(QEvent *e) } } -#if defined(QT_OPENGL_ES) +#ifndef QT_NO_EGL // A re-parent is likely to destroy the X11 window and re-create it. It is important // that we free the EGL surface _before_ the winID changes - otherwise we can leak. if (e->type() == QEvent::ParentAboutToChange) @@ -4909,7 +4934,7 @@ void QGLWidget::drawTexture(const QPointF &point, QMacCompatGLuint textureId, QM } #endif -#if !defined(QT_OPENGL_ES_1) +#ifndef QT_OPENGL_ES_1 Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_2_engine) #endif |