diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 5 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 5 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 14 |
3 files changed, 11 insertions, 13 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 0ef9204..0534233 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -510,11 +510,6 @@ void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& s glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } -bool QGL2PaintEngineEx::isNativePaintingActive() -{ - return nativePaintingActive; -} - void QGL2PaintEngineEx::beginNativePainting() { Q_D(QGL2PaintEngineEx); diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index e91d7ac..0538107 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -154,12 +154,15 @@ public: void setRenderTextActive(bool); - bool isNativePaintingActive(); + bool isNativePaintingActive() const; private: Q_DISABLE_COPY(QGL2PaintEngineEx) bool nativePaintingActive; }; +inline bool QGL2PaintEngineEx::isNativePaintingActive() const { + return nativePaintingActive; +} class QGL2PaintEngineExPrivate : public QPaintEngineExPrivate { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index c20c058..394bcbc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2771,9 +2771,9 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text 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()); + if (!eng->isNativePaintingActive()) { + QRectF src(0, 0, target.width(), target.height()); + QSize size(target.width(), target.height()); eng->drawTexture(target, textureId, size, src); return; } @@ -2846,10 +2846,10 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text 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 dest = QRectF(point, QSizeF(textureWidth, textureHeight)); - QRectF src = QRectF(0, 0, textureWidth, textureHeight); - QSize size = QSize(textureWidth, textureHeight); + 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; } |