aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgtexture.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-18 10:36:44 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-18 13:40:49 +0000
commit5cf4253fa3802e3c2efbecd0f7f4fb822252d811 (patch)
tree5b1dd426c540ec5c6483c994f01912fffd7b4083 /src/quick/scenegraph/util/qsgtexture.cpp
parentd140614a1df7d9563acef5092f92e9f31c14723b (diff)
Remove custom swizzle implementations
The QtGui one is heavily optimized, so don't duplicate it. Change-Id: I32d5987b36bda084e98ffc6c86a22414569bad14 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/scenegraph/util/qsgtexture.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index fea92a5121..982d05691d 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -659,17 +659,6 @@ QSGPlainTexture::~QSGPlainTexture()
#endif
}
-void qsg_swizzleBGRAToRGBA(QImage *image)
-{
- const int width = image->width();
- const int height = image->height();
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) image->scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
- }
-}
-
void QSGPlainTexture::setImage(const QImage &image)
{
m_image = image;
@@ -841,7 +830,7 @@ void QSGPlainTexture::bind()
internalFormat = GL_RGBA;
#endif
} else {
- qsg_swizzleBGRAToRGBA(&tmp);
+ tmp = std::move(tmp).convertToFormat(QImage::Format_RGBA8888_Premultiplied);
}
qint64 swizzleTime = 0;