Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / geometry / FloatPolygon.cpp
index 5407c73..e88f8d7 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "wtf/MathExtras.h"
 
-namespace WebCore {
+namespace blink {
 
 static inline float determinant(const FloatSize& a, const FloatSize& b)
 {
@@ -199,33 +199,6 @@ bool FloatPolygon::contains(const FloatPoint& point) const
     return (fillRule() == RULE_NONZERO) ? containsNonZero(point) : containsEvenOdd(point);
 }
 
-bool VertexPair::overlapsRect(const FloatRect& rect) const
-{
-    bool boundsOverlap = (minX() < rect.maxX()) && (maxX() > rect.x()) && (minY() < rect.maxY()) && (maxY() > rect.y());
-    if (!boundsOverlap)
-        return false;
-
-    float leftSideValues[4] = {
-        leftSide(vertex1(), vertex2(), rect.minXMinYCorner()),
-        leftSide(vertex1(), vertex2(), rect.maxXMinYCorner()),
-        leftSide(vertex1(), vertex2(), rect.minXMaxYCorner()),
-        leftSide(vertex1(), vertex2(), rect.maxXMaxYCorner())
-    };
-
-    int currentLeftSideSign = 0;
-    for (unsigned i = 0; i < 4; ++i) {
-        if (!leftSideValues[i])
-            continue;
-        int leftSideSign = leftSideValues[i] > 0 ? 1 : -1;
-        if (!currentLeftSideSign)
-            currentLeftSideSign = leftSideSign;
-        else if (currentLeftSideSign != leftSideSign)
-            return true;
-    }
-
-    return false;
-}
-
 bool VertexPair::intersection(const VertexPair& other, FloatPoint& point) const
 {
     // See: http://paulbourke.net/geometry/pointlineplane/, "Intersection point of two lines in 2 dimensions"
@@ -251,4 +224,4 @@ bool VertexPair::intersection(const VertexPair& other, FloatPoint& point) const
     return true;
 }
 
-} // namespace WebCore
+} // namespace blink