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

Side by Side Diff: gfx/point.cc

Issue 6246027: Move src/gfx/ to src/ui/gfx... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | « gfx/point.h ('k') | 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
(Empty)
1 // Copyright (c) 2006-2008 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 #include "gfx/point.h"
6
7 #if defined(OS_WIN)
8 #include <windows.h>
9 #endif
10
11 #include <ostream>
12
13 namespace gfx {
14
15 Point::Point() : x_(0), y_(0) {
16 }
17
18 Point::Point(int x, int y) : x_(x), y_(y) {
19 }
20
21 #if defined(OS_WIN)
22 Point::Point(DWORD point) {
23 POINTS points = MAKEPOINTS(point);
24 x_ = points.x;
25 y_ = points.y;
26 }
27
28 Point::Point(const POINT& point) : x_(point.x), y_(point.y) {
29 }
30
31 Point& Point::operator=(const POINT& point) {
32 x_ = point.x;
33 y_ = point.y;
34 return *this;
35 }
36
37 POINT Point::ToPOINT() const {
38 POINT p;
39 p.x = x_;
40 p.y = y_;
41 return p;
42 }
43 #elif defined(OS_MACOSX)
44 Point::Point(const CGPoint& point) : x_(point.x), y_(point.y) {
45 }
46
47 CGPoint Point::ToCGPoint() const {
48 return CGPointMake(x_, y_);
49 }
50 #endif
51
52 std::ostream& operator<<(std::ostream& out, const gfx::Point& p) {
53 return out << p.x() << "," << p.y();
54 }
55
56 } // namespace gfx
OLDNEW
« no previous file with comments | « gfx/point.h ('k') | gfx/rect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698