[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 12:24:47 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a12256d95716c1a4ed4e6bd9f5f4622e3f1c8d1c
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Aug 22 08:38:25 2010 +0000
2010-08-22 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Ariya Hidayat.
[Qt] Gradient: Support inner radius larger than outer radius
https://bugs.webkit.org/show_bug.cgi?id=44392
* platform/graphics/qt/GradientQt.cpp:
(WebCore::Gradient::platformGradient): Reverse the (radial) gradient if r0 > r1.
2010-08-22 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Ariya Hidayat.
[Qt] Gradient: Support inner radius larger than outer radius
https://bugs.webkit.org/show_bug.cgi?id=44392
Unskip two tests that now pass:
- canvas/philip/tests/2d.gradient.radial.outside2.html
- canvas/philip/tests/2d.gradient.radial.outside3.html
* platform/qt/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6f0e146..f79cddd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-22 Andreas Kling <andreas.kling at nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Gradient: Support inner radius larger than outer radius
+ https://bugs.webkit.org/show_bug.cgi?id=44392
+
+ Unskip two tests that now pass:
+ - canvas/philip/tests/2d.gradient.radial.outside2.html
+ - canvas/philip/tests/2d.gradient.radial.outside3.html
+
+ * platform/qt/Skipped:
+
2010-08-21 Eric Carlson <eric.carlson at apple.com>
Reviewed by Dan Bernstein.
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 9c9a652..ee20527 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5230,8 +5230,6 @@ canvas/philip/tests/2d.gradient.radial.cone.cylinder.html
canvas/philip/tests/2d.gradient.radial.cone.shape2.html
canvas/philip/tests/2d.gradient.radial.cone.top.html
canvas/philip/tests/2d.gradient.radial.negative.html
-canvas/philip/tests/2d.gradient.radial.outside2.html
-canvas/philip/tests/2d.gradient.radial.outside3.html
canvas/philip/tests/2d.gradient.radial.touch1.html
canvas/philip/tests/2d.gradient.radial.touch2.html
canvas/philip/tests/2d.gradient.radial.touch3.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d94bf9a..825e72a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-22 Andreas Kling <andreas.kling at nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Gradient: Support inner radius larger than outer radius
+ https://bugs.webkit.org/show_bug.cgi?id=44392
+
+ * platform/graphics/qt/GradientQt.cpp:
+ (WebCore::Gradient::platformGradient): Reverse the (radial) gradient if r0 > r1.
+
2010-08-22 Ariya Hidayat <ariya at sencha.com>
Reviewed by Dirk Schulze.
diff --git a/WebCore/platform/graphics/qt/GradientQt.cpp b/WebCore/platform/graphics/qt/GradientQt.cpp
index 1f05a15..72bb009 100644
--- a/WebCore/platform/graphics/qt/GradientQt.cpp
+++ b/WebCore/platform/graphics/qt/GradientQt.cpp
@@ -46,8 +46,15 @@ QGradient* Gradient::platformGradient()
if (m_gradient)
return m_gradient;
+ bool reversed = m_r0 > m_r1;
+
+ qreal innerRadius = reversed ? m_r1 : m_r0;
+ qreal outerRadius = reversed ? m_r0 : m_r1;
+ QPointF center = reversed ? m_p0 : m_p1;
+ QPointF focalPoint = reversed ? m_p1 : m_p0;
+
if (m_radial)
- m_gradient = new QRadialGradient(m_p1.x(), m_p1.y(), m_r1, m_p0.x(), m_p0.y());
+ m_gradient = new QRadialGradient(center, outerRadius, focalPoint);
else
m_gradient = new QLinearGradient(m_p0.x(), m_p0.y(), m_p1.x(), m_p1.y());
@@ -65,9 +72,19 @@ QGradient* Gradient::platformGradient()
lastStop = stopIterator->stop + lastStopDiff;
else
lastStop = stopIterator->stop;
- if (m_radial && m_r0)
- lastStop = m_r0 / m_r1 + lastStop * (1.0f - m_r0 / m_r1);
- m_gradient->setColorAt(qMin(lastStop, qreal(1.0f)), stopColor);
+
+ if (m_radial && !qFuzzyCompare(1 + outerRadius, qreal(1))) {
+ lastStop = lastStop * (1.0f - innerRadius / outerRadius);
+ if (!reversed)
+ lastStop += innerRadius / outerRadius;
+ }
+
+ qreal stopPosition = qMin(lastStop, qreal(1.0f));
+
+ if (m_radial && reversed)
+ stopPosition = 1 - stopPosition;
+
+ m_gradient->setColorAt(stopPosition, stopColor);
// Keep the lastStop as orginal value, since the following stopColor depend it
lastStop = stopIterator->stop;
++stopIterator;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list