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

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

Issue 25494003: Move geometry classes from core/platform/graphics to platform/geometry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/LayoutRect.h ('k') | Source/platform/geometry/LayoutSize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/geometry/LayoutRect.cpp
diff --git a/Source/core/platform/graphics/LayoutRect.cpp b/Source/platform/geometry/LayoutRect.cpp
similarity index 87%
rename from Source/core/platform/graphics/LayoutRect.cpp
rename to Source/platform/geometry/LayoutRect.cpp
index 217c49a1e384132301a6913277e5a8e642a657be..37aa2ca38b71cf33436f4911cc2756e0061e8e56 100644
--- a/Source/core/platform/graphics/LayoutRect.cpp
+++ b/Source/platform/geometry/LayoutRect.cpp
@@ -29,14 +29,11 @@
*/
#include "config.h"
-#include "core/platform/graphics/LayoutRect.h"
+#include "platform/geometry/LayoutRect.h"
-#include <algorithm>
-#include "core/platform/graphics/FloatRect.h"
#include "platform/LayoutUnit.h"
-
-using std::max;
-using std::min;
+#include "platform/geometry/FloatRect.h"
+#include <algorithm>
namespace WebCore {
@@ -62,8 +59,8 @@ bool LayoutRect::contains(const LayoutRect& other) const
void LayoutRect::intersect(const LayoutRect& other)
{
- LayoutPoint newLocation(max(x(), other.x()), max(y(), other.y()));
- LayoutPoint newMaxPoint(min(maxX(), other.maxX()), min(maxY(), other.maxY()));
+ LayoutPoint newLocation(std::max(x(), other.x()), std::max(y(), other.y()));
+ LayoutPoint newMaxPoint(std::min(maxX(), other.maxX()), std::min(maxY(), other.maxY()));
// Return a clean empty rectangle for non-intersecting cases.
if (newLocation.x() >= newMaxPoint.x() || newLocation.y() >= newMaxPoint.y()) {
@@ -85,8 +82,8 @@ void LayoutRect::unite(const LayoutRect& other)
return;
}
- LayoutPoint newLocation(min(x(), other.x()), min(y(), other.y()));
- LayoutPoint newMaxPoint(max(maxX(), other.maxX()), max(maxY(), other.maxY()));
+ LayoutPoint newLocation(std::min(x(), other.x()), std::min(y(), other.y()));
+ LayoutPoint newMaxPoint(std::max(maxX(), other.maxX()), std::max(maxY(), other.maxY()));
m_location = newLocation;
m_size = newMaxPoint - newLocation;
@@ -102,8 +99,8 @@ void LayoutRect::uniteIfNonZero(const LayoutRect& other)
return;
}
- LayoutPoint newLocation(min(x(), other.x()), min(y(), other.y()));
- LayoutPoint newMaxPoint(max(maxX(), other.maxX()), max(maxY(), other.maxY()));
+ LayoutPoint newLocation(std::min(x(), other.x()), std::min(y(), other.y()));
+ LayoutPoint newMaxPoint(std::max(maxX(), other.maxX()), std::max(maxY(), other.maxY()));
m_location = newLocation;
m_size = newMaxPoint - newLocation;
« no previous file with comments | « Source/platform/geometry/LayoutRect.h ('k') | Source/platform/geometry/LayoutSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698