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

Side by Side Diff: Source/platform/geometry/DoubleSize.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/geometry/DoublePoint.h ('k') | Source/platform/geometry/FloatPoint.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 DoubleSize_h 5 #ifndef DoubleSize_h
6 #define DoubleSize_h 6 #define DoubleSize_h
7 7
8 #include "platform/geometry/FloatSize.h" 8 #include "platform/geometry/FloatSize.h"
9 #include "platform/geometry/IntSize.h" 9 #include "platform/geometry/IntSize.h"
10 #include "wtf/MathExtras.h" 10 #include "wtf/MathExtras.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return a.width() == b.width() && a.height() == b.height(); 53 return a.width() == b.width() && a.height() == b.height();
54 } 54 }
55 55
56 inline bool operator!=(const DoubleSize& a, const DoubleSize& b) 56 inline bool operator!=(const DoubleSize& a, const DoubleSize& b)
57 { 57 {
58 return a.width() != b.width() || a.height() != b.height(); 58 return a.width() != b.width() || a.height() != b.height();
59 } 59 }
60 60
61 inline IntSize flooredIntSize(const DoubleSize& p) 61 inline IntSize flooredIntSize(const DoubleSize& p)
62 { 62 {
63 return IntSize(clampToInteger(floor(p.width())), clampToInteger(floor(p.heig ht()))); 63 return IntSize(clampTo<int>(floor(p.width())), clampTo<int>(floor(p.height() )));
64 } 64 }
65 65
66 inline FloatSize toFloatSize(const DoubleSize& p) 66 inline FloatSize toFloatSize(const DoubleSize& p)
67 { 67 {
68 return FloatSize(p.width(), p.height()); 68 return FloatSize(p.width(), p.height());
69 } 69 }
70 70
71 } // namespace blink 71 } // namespace blink
72 72
73 #endif // DoubleSize_h 73 #endif // DoubleSize_h
OLDNEW
« no previous file with comments | « Source/platform/geometry/DoublePoint.h ('k') | Source/platform/geometry/FloatPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698