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

Unified Diff: ui/gfx/rect_f.cc

Issue 109433013: Move geometric types to a separate, more lightweight target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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
Index: ui/gfx/rect_f.cc
diff --git a/ui/gfx/rect_f.cc b/ui/gfx/rect_f.cc
deleted file mode 100644
index c55752aa843e0dea806df6fe2c98100293c66f7f..0000000000000000000000000000000000000000
--- a/ui/gfx/rect_f.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gfx/rect_f.h"
-
-#include <algorithm>
-
-#include "base/logging.h"
-#include "base/strings/stringprintf.h"
-#include "ui/gfx/insets_f.h"
-#include "ui/gfx/rect_base_impl.h"
-#include "ui/gfx/safe_integer_conversions.h"
-
-namespace gfx {
-
-template class RectBase<RectF, PointF, SizeF, InsetsF, Vector2dF, float>;
-
-typedef class RectBase<RectF, PointF, SizeF, InsetsF, Vector2dF,
- float> RectBaseT;
-
-bool RectF::IsExpressibleAsRect() const {
- return IsExpressibleAsInt(x()) && IsExpressibleAsInt(y()) &&
- IsExpressibleAsInt(width()) && IsExpressibleAsInt(height()) &&
- IsExpressibleAsInt(right()) && IsExpressibleAsInt(bottom());
-}
-
-std::string RectF::ToString() const {
- return base::StringPrintf("%s %s",
- origin().ToString().c_str(),
- size().ToString().c_str());
-}
-
-RectF IntersectRects(const RectF& a, const RectF& b) {
- RectF result = a;
- result.Intersect(b);
- return result;
-}
-
-RectF UnionRects(const RectF& a, const RectF& b) {
- RectF result = a;
- result.Union(b);
- return result;
-}
-
-RectF SubtractRects(const RectF& a, const RectF& b) {
- RectF result = a;
- result.Subtract(b);
- return result;
-}
-
-RectF BoundingRect(const PointF& p1, const PointF& p2) {
- float rx = std::min(p1.x(), p2.x());
- float ry = std::min(p1.y(), p2.y());
- float rr = std::max(p1.x(), p2.x());
- float rb = std::max(p1.y(), p2.y());
- return RectF(rx, ry, rr - rx, rb - ry);
-}
-
-} // namespace gfx
« ui/aura/aura.gyp ('K') | « ui/gfx/rect_f.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698