summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-06-21 11:11:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-06-21 11:11:07 (GMT)
commitae23dff04aefa4f3aabb841278ce24de2318c390 (patch)
tree3be373c346511086609089f8917690bbbe8fa805 /src/opengl
parentd5631f115c2e32f8201e98813613010c9d7cb590 (diff)
parent6122f0746cac1008d967c19a8b609d7c92fbc8a5 (diff)
downloadQt-ae23dff04aefa4f3aabb841278ce24de2318c390.zip
Qt-ae23dff04aefa4f3aabb841278ce24de2318c390.tar.gz
Qt-ae23dff04aefa4f3aabb841278ce24de2318c390.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Adding debug output for not supported gl features Compile fix in network for ios Make it possible to compile in a screen plugin name in QWS Don't redefine EGL defines Compile fixes in corelib for ios Export IPHONEOS_DEPLOYMENT_TARGET from qmake Adding arm armv6 and armv7 as valid archs for mac builds reset certain global variables on deletion Made tst_QWidget::repaintWhenChildDeleted() pass.
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 3ac759c..9ce7d55 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -90,6 +90,12 @@
QT_BEGIN_NAMESPACE
+inline static bool isPowerOfTwo(int x)
+{
+ // Assumption: x >= 1
+ return x == (x & -x);
+}
+
#if defined(Q_WS_WIN)
extern Q_GUI_EXPORT bool qt_cleartype_enabled;
#endif
@@ -201,6 +207,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
+#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+ QGLFunctions funcs(QGLContext::currentContext());
+ bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool isNpot = !isPowerOfTwo(texImage.size().width())
+ || !isPowerOfTwo(texImage.size().height());
+ if (isNpot && !npotSupported) {
+ qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures.");
+ }
+#endif
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
}
else if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
@@ -233,6 +248,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
QGLTexture *tex = ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA,
QGLContext::InternalBindOption |
QGLContext::CanFlipNativePixmapBindOption);
+#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+ QGLFunctions funcs(QGLContext::currentContext());
+ bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool isNpot = !isPowerOfTwo(currentBrushPixmap.size().width())
+ || !isPowerOfTwo(currentBrushPixmap.size().height());
+ if (isNpot && !npotSupported) {
+ qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures.");
+ }
+#endif
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
textureInvertedY = tex->options & QGLContext::InvertedYBindOption ? -1 : 1;
}
@@ -1782,6 +1806,15 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
glBindTexture(GL_TEXTURE_2D, cache->texture());
+#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+ QGLFunctions funcs(QGLContext::currentContext());
+ bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool isNpot = !isPowerOfTwo(cache->width())
+ || !isPowerOfTwo(cache->height());
+ if (isNpot && !npotSupported) {
+ qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures.");
+ }
+#endif
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
#if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO)