summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-01 15:43:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-01 15:43:42 (GMT)
commite95d8b9bc027dee5cfd8a13afa0c9204607ad7f1 (patch)
treeac59ce25d31fe953355dca66421842af15b32b94 /src/opengl/qgl.cpp
parent405ae4ef5382cd8ee0adfbe45c59c8d92e3ffdf6 (diff)
parent71547238ea4391636e37f5cf89905433faeb32d1 (diff)
downloadQt-e95d8b9bc027dee5cfd8a13afa0c9204607ad7f1.zip
Qt-e95d8b9bc027dee5cfd8a13afa0c9204607ad7f1.tar.gz
Qt-e95d8b9bc027dee5cfd8a13afa0c9204607ad7f1.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: (51 commits) Symbian on Linux: $QTDIR/bin is not necessarily in the path. Updated Symbian def files with new EGL exports. Added another missing EGL stub. Fixed compilation on Symbian. Added missing EGL stub function. Got rid of unused variable compiler warning. QGLWindowSurface support for partial updates via EGL_NOK_swap_region2 Adding func prototypes for EGL_NOK_swap_region2 extension. Check for EGLSurface leak only when paint device is a QGLWidget. Fixed bug in drawTiledPixmap when width of pixmap matches target rect. Update def files for symbian Improved performance of 16 bit memrotates using NEON instructions. Use built-in iconv on Solaris if available Export various symbols needed to make a custom GL graphicssystem. Moc: fix compilation when templated types with multiple arguments are used. Fixes the documentation of QGraphicsEffect::update(). support BGRA textures on SGX Avoid calling time.elapsed() twice in abstract animation Adds slowdownFactor to UnifiedTimer in abstract animation Add the conversion in-place for QPixmap::fromImageReader() on raster. ...
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp47
1 files changed, 33 insertions, 14 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 9effb34..fc28a73 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2092,6 +2092,16 @@ void QGLContextPrivate::syncGlState()
}
#undef ctx
+#ifdef QT_NO_EGL
+void QGLContextPrivate::swapRegion(const QRegion *)
+{
+ static bool firstWarning = true;
+ if (firstWarning) {
+ qWarning() << "::swapRegion called but not supported!";
+ firstWarning = false;
+ }
+}
+#endif
/*!
\overload
@@ -2246,6 +2256,13 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu
}
}
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
+QGLExtensionFuncs& QGLContextPrivate::extensionFuncs(const QGLContext *)
+{
+ return qt_extensionFuncs;
+}
+#endif
+
QImage QGLContextPrivate::convertToGLFormat(const QImage &image, bool force_premul,
GLenum texture_format)
{
@@ -2357,9 +2374,6 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
&& target == GL_TEXTURE_2D
&& (options & QGLContext::MipmapBindOption))
{
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - generating mipmaps (%d ms)\n", time.elapsed());
-#endif
#if !defined(QT_OPENGL_ES_2)
glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST);
#ifndef QT_OPENGL_ES
@@ -2373,6 +2387,9 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#endif
glTexParameterf(target, GL_TEXTURE_MIN_FILTER, options & QGLContext::LinearFilteringBindOption
? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - generating mipmaps (%d ms)\n", time.elapsed());
+#endif
} else {
glTexParameterf(target, GL_TEXTURE_MIN_FILTER, filtering);
}
@@ -2397,7 +2414,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (premul) {
img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
+ printf(" - converted ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
#endif
}
break;
@@ -2405,7 +2422,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (!premul) {
img = img.convertToFormat(target_format = QImage::Format_ARGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
+ printf(" - converted ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
#endif
}
break;
@@ -2422,20 +2439,17 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
? QImage::Format_ARGB32_Premultiplied
: QImage::Format_ARGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit alpha format (%d ms)\n", time.elapsed());
+ printf(" - converted to 32-bit alpha format (%d ms)\n", time.elapsed());
#endif
} else {
img = img.convertToFormat(QImage::Format_RGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit (%d ms)\n", time.elapsed());
+ printf(" - converted to 32-bit (%d ms)\n", time.elapsed());
#endif
}
}
if (options & QGLContext::InvertedYBindOption) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - flipping bits over y (%d ms)\n", time.elapsed());
-#endif
if (img.isDetached()) {
int ipl = img.bytesPerLine() / 4;
int h = img.height();
@@ -2452,17 +2466,20 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
// data twice. This version should only do it once.
img = img.mirrored();
}
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - flipped bits over y (%d ms)\n", time.elapsed());
+#endif
}
if (externalFormat == GL_RGBA) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - doing byte swapping (%d ms)\n", time.elapsed());
-#endif
// The only case where we end up with a depth different from
// 32 in the switch above is for the RGB16 case, where we set
// the format to GL_RGB
Q_ASSERT(img.depth() == 32);
qgl_byteSwapImage(img, pixel_type);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - did byte swapping (%d ms)\n", time.elapsed());
+#endif
}
#ifdef QT_OPENGL_ES
// OpenGL/ES requires that the internal and external formats be
@@ -2491,7 +2508,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#ifdef QGL_BIND_TEXTURE_DEBUG
static int totalUploadTime = 0;
totalUploadTime += time.elapsed();
- printf(" - upload done in (%d ms) time=%d\n", time.elapsed(), totalUploadTime);
+ printf(" - upload done in %d ms, (accumulated: %d ms)\n", time.elapsed(), totalUploadTime);
#endif
@@ -5187,6 +5204,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
glExtensions |= NVFloatBuffer;
if (extensions.match("GL_ARB_pixel_buffer_object"))
glExtensions |= PixelBufferObject;
+ if (extensions.match("GL_IMG_texture_format_BGRA8888"))
+ glExtensions |= BGRATextureFormat;
#if defined(QT_OPENGL_ES_2)
glExtensions |= FramebufferObject;
glExtensions |= GenerateMipmap;