aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-02 12:59:20 +0200
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-02 12:59:20 +0200
commit92970522b602844cbf932d5df6b62d6cf51e4416 (patch)
tree31b2031b3f9b4f3aa870fe93259ed8aceb0dec5b
parent155faa3b8b1e04241bd53df3eb008d54a71cc667 (diff)
Fixed upside-down texture in QSGPaintedItem.
-rw-r--r--src/declarative/scenegraph/util/qsgpainternode.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/declarative/scenegraph/util/qsgpainternode.cpp b/src/declarative/scenegraph/util/qsgpainternode.cpp
index c7386d2fb9..569f1be19e 100644
--- a/src/declarative/scenegraph/util/qsgpainternode.cpp
+++ b/src/declarative/scenegraph/util/qsgpainternode.cpp
@@ -79,19 +79,13 @@ void QSGPainterTexture::bind()
int w = m_dirty_rect.width();
int h = m_dirty_rect.height();
- int y = m_image.height() - m_dirty_rect.y() - h;
#ifdef QT_OPENGL_ES
- for (int i = 0; i < h; ++i) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), y + i, w, 1,
- GL_RGBA, GL_UNSIGNED_BYTE, subImage.constScanLine(h - 1 - i));
- }
+ glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
+ GL_RGBA, GL_UNSIGNED_BYTE, subImage.constBits());
#else
- for (int i = 0; i < h; ++i) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), y + i, w, 1,
- GL_BGRA, GL_UNSIGNED_BYTE, subImage.constScanLine(h - 1 - i));
- }
-
+ glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
+ GL_BGRA, GL_UNSIGNED_BYTE, subImage.constBits());
#endif
m_dirty_texture = false;
@@ -201,7 +195,7 @@ void QSGPainterNode::updateGeometry()
{
QRectF source;
if (m_actualRenderTarget == QSGPaintedItem::Image)
- source = QRectF(0, 1, 1, -1);
+ source = QRectF(0, 0, 1, 1);
else
source = QRectF(0, 1, qreal(m_size.width()) / m_fboSize.width(), qreal(-m_size.height()) / m_fboSize.height());
QSGGeometry::updateTexturedRectGeometry(&m_geometry,