diff options
| author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-12-22 09:24:10 +0100 |
|---|---|---|
| committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-12-22 09:24:10 +0100 |
| commit | f4560ff1e42aa5655376490f601ae15a5058c3b9 (patch) | |
| tree | de2c692f08bbc99dd962f70e44bb81a86d5100f4 | |
| parent | e0d01169b279a528616688efd946561512b837e3 (diff) | |
convert images to ARGBPM prior to upload
| -rw-r--r-- | src/adaptationlayers/qsgpartialuploadtexturemanager.cpp | 2 | ||||
| -rw-r--r-- | src/adaptationlayers/qsgthreadedtexturemanager.cpp | 2 | ||||
| -rw-r--r-- | src/scenegraph/coreapi/qsgcontext.cpp | 2 | ||||
| -rw-r--r-- | src/scenegraph/coreapi/qsgtexturemanager.cpp | 3 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/adaptationlayers/qsgpartialuploadtexturemanager.cpp b/src/adaptationlayers/qsgpartialuploadtexturemanager.cpp index 2696eeb..02a8c66 100644 --- a/src/adaptationlayers/qsgpartialuploadtexturemanager.cpp +++ b/src/adaptationlayers/qsgpartialuploadtexturemanager.cpp @@ -246,7 +246,7 @@ void QSGPartialUploadTextureManager::processAsyncTextures() int y = (t->progress / hChunkCount) * d->uploadChunkSize; QRect area = QRect(x, y, d->uploadChunkSize, d->uploadChunkSize) & t->image.rect(); - QImage subImage = t->image.copy(area); + QImage subImage = t->image.copy(area).convertToFormat(QImage::Format_ARGB32_Premultiplied); // printf("ASYNC: - doing another batch: %d (x=%d, y=%d, w=%d, h=%d\n", // request->progress, // x, y, subImage.width(), subImage.height()); diff --git a/src/adaptationlayers/qsgthreadedtexturemanager.cpp b/src/adaptationlayers/qsgthreadedtexturemanager.cpp index 83e64db..8fa207b 100644 --- a/src/adaptationlayers/qsgthreadedtexturemanager.cpp +++ b/src/adaptationlayers/qsgthreadedtexturemanager.cpp @@ -214,7 +214,7 @@ void QSGThreadedTextureManager::uploadInThread(const QImage &image, QSGTexture * glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id); - QImage copy = image; + QImage copy = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); // swizzleBGRAToRGBA(©); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, image.constBits()); diff --git a/src/scenegraph/coreapi/qsgcontext.cpp b/src/scenegraph/coreapi/qsgcontext.cpp index a52bd95..d13c374 100644 --- a/src/scenegraph/coreapi/qsgcontext.cpp +++ b/src/scenegraph/coreapi/qsgcontext.cpp @@ -146,7 +146,7 @@ void QSGContext::renderNextFrame() */ RectangleNodeInterface *QSGContext::createRectangleNode() { - return new DefaultRectangleNode(DefaultRectangleNode::PreferTextureMaterial, this); + return new DefaultRectangleNode(DefaultRectangleNode::PreferVertexColorMaterial, this); } /*! diff --git a/src/scenegraph/coreapi/qsgtexturemanager.cpp b/src/scenegraph/coreapi/qsgtexturemanager.cpp index bb987d3..31b8d5f 100644 --- a/src/scenegraph/coreapi/qsgtexturemanager.cpp +++ b/src/scenegraph/coreapi/qsgtexturemanager.cpp @@ -179,8 +179,9 @@ uint QSGTextureManagerPrivate::upload(const QImage &image, GLuint id) glBindTexture(GL_TEXTURE_2D, id); + QImage i = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); + #ifdef QT_OPENGL_ES - QImage i = image; swizzleBGRAToRGBA(&i); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, i.width(), i.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, i.constBits()); #else |
