summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qgl.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 848982d..c20c058 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2768,11 +2768,10 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text
}
#else
- if (d_ptr->active_engine->type() == QPaintEngine::OpenGL2) {
- QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine);
- //qDebug() << "Paint Engine is OpenGL2";
- if (eng->isNativePaintingActive() == false) {
- //qDebug() << "No usage of begin/endNativePainting()";
+ if (d_ptr->active_engine &&
+ d_ptr->active_engine->type() == QPaintEngine::OpenGL2) {
+ QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine);
+ if (eng->isNativePaintingActive() == false) {
QRectF src = QRectF(0, 0, target.width(), target.height());
QSize size = QSize(target.width(), target.height());
eng->drawTexture(target, textureId, size, src);
@@ -2844,11 +2843,10 @@ 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->type() == QPaintEngine::OpenGL2) {
+ if (d_ptr->active_engine &&
+ d_ptr->active_engine->type() == QPaintEngine::OpenGL2) {
QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine);
- //qDebug() << "Paint Engine is OpenGL2";
if (eng->isNativePaintingActive() == false) {
- //qDebug() << "No usage of begin/endNativePainting()";
QRectF dest = QRectF(point, QSizeF(textureWidth, textureHeight));
QRectF src = QRectF(0, 0, textureWidth, textureHeight);
QSize size = QSize(textureWidth, textureHeight);