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

Unified Diff: ui/gfx/size.h

Issue 11028127: Implicit coversion operators from integer geometry types to floating point. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 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 | « ui/gfx/rect_unittest.cc ('k') | ui/gfx/size_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/size.h
diff --git a/ui/gfx/size.h b/ui/gfx/size.h
index a2cdf3eb4314257a0b0d03469738053214fe4195..4425207a18fa4b25b3a8bb433a4bd7b9da9940a8 100644
--- a/ui/gfx/size.h
+++ b/ui/gfx/size.h
@@ -43,7 +43,7 @@ class UI_EXPORT Size : public SizeBase<Size, int> {
CGSize ToCGSize() const;
#endif
- SizeF ToSizeF() const {
+ operator SizeF() const {
return SizeF(width(), height());
}
@@ -58,6 +58,14 @@ class UI_EXPORT Size : public SizeBase<Size, int> {
std::string ToString() const;
};
+inline bool operator==(const Size& lhs, const Size& rhs) {
+ return lhs.width() == rhs.width() && lhs.height() == rhs.height();
+}
+
+inline bool operator!=(const Size& lhs, const Size& rhs) {
+ return !(lhs == rhs);
+}
+
#if !defined(COMPILER_MSVC)
extern template class SizeBase<Size, int>;
#endif
« no previous file with comments | « ui/gfx/rect_unittest.cc ('k') | ui/gfx/size_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698