summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-27 22:48:31 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-27 22:48:31 (GMT)
commitf021a26114f599baf01db9bbe8dee5c2dece044e (patch)
treed9b40a3c6d43e69e6025c59eb02bc3ef7a13c947 /src/opengl
parenta17339e943f21bb6c6e16884f716dd9ab8f94938 (diff)
parent83a59e90ebf3aa2b8381f746a2c731426805b649 (diff)
downloadQt-f021a26114f599baf01db9bbe8dee5c2dece044e.zip
Qt-f021a26114f599baf01db9bbe8dee5c2dece044e.tar.gz
Qt-f021a26114f599baf01db9bbe8dee5c2dece044e.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: Add unit tests covering most of QVector's API. Fix crash when CoreText fails to shape text for us Fix crash when using opengl graphicssystem on desktop
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h3
-rw-r--r--src/opengl/qgl.cpp8
3 files changed, 11 insertions, 6 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 8460430..4461358 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1337,9 +1337,12 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
d->drawCachedGlyphs(glyphType, textItem, true);
}
-void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src)
+bool QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src)
{
Q_D(QGL2PaintEngineEx);
+ if (!d->shaderManager)
+ return false;
+
ensureActive();
d->transferMode(ImageDrawingMode);
@@ -1354,6 +1357,7 @@ void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const
d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, textureId);
d->drawTexture(dest, srcRect, size, false);
+ return true;
}
void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem)
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 30f6634..6ba0c42 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -123,7 +123,6 @@ public:
virtual void renderHintsChanged();
virtual void transformChanged();
- virtual void drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr);
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
QPainter::PixmapFragmentHints hints);
@@ -136,6 +135,8 @@ public:
virtual void drawStaticTextItem(QStaticTextItem *textItem);
+ bool drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr);
+
Type type() const { return OpenGL2; }
virtual void setState(QPainterState *s);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 72ed6be..52efea5 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2774,8 +2774,8 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text
if (!eng->isNativePaintingActive()) {
QRectF src(0, 0, target.width(), target.height());
QSize size(target.width(), target.height());
- eng->drawTexture(target, textureId, size, src);
- return;
+ if (eng->drawTexture(target, textureId, size, src))
+ return;
}
}
@@ -2850,8 +2850,8 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text
QRectF dest(point, QSizeF(textureWidth, textureHeight));
QRectF src(0, 0, textureWidth, textureHeight);
QSize size(textureWidth, textureHeight);
- eng->drawTexture(dest, textureId, size, src);
- return;
+ if (eng->drawTexture(dest, textureId, size, src))
+ return;
}
}