From 0360e5ed59813f5d7cb709cc7885d942e5fa2473 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 12 Apr 2013 16:24:47 +0200 Subject: 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 --- src/quick/scenegraph/util/qsgpainternode.cpp | 31 +--------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src/quick/scenegraph/util') 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(); } -- cgit v1.2.3