diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-13 11:28:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-13 13:01:45 +0000 |
commit | 29380121efad2355a69cb3f8110bf193baa312b4 (patch) | |
tree | 1ce6dd25f83b84d0064aff63e3fc1ebb9ca96eca /src/gui/painting | |
parent | 1d91d155f28fb178eb4e5a2a33b45bc68be718a4 (diff) |
Fix RGB30 painting tests
Some tests were failing because the color was not read correctly from
a QImage. To make it possibly to read more accurate colors a pixel
accessor returing QColor has been added.
Some tests also had the wrong order of arguments, confusing dest and src
formats. This has been corrected, so they test what they claim to test.
A test for RGB30 linear gradients is also added.
Change-Id: Ic623ae1b8e0bf7383056b641c6e8230a1d7dd0dd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index b6f06135cd..b2992a138e 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -4698,10 +4698,8 @@ static inline Operator getOperator(const QSpanData *data, const QSpan *spans, in } ++spans; } - if (!alphaSpans) { + if (!alphaSpans) op.destFetch = 0; - op.destFetch64 = 0; - } } } } @@ -4795,10 +4793,9 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData) int length = spans->len; while (length) { int l = qMin(buffer_size, length); - QRgba64 *dest = op.destFetch64 ? op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l) : buffer; + QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l); op.funcSolid64(dest, l, color, spans->coverage); - if (op.destStore64) - op.destStore64(data->rasterBuffer, x, spans->y, dest, l); + op.destStore64(data->rasterBuffer, x, spans->y, dest, l); length -= l; x += l; } @@ -4987,7 +4984,7 @@ public: bool isSupported() const { - return op.srcFetch64 && op.func64; + return op.srcFetch64 && op.func64 && op.destFetch64 && op.destStore64; } const QRgba64 *fetch(int x, int y, int len) @@ -5108,10 +5105,9 @@ static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, voi while (length) { int l = qMin(buffer_size, length); const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l); - QRgba64 *dest = op.destFetch64 ? op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l) : buffer; + QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l); op.func64(dest, src, l, coverage); - if (op.destStore64) - op.destStore64(data->rasterBuffer, x, spans->y, dest, l); + op.destStore64(data->rasterBuffer, x, spans->y, dest, l); x += l; sx += l; length -= l; @@ -5353,10 +5349,9 @@ static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userD if (buffer_size < l) l = buffer_size; const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l); - QRgba64 *dest = op.destFetch64 ? op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l) : buffer; + QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l); op.func64(dest, src, l, coverage); - if (op.destStore64) - op.destStore64(data->rasterBuffer, x, spans->y, dest, l); + op.destStore64(data->rasterBuffer, x, spans->y, dest, l); x += l; sx += l; length -= l; |