hrev47565 adds 1 changeset to branch 'master' old head: a694f30d6c3d2e62beba0fbb94c4262471c87c22 new head: b0ab67351d1a1dd81cef611644a32d21f1262383 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=b0ab673+%5Ea694f30 ---------------------------------------------------------------------------- b0ab673: use unpacked scanlines when rendering gradients. * There is no point in trying to pack the scanlines in a gradient, as it is very likely that each pixel will have a different color. * Moreover, the packed scanline generator will assume all pixels in the * scanline have the same alpha value (for faster blending), and it may * not be the case. Fixes #2946. Thanks to stippi and jessicah who helped tracking and understanding the issue. [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev47565 Commit: b0ab67351d1a1dd81cef611644a32d21f1262383 URL: http://cgit.haiku-os.org/haiku/commit/?id=b0ab673 Author: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> Date: Thu Jul 24 10:36:50 2014 UTC Ticket: https://dev.haiku-os.org/ticket/2946 ---------------------------------------------------------------------------- 1 file changed, 8 insertions(+), 7 deletions(-) src/servers/app/drawing/Painter/Painter.cpp | 15 ++++++++------- ---------------------------------------------------------------------------- diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 7156be9..97f1a1f 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -3067,10 +3067,11 @@ Painter::_MakeGradient(Array& array, const BGradient& gradient) const from->color.blue, from->color.alpha); agg::rgba8 toColor(to->color.red, to->color.green, to->color.blue, to->color.alpha); - GTRACE("Painter::_MakeGradient> fromColor(%d, %d, %d) offset = %f\n", - fromColor.r, fromColor.g, fromColor.b, from->offset); - GTRACE("Painter::_MakeGradient> toColor(%d, %d, %d) offset = %f\n", - toColor.r, toColor.g, toColor.b, to->offset); + GTRACE("Painter::_MakeGradient> fromColor(%d, %d, %d, %d) offset = %f\n", + fromColor.r, fromColor.g, fromColor.b, fromColor.a, + from->offset); + GTRACE("Painter::_MakeGradient> toColor(%d, %d, %d %d) offset = %f\n", + toColor.r, toColor.g, toColor.b, toColor.a, to->offset); float dist = to->offset - from->offset; GTRACE("Painter::_MakeGradient> dist = %f\n", dist); // TODO: Review this... offset should better be on [0..1] @@ -3078,8 +3079,8 @@ Painter::_MakeGradient(Array& array, const BGradient& gradient) const for (int j = (int)from->offset; j <= (int)to->offset; j++) { float f = (float)(to->offset - j) / (float)(dist + 1); array[j] = toColor.gradient(fromColor, f); - GTRACE("Painter::_MakeGradient> array[%d](%d, %d, %d)\n", - array[j].r, array[j].g, array[j].b); + GTRACE("Painter::_MakeGradient> array[%d](%d, %d, %d, %d)\n", + j, array[j].r, array[j].g, array[j].b, array[j].a); } } } @@ -3117,7 +3118,7 @@ Painter::_RasterizePath(VertexSource& path, const BGradient& gradient, fRasterizer.reset(); fRasterizer.add_path(path); if (fMaskedUnpackedScanline == NULL) - agg::render_scanlines(fRasterizer, fPackedScanline, gradientRenderer); + agg::render_scanlines(fRasterizer, fUnpackedScanline, gradientRenderer); else { agg::render_scanlines(fRasterizer, *fMaskedUnpackedScanline, gradientRenderer);