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

Side by Side Diff: Source/platform/geometry/DoublePoint.h

Issue 641643004: Reapply the non-MathExtras parts of (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « Source/platform/fonts/FontDescription.h ('k') | Source/platform/geometry/DoubleSize.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 DoublePoint_h 5 #ifndef DoublePoint_h
6 #define DoublePoint_h 6 #define DoublePoint_h
7 7
8 #include "platform/geometry/DoubleSize.h" 8 #include "platform/geometry/DoubleSize.h"
9 #include "platform/geometry/FloatPoint.h" 9 #include "platform/geometry/FloatPoint.h"
10 #include "platform/geometry/IntPoint.h" 10 #include "platform/geometry/IntPoint.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return DoubleSize(a.x() - b.x(), a.y() - b.y()); 76 return DoubleSize(a.x() - b.x(), a.y() - b.y());
77 } 77 }
78 78
79 inline DoublePoint operator-(const DoublePoint& a) 79 inline DoublePoint operator-(const DoublePoint& a)
80 { 80 {
81 return DoublePoint(-a.x(), -a.y()); 81 return DoublePoint(-a.x(), -a.y());
82 } 82 }
83 83
84 inline IntPoint flooredIntPoint(const DoublePoint& p) 84 inline IntPoint flooredIntPoint(const DoublePoint& p)
85 { 85 {
86 return IntPoint(clampToInteger(floor(p.x())), clampToInteger(floor(p.y()))); 86 return IntPoint(clampTo<int>(floor(p.x())), clampTo<int>(floor(p.y())));
87 } 87 }
88 88
89 inline FloatPoint toFloatPoint(const DoublePoint& a) 89 inline FloatPoint toFloatPoint(const DoublePoint& a)
90 { 90 {
91 return FloatPoint(a.x(), a.y()); 91 return FloatPoint(a.x(), a.y());
92 } 92 }
93 93
94 inline DoubleSize toDoubleSize(const DoublePoint& a) 94 inline DoubleSize toDoubleSize(const DoublePoint& a)
95 { 95 {
96 return DoubleSize(a.x(), a.y()); 96 return DoubleSize(a.x(), a.y());
97 } 97 }
98 98
99 } 99 }
100 100
101 #endif 101 #endif
OLDNEW
« no previous file with comments | « Source/platform/fonts/FontDescription.h ('k') | Source/platform/geometry/DoubleSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698