| Index: Source/platform/geometry/FloatRect.cpp
|
| diff --git a/Source/platform/geometry/FloatRect.cpp b/Source/platform/geometry/FloatRect.cpp
|
| index 06700dec35ea338425e52d7985b602b130786547..98cdab70cce1fdb6c051122c630e87f386aaa4dc 100644
|
| --- a/Source/platform/geometry/FloatRect.cpp
|
| +++ b/Source/platform/geometry/FloatRect.cpp
|
| @@ -33,9 +33,6 @@
|
| #include "third_party/skia/include/core/SkRect.h"
|
| #include "wtf/MathExtras.h"
|
|
|
| -#include <algorithm>
|
| -#include <math.h>
|
| -
|
| namespace blink {
|
|
|
| FloatRect::FloatRect(const IntRect& r) : m_location(r.location()), m_size(r.size())
|
| @@ -176,65 +173,6 @@ FloatRect unionRect(const Vector<FloatRect>& rects)
|
| return result;
|
| }
|
|
|
| -void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1)
|
| -{
|
| - float left = std::min(p0.x(), p1.x());
|
| - float top = std::min(p0.y(), p1.y());
|
| - float right = std::max(p0.x(), p1.x());
|
| - float bottom = std::max(p0.y(), p1.y());
|
| -
|
| - setLocationAndSizeFromEdges(left, top, right, bottom);
|
| -}
|
| -
|
| -namespace {
|
| -// Helpers for 3- and 4-way max and min.
|
| -
|
| -template <typename T>
|
| -T min3(const T& v1, const T& v2, const T& v3)
|
| -{
|
| - return std::min(std::min(v1, v2), v3);
|
| -}
|
| -
|
| -template <typename T>
|
| -T max3(const T& v1, const T& v2, const T& v3)
|
| -{
|
| - return std::max(std::max(v1, v2), v3);
|
| -}
|
| -
|
| -template <typename T>
|
| -T min4(const T& v1, const T& v2, const T& v3, const T& v4)
|
| -{
|
| - return std::min(std::min(v1, v2), std::min(v3, v4));
|
| -}
|
| -
|
| -template <typename T>
|
| -T max4(const T& v1, const T& v2, const T& v3, const T& v4)
|
| -{
|
| - return std::max(std::max(v1, v2), std::max(v3, v4));
|
| -}
|
| -
|
| -} // anonymous namespace
|
| -
|
| -void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1, const FloatPoint& p2)
|
| -{
|
| - float left = min3(p0.x(), p1.x(), p2.x());
|
| - float top = min3(p0.y(), p1.y(), p2.y());
|
| - float right = max3(p0.x(), p1.x(), p2.x());
|
| - float bottom = max3(p0.y(), p1.y(), p2.y());
|
| -
|
| - setLocationAndSizeFromEdges(left, top, right, bottom);
|
| -}
|
| -
|
| -void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& p3)
|
| -{
|
| - float left = min4(p0.x(), p1.x(), p2.x(), p3.x());
|
| - float top = min4(p0.y(), p1.y(), p2.y(), p3.y());
|
| - float right = max4(p0.x(), p1.x(), p2.x(), p3.x());
|
| - float bottom = max4(p0.y(), p1.y(), p2.y(), p3.y());
|
| -
|
| - setLocationAndSizeFromEdges(left, top, right, bottom);
|
| -}
|
| -
|
| #ifndef NDEBUG
|
| void FloatRect::show() const
|
| {
|
|
|