diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-12-09 13:35:44 +0100 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-12-09 13:35:44 +0100 |
commit | d36c40f5c3f2bfecc9e07956d283e4c22c53f708 (patch) | |
tree | df6384256f0710cb1f0d11b342fc7c3d1e8052f9 | |
parent | 741907e81262117fb3ab01511666daf8162929d4 (diff) |
Don't schedule failed images for upload
-rw-r--r-- | src/graphicsitems/qximagebase.cpp | 23 | ||||
-rw-r--r-- | src/scenegraph/coreapi/qsgtexturemanager.cpp | 4 |
2 files changed, 15 insertions, 12 deletions
diff --git a/src/graphicsitems/qximagebase.cpp b/src/graphicsitems/qximagebase.cpp index 64d27e3..81ef269 100644 --- a/src/graphicsitems/qximagebase.cpp +++ b/src/graphicsitems/qximagebase.cpp @@ -191,20 +191,19 @@ void QxImageBase::requestFinished() if (d->progress != oldProgress) emit progressChanged(d->progress); + if (d->status != Error && d->status != Null) { + QSGTextureManager *tm = QSGContext::current->textureManager(); + if (d->async) { + QImage image = d->pix.pixmap().toImage(); + d->texture = tm->requestUpload(image, + this, + SLOT(textureStatusChanged(int))); - QSGTextureManager *tm = QSGContext::current->textureManager(); - - if (d->async) { - QImage image = d->pix.pixmap().toImage(); - d->texture = tm->requestUpload(image, - this, - SLOT(textureStatusChanged(int))); - - } else { - d->texture = tm->upload(d->pix.pixmap().toImage()); + } else { + d->texture = tm->upload(d->pix.pixmap().toImage()); + } + markDirty(QxImageBasePrivate::DirtyTextureReady); } - - markDirty(QxImageBasePrivate::DirtyTextureReady); } void QxImageBase::textureStatusChanged(int status) diff --git a/src/scenegraph/coreapi/qsgtexturemanager.cpp b/src/scenegraph/coreapi/qsgtexturemanager.cpp index 218c1ea..0b688c3 100644 --- a/src/scenegraph/coreapi/qsgtexturemanager.cpp +++ b/src/scenegraph/coreapi/qsgtexturemanager.cpp @@ -166,6 +166,8 @@ void QSGTextureManager::swizzleBGRAToRGBA(QImage *image) QSGTextureRef QSGTextureManager::upload(const QImage &image) { + Q_ASSERT(!image.isNull()); + QSGTextureCacheKey key = { image.cacheKey() }; QSGTexture *texture = d->cache.value(key); if (texture) @@ -202,6 +204,8 @@ QSGTextureRef QSGTextureManager::requestUpload(const QImage &image, const QObject *listener, const char *slot) { + Q_ASSERT(!image.isNull()); + QSGTexture *t = new QSGTexture(); connect(t, SIGNAL(statusChanged(int)), listener, slot); |