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

Unified Diff: ui/gfx/geometry/scale.h

Issue 1315633002: gfx: Converge scale precision related differences to single class. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected simple nit. Created 5 years, 4 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 | « ui/gfx/geometry/BUILD.gn ('k') | ui/gfx/geometry/scale.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/scale.h
diff --git a/ui/gfx/geometry/scale.h b/ui/gfx/geometry/scale.h
new file mode 100644
index 0000000000000000000000000000000000000000..9997a9cb4b60e949b412542324bed98b1ac54902
--- /dev/null
+++ b/ui/gfx/geometry/scale.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2015 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.
+
+#ifndef UI_GFX_GEOMETRY_SCALE_H_
+#define UI_GFX_GEOMETRY_SCALE_H_
+
+#include "ui/gfx/gfx_export.h"
+
+namespace gfx {
+
+class GFX_EXPORT Scale {
+ public:
+ explicit Scale(float value);
+ explicit Scale(const Scale& other);
+
+ float Value() const { return value_; }
+ float AbsoluteValue() const { return absolute_value_; }
+
+ Scale& operator=(const Scale& other);
+ bool operator<(const Scale& other) const;
+ bool operator>(const Scale& other) const;
+
+ private:
+ float absolute_value_;
+ float value_;
+};
+
+inline bool operator==(const Scale& lhs, const Scale& rhs) {
+ return lhs.Value() == rhs.Value();
+}
+
+inline bool operator!=(const Scale& lhs, const Scale& rhs) {
+ return lhs.Value() != rhs.Value();
+}
+
+} // namespace gfx
+
+#endif // UI_GFX_GEOMETRY_SCALE_H_
« no previous file with comments | « ui/gfx/geometry/BUILD.gn ('k') | ui/gfx/geometry/scale.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698