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

Side by Side Diff: cc/math/int_point.h

Issue 10984053: cc: Use ui/gfx geometry types for the CCRenderPass and CCDrawQuad classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_MATH_INT_POINT_H_
6 #define CC_MATH_INT_POINT_H_
7
8 #include "cc/math/int_vector_2d.h"
9
10 namespace ccmath {
11
12 class IntPoint {
13 public:
tfarina 2012/09/28 19:39:30 if this were to follow chromium coding style, this
14 IntPoint()
15 : m_x(0),
16 m_y(0) {
17 }
18 IntPoint(int x, int y)
19 : m_x(x),
20 m_y(y) {
21 }
22 IntPoint(const IntPoint& point)
23 : m_x(point.m_x),
24 m_y(point.m_y) {
25 }
26
27 int x() const { return m_x; }
28 int y() const { return m_y; }
29
30 void set_x(int x) { m_x = x; }
31 void set_y(int y) { m_y = y; }
32
33 private:
34 int m_x;
tfarina 2012/09/28 19:39:30 and thus this would have to be |x_|
35 int m_y;
36 };
37
38 inline bool operator==(const IntPoint& a, const IntPoint& b) {
39 return a.x() == b.x() && a.y() == b.y();
40 }
41
42 inline bool operator!=(const IntPoint& a, const IntPoint& b) {
43 return !(a == b);
44 }
45
46 inline IntPoint operator+(const IntPoint& p, const IntVector2d& v) {
47 return IntPoint(p.x() + v.v1(), p.y() + v.v2());
48 }
49
50 inline IntVector2d operator-(const IntPoint& a, const IntPoint& b) {
51 return IntVector2d(a.x() - b.x(), a.y() - b.y());
52 }
53
54 } // namespace ccmath
tfarina 2012/09/28 19:39:30 } // namespace ccmatch ^ two spaces between } a
55
56 #endif // CC_MATH_INT_POINT_H_
OLDNEW
« cc/math/clamp.h ('K') | « cc/math/float_vector_2d.h ('k') | cc/math/int_rect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698