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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/LayoutPoint.h

Issue 2491703004: Replace roundedLayoutPoint with LayoutPoint (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('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 /* 1 /*
2 * Copyright (c) 2012, Google Inc. All rights reserved. 2 * Copyright (c) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 inline LayoutPoint ceiledLayoutPoint(const FloatPoint& p) { 198 inline LayoutPoint ceiledLayoutPoint(const FloatPoint& p) {
199 return LayoutPoint(LayoutUnit::fromFloatCeil(p.x()), 199 return LayoutPoint(LayoutUnit::fromFloatCeil(p.x()),
200 LayoutUnit::fromFloatCeil(p.y())); 200 LayoutUnit::fromFloatCeil(p.y()));
201 } 201 }
202 202
203 inline IntSize pixelSnappedIntSize(const LayoutSize& s, const LayoutPoint& p) { 203 inline IntSize pixelSnappedIntSize(const LayoutSize& s, const LayoutPoint& p) {
204 return IntSize(snapSizeToPixel(s.width(), p.x()), 204 return IntSize(snapSizeToPixel(s.width(), p.x()),
205 snapSizeToPixel(s.height(), p.y())); 205 snapSizeToPixel(s.height(), p.y()));
206 } 206 }
207 207
208 inline LayoutPoint roundedLayoutPoint(const FloatPoint& p) {
209 return LayoutPoint(p);
210 }
211
212 inline IntSize roundedIntSize(const LayoutPoint& p) { 208 inline IntSize roundedIntSize(const LayoutPoint& p) {
213 return IntSize(p.x().round(), p.y().round()); 209 return IntSize(p.x().round(), p.y().round());
214 } 210 }
215 211
216 inline LayoutSize toLayoutSize(const LayoutPoint& p) { 212 inline LayoutSize toLayoutSize(const LayoutPoint& p) {
217 return LayoutSize(p.x(), p.y()); 213 return LayoutSize(p.x(), p.y());
218 } 214 }
219 215
220 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) { 216 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) {
221 return flooredLayoutPoint(FloatPoint(s)); 217 return flooredLayoutPoint(FloatPoint(s));
222 } 218 }
223 219
224 // Redeclared here to avoid ODR issues. 220 // Redeclared here to avoid ODR issues.
225 // See platform/testing/GeometryPrinters.h. 221 // See platform/testing/GeometryPrinters.h.
226 void PrintTo(const LayoutPoint&, std::ostream*); 222 void PrintTo(const LayoutPoint&, std::ostream*);
227 223
228 } // namespace blink 224 } // namespace blink
229 225
230 #endif // LayoutPoint_h 226 #endif // LayoutPoint_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698