diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-06-15 15:02:58 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-06-15 15:02:58 +0200 |
commit | 1eefe7d4a2108fe6ecce3714cedb809fc6101e97 (patch) | |
tree | 65c5f75d5f63cc1d9f239ecc5ede3b443feb4c05 | |
parent | fcbcd07b9d29a147b6a03f2c4c8d15648aacbcae (diff) |
Speed up distance field generation by 5-20%
-rw-r--r-- | src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp index 50c946a849..c1a46cb8f9 100644 --- a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp +++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp @@ -473,11 +473,14 @@ static void convert_to_Format_Alpha(QImage *image) const int width = image->width(); const int height = image->height(); uchar *data = image->bits(); + const uint *src = (const uint *) data; + int stride = image->bytesPerLine() / sizeof(uint); for (int i = 0; i < height; ++i) { uchar *o = data + i * width; for (int x = 0; x < width; ++x) - o[x] = (uchar)qAlpha(image->pixel(x, i)); + o[x] = (uchar)qAlpha(src[x]); + src += stride; } } |