[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Tue Jan 5 23:49:26 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit de57a76d82dca19d85c2d619d8c6df53c985e640
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 14 21:27:11 2009 +0000
2009-12-14 Jakob Petsovits <jpetsovits at rim.com>
Reviewed by Simon Fraser.
Add FloatQuad::isRectilinear() to check whether it can be represented as FloatRect.
https://bugs.webkit.org/show_bug.cgi?id=30442
This enables optimizations for distinguishing between
arbitrary FloatQuads and rectilinear ones.
* platform/graphics/FloatQuad.cpp:
(WebCore::FloatQuad::isRectilinear):
* platform/graphics/FloatQuad.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index eab20ff..ecfb902 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-14 Jakob Petsovits <jpetsovits at rim.com>
+
+ Reviewed by Simon Fraser.
+
+ Add FloatQuad::isRectilinear() to check whether it can be represented as FloatRect.
+ https://bugs.webkit.org/show_bug.cgi?id=30442
+
+ This enables optimizations for distinguishing between
+ arbitrary FloatQuads and rectilinear ones.
+
+ * platform/graphics/FloatQuad.cpp:
+ (WebCore::FloatQuad::isRectilinear):
+ * platform/graphics/FloatQuad.h:
+
2009-12-14 Simon Hausmann <hausmann at webkit.org>
Reviewed by Holger Freyther.
diff --git a/WebCore/platform/graphics/FloatQuad.cpp b/WebCore/platform/graphics/FloatQuad.cpp
index 427230d..d1069fb 100644
--- a/WebCore/platform/graphics/FloatQuad.cpp
+++ b/WebCore/platform/graphics/FloatQuad.cpp
@@ -85,6 +85,12 @@ FloatRect FloatQuad::boundingBox() const
return FloatRect(left, top, right - left, bottom - top);
}
+bool FloatQuad::isRectilinear() const
+{
+ return (m_p1.x() == m_p2.x() && m_p2.y() == m_p3.y() && m_p3.x() == m_p4.x() && m_p4.y() == m_p1.y())
+ || (m_p1.y() == m_p2.y() && m_p2.x() == m_p3.x() && m_p3.y() == m_p4.y() && m_p4.x() == m_p1.x());
+}
+
bool FloatQuad::containsPoint(const FloatPoint& p) const
{
return isPointInTriangle(p, m_p1, m_p2, m_p3) || isPointInTriangle(p, m_p1, m_p3, m_p4);
diff --git a/WebCore/platform/graphics/FloatQuad.h b/WebCore/platform/graphics/FloatQuad.h
index 5982967..6cd86f6 100644
--- a/WebCore/platform/graphics/FloatQuad.h
+++ b/WebCore/platform/graphics/FloatQuad.h
@@ -74,6 +74,12 @@ public:
// "slanted" empty quads.
bool isEmpty() const { return boundingBox().isEmpty(); }
+ // Tests whether this quad can be losslessly represented by a FloatRect,
+ // that is, if two edges are parallel to the x-axis and the other two
+ // are parallel to the y-axis. If this method returns true, the
+ // corresponding FloatRect can be retrieved with boundingBox().
+ bool isRectilinear() const;
+
// Tests whether the given point is inside, or on an edge or corner of this quad.
bool containsPoint(const FloatPoint&) const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list