From 495a818a439c9ad62f9af696f6c3fdc5b0065e07 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 24 Apr 2009 12:05:48 +0200 Subject: Fix an issue with SVG gradient rendering. This patch complete the two others made by Kim : - 6c2dd295b2ca2f9125fe072d035a3784ce748718 - 003223dcfc1fa884b82085db19d4c4056bf6eaa0 It fix the stops if the gradient link to another gradient below. Task-number: KDE Reviewed-by: Kim Reviewed-by: Samuel --- src/svg/qsvgstyle.cpp | 1 + tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 44 ++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index b065395..bd0804c 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.cpp @@ -808,6 +808,7 @@ void QSvgGradientStyle::resolveStops() static_cast(prop); st->resolveStops(); m_gradient->setStops(st->qgradient()->stops()); + m_gradientStopsSet = st->gradientStopsSet(); } } m_link = QString(); diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp index 4a17031..4da99da 100644 --- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp @@ -534,16 +534,42 @@ void tst_QSvgRenderer::gradientStops() const QCOMPARE(image, refImage); } + const char *svgs[] = { + "" + "" + "" + "" + "" + "" + "" + "" + "", + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "", + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + }; + for (int i = 0 ; i < sizeof(svgs) / sizeof(svgs[0]) ; ++i) { - QByteArray data("" - "" - "" - "" - "" - "" - "" - "" - ""); + QByteArray data = svgs[i]; QSvgRenderer renderer(data); QImage image(256, 8, QImage::Format_ARGB32_Premultiplied); -- cgit v0.12