[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 13:11:12 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit df71fd72b2f9a87543c1916a7ee71d8b0ae138fc
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 8 14:07:01 2010 +0000
2010-09-08 Jan E Hanssen <jhanssen at sencha.com>
Reviewed by Dirk Schulze.
Add a test for getting a point beyond the length of the path
https://bugs.webkit.org/show_bug.cgi?id=43837
* svg/dom/path-pointAtLength-expected.txt:
* svg/dom/script-tests/path-pointAtLength.js:
2010-09-08 Jan E Hanssen <jhanssen at sencha.com>
Reviewed by Dirk Schulze.
[Qt] PathQt should use the QPainterPath functionality for calculations
https://bugs.webkit.org/show_bug.cgi?id=43837
Change PathQt to use the built-in functionality of QPainterPath for
calculating length(), pointAtLength() and normalAngleAtLength().
* platform/graphics/Path.cpp:
* platform/graphics/qt/PathQt.cpp:
(WebCore::Path::length):
(WebCore::Path::pointAtLength):
(WebCore::Path::normalAngleAtLength):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 27fc34b..19489de 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-08 Jan E Hanssen <jhanssen at sencha.com>
+
+ Reviewed by Dirk Schulze.
+
+ Add a test for getting a point beyond the length of the path
+ https://bugs.webkit.org/show_bug.cgi?id=43837
+
+ * svg/dom/path-pointAtLength-expected.txt:
+ * svg/dom/script-tests/path-pointAtLength.js:
+
2010-09-08 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Antonio Gomes.
diff --git a/LayoutTests/svg/dom/path-pointAtLength-expected.txt b/LayoutTests/svg/dom/path-pointAtLength-expected.txt
index 612b1f2..a1eb3f1 100644
--- a/LayoutTests/svg/dom/path-pointAtLength-expected.txt
+++ b/LayoutTests/svg/dom/path-pointAtLength-expected.txt
@@ -6,6 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS pointAtLengthOfPath('M0,20 L400,20 L640,20') is '(640, 20)'
PASS pointAtLengthOfPath('M0,20 L400,20 L640,20 z') is '(580, 20)'
PASS pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20') is '(100, 20)'
+PASS pointAtLengthOfPath('M0,20 L20,40') is '(20, 40)'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/svg/dom/script-tests/path-pointAtLength.js b/LayoutTests/svg/dom/script-tests/path-pointAtLength.js
index 751bf2a..cc6c8fb 100644
--- a/LayoutTests/svg/dom/script-tests/path-pointAtLength.js
+++ b/LayoutTests/svg/dom/script-tests/path-pointAtLength.js
@@ -12,5 +12,6 @@ function pointAtLengthOfPath(string) {
shouldBe("pointAtLengthOfPath('M0,20 L400,20 L640,20')", "'(640, 20)'");
shouldBe("pointAtLengthOfPath('M0,20 L400,20 L640,20 z')", "'(580, 20)'");
shouldBe("pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20')", "'(100, 20)'");
+shouldBe("pointAtLengthOfPath('M0,20 L20,40')", "'(20, 40)'");
var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 71809eb..9cbdf2c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-08 Jan E Hanssen <jhanssen at sencha.com>
+
+ Reviewed by Dirk Schulze.
+
+ [Qt] PathQt should use the QPainterPath functionality for calculations
+ https://bugs.webkit.org/show_bug.cgi?id=43837
+
+ Change PathQt to use the built-in functionality of QPainterPath for
+ calculating length(), pointAtLength() and normalAngleAtLength().
+
+ * platform/graphics/Path.cpp:
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::length):
+ (WebCore::Path::pointAtLength):
+ (WebCore::Path::normalAngleAtLength):
+
2010-09-08 Gyuyoung Kim <gyuyoung.kim at samsung.com>
Reviewed by Dirk Schulze.
diff --git a/WebCore/platform/graphics/Path.cpp b/WebCore/platform/graphics/Path.cpp
index 333afcb..4e2de53 100644
--- a/WebCore/platform/graphics/Path.cpp
+++ b/WebCore/platform/graphics/Path.cpp
@@ -39,7 +39,7 @@ static const float QUARTER = 0.552f; // approximation of control point positions
// to simulate a quarter of a circle.
namespace WebCore {
-#if !PLATFORM(OPENVG)
+#if !PLATFORM(OPENVG) && !PLATFORM(QT)
static void pathLengthApplierFunction(void* info, const PathElement* element)
{
PathTraversalState& traversalState = *static_cast<PathTraversalState*>(info);
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index 35edd0e..df54684 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -474,6 +474,31 @@ void Path::transform(const AffineTransform& transform)
m_path = qTransform.map(m_path);
}
+float Path::length()
+{
+ return m_path.length();
+}
+
+FloatPoint Path::pointAtLength(float length, bool& ok)
+{
+ ok = (length >= 0 && length <= m_path.length());
+
+ qreal percent = m_path.percentAtLength(length);
+ QPointF point = m_path.pointAtPercent(percent);
+
+ return point;
+}
+
+float Path::normalAngleAtLength(float length, bool& ok)
+{
+ ok = (length >= 0 && length <= m_path.length());
+
+ qreal percent = m_path.percentAtLength(length);
+ qreal angle = m_path.angleAtPercent(percent);
+
+ return angle;
+}
+
}
// vim: ts=4 sw=4 et
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list