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

Side by Side Diff: gfx/point.h

Issue 3013015: Initial pass at integrating Differ into the chromoting host code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « no previous file | gfx/rect.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 GFX_POINT_H_ 5 #ifndef GFX_POINT_H_
6 #define GFX_POINT_H_ 6 #define GFX_POINT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 bool operator==(const Point& rhs) const { 68 bool operator==(const Point& rhs) const {
69 return x_ == rhs.x_ && y_ == rhs.y_; 69 return x_ == rhs.x_ && y_ == rhs.y_;
70 } 70 }
71 71
72 bool operator!=(const Point& rhs) const { 72 bool operator!=(const Point& rhs) const {
73 return !(*this == rhs); 73 return !(*this == rhs);
74 } 74 }
75 75
76 // A point is less than another point if its y-value is closer
77 // to the origin. If the y-values are the same, then point with
78 // the x-value closer to the origin is considered less than the
79 // other.
80 // This comparison is required to use Points in sets, or sorted
81 // vectors.
82 bool operator<(const Point& rhs) const {
83 return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_);
84 }
85
76 #if defined(OS_WIN) 86 #if defined(OS_WIN)
77 POINT ToPOINT() const; 87 POINT ToPOINT() const;
78 #elif defined(OS_MACOSX) 88 #elif defined(OS_MACOSX)
79 CGPoint ToCGPoint() const; 89 CGPoint ToCGPoint() const;
80 #endif 90 #endif
81 91
82 private: 92 private:
83 int x_; 93 int x_;
84 int y_; 94 int y_;
85 }; 95 };
86 96
87 } // namespace gfx 97 } // namespace gfx
88 98
89 std::ostream& operator<<(std::ostream& out, const gfx::Point& p); 99 std::ostream& operator<<(std::ostream& out, const gfx::Point& p);
90 100
91 #endif // GFX_POINT_H_ 101 #endif // GFX_POINT_H_
OLDNEW
« no previous file with comments | « no previous file | gfx/rect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698