aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2013-04-12 16:24:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-16 11:35:24 +0200
commit0360e5ed59813f5d7cb709cc7885d942e5fa2473 (patch)
tree989df7d8ece6489847f1e71440a885583aaf9042 /src/quick/scenegraph
parentf7a635fb0b3fa996d2a44db4ada79fcc206d4378 (diff)
Remove slow and buggy sub-image code
The code was probably sub-optimal in most cases, and it broke on GLES 2 when using the BGRA texture extension. Done with Gunnar. Task-number: QTBUG-30656 Change-Id: I92f74cd39f408f145629bc0eb6f3ff43d2f4f000 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/util/qsgpainternode.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp
index e5cf6b8295..97b3500ad0 100644
--- a/src/quick/scenegraph/util/qsgpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgpainternode.cpp
@@ -73,10 +73,6 @@ QSGPainterTexture::QSGPainterTexture()
m_retain_image = true;
}
-#ifdef QT_OPENGL_ES
-extern void qsg_swizzleBGRAToRGBA(QImage *image);
-#endif
-
void QSGPainterTexture::bind()
{
if (m_dirty_rect.isNull()) {
@@ -84,33 +80,8 @@ void QSGPainterTexture::bind()
return;
}
- bool oldMipmapsGenerated = m_mipmaps_generated;
- m_mipmaps_generated = true;
+ setImage(m_image);
QSGPlainTexture::bind();
- m_mipmaps_generated = oldMipmapsGenerated;
-
- QImage subImage = m_image.copy(m_dirty_rect);
-
- int w = m_dirty_rect.width();
- int h = m_dirty_rect.height();
-
-#ifdef QT_OPENGL_ES
- qsg_swizzleBGRAToRGBA(&subImage);
- glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
- GL_RGBA, GL_UNSIGNED_BYTE, subImage.constBits());
-#else
- glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
- GL_BGRA, GL_UNSIGNED_BYTE, subImage.constBits());
-#endif
-
- if (m_has_mipmaps && !m_mipmaps_generated) {
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
- m_mipmaps_generated = true;
- }
-
- m_dirty_texture = false;
- m_dirty_bind_options = false;
m_dirty_rect = QRect();
}