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

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: fix style issues 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..52856d77031966c702568142d912a195de529d69 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)) {}
+
#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) {}
+
+ ~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