aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/scenegraph/util/qsgtexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/scenegraph/util/qsgtexture.cpp')
-rw-r--r--src/declarative/scenegraph/util/qsgtexture.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/declarative/scenegraph/util/qsgtexture.cpp b/src/declarative/scenegraph/util/qsgtexture.cpp
index 6112e777e4..9362ba8bf6 100644
--- a/src/declarative/scenegraph/util/qsgtexture.cpp
+++ b/src/declarative/scenegraph/util/qsgtexture.cpp
@@ -356,13 +356,9 @@ void QSGPlainTexture::bind()
int h = m_image.height();
#ifdef QT_OPENGL_ES
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
- for (int i = 0; i < m_image.height(); ++i)
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i, w, 1, GL_RGBA, GL_UNSIGNED_BYTE, m_image.constScanLine(h - 1 - i));
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_image.constBits());
#else
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
- for (int i = 0; i < m_image.height(); ++i)
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i, w, 1, GL_BGRA, GL_UNSIGNED_BYTE, m_image.constScanLine(h - 1 - i));
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, m_image.constBits());
#endif
if (m_has_mipmaps) {
@@ -372,6 +368,7 @@ void QSGPlainTexture::bind()
}
m_texture_size = QSize(w, h);
+ m_texture_rect = QRectF(0, 0, 1, 1);
updateBindOptions(m_dirty_bind_options);
m_dirty_bind_options = false;