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

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

Issue 11414265: gfx: Inline the constructors and destructors for RectBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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_base.h ('k') | no next file » | 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 #include "ui/gfx/rect_base.h" 5 #include "ui/gfx/rect_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 9
10 // This file provides the implementation for RectBaese template and 10 // This file provides the implementation for RectBaese template and
(...skipping 16 matching lines...) Expand all
27 } // namespace 27 } // namespace
28 28
29 namespace gfx { 29 namespace gfx {
30 30
31 template<typename Class, 31 template<typename Class,
32 typename PointClass, 32 typename PointClass,
33 typename SizeClass, 33 typename SizeClass,
34 typename InsetsClass, 34 typename InsetsClass,
35 typename VectorClass, 35 typename VectorClass,
36 typename Type> 36 typename Type>
37 RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
38 RectBase(const PointClass& origin, const SizeClass& size)
39 : origin_(origin), size_(size) {
40 }
41
42 template<typename Class,
43 typename PointClass,
44 typename SizeClass,
45 typename InsetsClass,
46 typename VectorClass,
47 typename Type>
48 RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
49 RectBase(const SizeClass& size)
50 : size_(size) {
51 }
52
53 template<typename Class,
54 typename PointClass,
55 typename SizeClass,
56 typename InsetsClass,
57 typename VectorClass,
58 typename Type>
59 RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
60 RectBase(const PointClass& origin)
61 : origin_(origin) {
62 }
63
64 template<typename Class,
65 typename PointClass,
66 typename SizeClass,
67 typename InsetsClass,
68 typename VectorClass,
69 typename Type>
70 RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
71 ~RectBase() {}
72
73 template<typename Class,
74 typename PointClass,
75 typename SizeClass,
76 typename InsetsClass,
77 typename VectorClass,
78 typename Type>
79 void RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>:: 37 void RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
80 SetRect(Type x, Type y, Type width, Type height) { 38 SetRect(Type x, Type y, Type width, Type height) {
81 origin_.SetPoint(x, y); 39 origin_.SetPoint(x, y);
82 set_width(width); 40 set_width(width);
83 set_height(height); 41 set_height(height);
84 } 42 }
85 43
86 template<typename Class, 44 template<typename Class,
87 typename PointClass, 45 typename PointClass,
88 typename SizeClass, 46 typename SizeClass,
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 typename Type> 307 typename Type>
350 bool RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>:: 308 bool RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
351 SharesEdgeWith(const Class& rect) const { 309 SharesEdgeWith(const Class& rect) const {
352 return (y() == rect.y() && height() == rect.height() && 310 return (y() == rect.y() && height() == rect.height() &&
353 (x() == rect.right() || right() == rect.x())) || 311 (x() == rect.right() || right() == rect.x())) ||
354 (x() == rect.x() && width() == rect.width() && 312 (x() == rect.x() && width() == rect.width() &&
355 (y() == rect.bottom() || bottom() == rect.y())); 313 (y() == rect.bottom() || bottom() == rect.y()));
356 } 314 }
357 315
358 } // namespace gfx 316 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/rect_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698