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

Unified Diff: ui/gfx/rect.h

Issue 11428076: Inline hot ctor/dtors for struct-like gfx:: geometry types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also inline int size/point/rect 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/point_f.cc ('k') | ui/gfx/rect.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect.h
diff --git a/ui/gfx/rect.h b/ui/gfx/rect.h
index 076f9fc08f525d67b7a8fe75dad2cf9507160d9b..da1d1f15fb0c28c62e2bd29a19bfa1c89791f768 100644
--- a/ui/gfx/rect.h
+++ b/ui/gfx/rect.h
@@ -37,9 +37,16 @@ class Insets;
class UI_EXPORT Rect
: public RectBase<Rect, Point, Size, Insets, Vector2d, int> {
public:
- Rect();
- Rect(int width, int height);
- Rect(int x, int y, int width, int height);
+ Rect() : RectBase<Rect, Point, Size, Insets, Vector2d, int> (Point()) {}
+
+ Rect(int width, int height)
+ : RectBase<Rect, Point, Size, Insets, Vector2d, int> (Size(width, height))
+ {}
+
+ Rect(int x, int y, int width, int height)
+ : RectBase<Rect, Point, Size, Insets, Vector2d, int>(Point(x, y),
+ Size(width, height)) {}
danakj 2012/11/29 18:36:44 the rect_f.h changes look a lot cleaner than these
jamesr 2012/11/29 22:40:40 I can try to reformat to match that. There's no r
+
#if defined(OS_WIN)
explicit Rect(const RECT& r);
#elif defined(OS_MACOSX)
@@ -47,10 +54,14 @@ class UI_EXPORT Rect
#elif defined(TOOLKIT_GTK)
explicit Rect(const GdkRectangle& r);
#endif
- explicit Rect(const gfx::Size& size);
- Rect(const gfx::Point& origin, const gfx::Size& size);
- ~Rect();
+ explicit Rect(const gfx::Size& size)
+ : RectBase<Rect, Point, Size, Insets, Vector2d, int> (size) {}
+
+ Rect(const gfx::Point& origin, const gfx::Size& size)
+ : RectBase<Rect, Point, Size, Insets, Vector2d, int> (origin, size) {}
danakj 2012/11/29 18:36:44 should be 4 spaces before : right?
+
+ ~Rect() {}
#if defined(OS_WIN)
// Construct an equivalent Win32 RECT object.
« no previous file with comments | « ui/gfx/point_f.cc ('k') | ui/gfx/rect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698