Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1418)

Unified Diff: Source/platform/geometry/FloatRect.cpp

Issue 1098193002: Remove unused fitToPoints API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/geometry/FloatRect.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
{
« no previous file with comments | « Source/platform/geometry/FloatRect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698