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

Side by Side Diff: ui/gfx/geometry/safe_integer_conversions.h

Issue 109433013: Move geometric types to a separate, more lightweight target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GFX_SAFE_INTEGER_CONVERSIONS_H_ 5 #ifndef UI_GFX_GEOMETRY_SAFE_INTEGER_CONVERSIONS_H_
6 #define UI_GFX_SAFE_INTEGER_CONVERSIONS_H_ 6 #define UI_GFX_GEOMETRY_SAFE_INTEGER_CONVERSIONS_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
11 #include "ui/gfx/gfx_export.h" 11 #include "ui/gfx/gfx_export.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 14
15 inline int ClampToInt(float value) { 15 inline int ClampToInt(float value) {
16 if (value != value) 16 if (value != value)
(...skipping 27 matching lines...) Expand all
44 return false; // no int NaN. 44 return false; // no int NaN.
45 if (value > std::numeric_limits<int>::max()) 45 if (value > std::numeric_limits<int>::max())
46 return false; 46 return false;
47 if (value < std::numeric_limits<int>::min()) 47 if (value < std::numeric_limits<int>::min())
48 return false; 48 return false;
49 return true; 49 return true;
50 } 50 }
51 51
52 } // namespace gfx 52 } // namespace gfx
53 53
54 #endif // UI_GFX_SAFE_INTEGER_CONVERSIONS_H_ 54 #endif // UI_GFX_GEOMETRY_SAFE_INTEGER_CONVERSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698