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

Side by Side Diff: ui/gfx/rect_f.h

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/rect.cc ('k') | ui/gfx/rect_f.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_RECT_F_H_ 5 #ifndef UI_GFX_RECT_F_H_
6 #define UI_GFX_RECT_F_H_ 6 #define UI_GFX_RECT_F_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ui/gfx/point_f.h" 10 #include "ui/gfx/point_f.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }; 42 };
43 43
44 inline bool operator==(const RectF& lhs, const RectF& rhs) { 44 inline bool operator==(const RectF& lhs, const RectF& rhs) {
45 return lhs.origin() == rhs.origin() && lhs.size() == rhs.size(); 45 return lhs.origin() == rhs.origin() && lhs.size() == rhs.size();
46 } 46 }
47 47
48 inline bool operator!=(const RectF& lhs, const RectF& rhs) { 48 inline bool operator!=(const RectF& lhs, const RectF& rhs) {
49 return !(lhs == rhs); 49 return !(lhs == rhs);
50 } 50 }
51 51
52 UI_EXPORT RectF IntersectRects(const RectF& a, const RectF& b);
53 UI_EXPORT RectF UnionRects(const RectF& a, const RectF& b);
54 UI_EXPORT RectF SubtractRects(const RectF& a, const RectF& b);
55 UI_EXPORT RectF ScaleRect(const RectF& r, float x_scale, float y_scale);
56
57 inline RectF ScaleRect(const RectF& r, float scale) {
58 return ScaleRect(r, scale, scale);
59 }
60
52 #if !defined(COMPILER_MSVC) 61 #if !defined(COMPILER_MSVC)
53 extern template class RectBase<RectF, PointF, SizeF, InsetsF, float>; 62 extern template class RectBase<RectF, PointF, SizeF, InsetsF, float>;
54 #endif 63 #endif
55 64
56 } // namespace gfx 65 } // namespace gfx
57 66
58 #endif // UI_GFX_RECT_F_H_ 67 #endif // UI_GFX_RECT_F_H_
OLDNEW
« no previous file with comments | « ui/gfx/rect.cc ('k') | ui/gfx/rect_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698