summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-02-24 14:34:09 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-08 09:45:05 +0000
commit2e6ec59d47a6787978a628085697b7984434056c (patch)
tree1453b21d2717a82ac12451f353efc44b7be9d651 /src/gui/painting/qdrawhelper.cpp
parent075e669cbe3cbbefe66d954e571db227e60eeda7 (diff)
Avoid QRgba64 arrays in the generic text-rendering routines
Like in other functions, allocate arrays of quint64 instead of QRgba64 to avoid the cost of initializing large arrays on every small scanline. Change-Id: Ie132b3157003a18a444ca5c4f94ae668d17327fd Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r--src/gui/painting/qdrawhelper.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 6b7c57673b..5c38648fe7 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -5588,7 +5588,7 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
}
- QRgba64 buffer[buffer_size];
+ quint64 buffer[buffer_size];
const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format];
const DestStoreProc64 destStore64 = destStoreProc64[rasterBuffer->format];
@@ -5598,12 +5598,12 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
int length = mapWidth;
while (length > 0) {
int l = qMin(buffer_size, length);
- QRgba64 *dest = destFetch64(buffer, rasterBuffer, i, y + ly, l);
+ QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, i, y + ly, l);
for (int j=0; j < l; ++j) {
const int coverage = map[j + (i - x)];
alphamapblend_generic(coverage, dest, j, srcColor, color, colorProfile);
}
- destStore64(rasterBuffer, i, y + ly, buffer, l);
+ destStore64(rasterBuffer, i, y + ly, dest, l);
length -= l;
i += l;
}
@@ -5625,7 +5625,7 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
int start = qMax<int>(x, clip.x);
int end = qMin<int>(x + mapWidth, clip.x + clip.len);
Q_ASSERT(clip.len <= buffer_size);
- QRgba64 *dest = destFetch64(buffer, rasterBuffer, start, clip.y, clip.len);
+ QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, clip.len);
for (int xp=start; xp<end; ++xp) {
const int coverage = map[xp - x];
@@ -5873,7 +5873,7 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
}
- QRgba64 buffer[buffer_size];
+ quint64 buffer[buffer_size];
const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format];
const DestStoreProc64 destStore64 = destStoreProc64[rasterBuffer->format];
@@ -5883,12 +5883,12 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
int length = mapWidth;
while (length > 0) {
int l = qMin(buffer_size, length);
- QRgba64 *dest = destFetch64(buffer, rasterBuffer, i, y + ly, l);
+ QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, i, y + ly, l);
for (int j=0; j < l; ++j) {
const uint coverage = src[j + (i - x)];
alphargbblend_generic(coverage, dest, j, srcColor, color, colorProfile);
}
- destStore64(rasterBuffer, i, y + ly, buffer, l);
+ destStore64(rasterBuffer, i, y + ly, dest, l);
length -= l;
i += l;
}
@@ -5910,7 +5910,7 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
int start = qMax<int>(x, clip.x);
int end = qMin<int>(x + mapWidth, clip.x + clip.len);
Q_ASSERT(clip.len <= buffer_size);
- QRgba64 *dest = destFetch64(buffer, rasterBuffer, start, clip.y, clip.len);
+ QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, clip.len);
for (int xp=start; xp<end; ++xp) {
const uint coverage = src[xp - x];