Home
last modified time | relevance | path

Searched refs:ClampToInt (Results 1 – 2 of 2) sorted by relevance

/external/chromium_org/ui/gfx/
Dsafe_integer_conversions_unittest.cc13 TEST(SafeIntegerConversions, ClampToInt) { in TEST() argument
14 EXPECT_EQ(0, ClampToInt(std::numeric_limits<float>::quiet_NaN())); in TEST()
23 EXPECT_EQ(int_max, ClampToInt(infinity)); in TEST()
24 EXPECT_EQ(int_max, ClampToInt(max)); in TEST()
25 EXPECT_EQ(int_max, ClampToInt(max + 100)); in TEST()
27 EXPECT_EQ(-100, ClampToInt(-100.5f)); in TEST()
28 EXPECT_EQ(0, ClampToInt(0)); in TEST()
29 EXPECT_EQ(100, ClampToInt(100.5f)); in TEST()
31 EXPECT_EQ(int_min, ClampToInt(-infinity)); in TEST()
32 EXPECT_EQ(int_min, ClampToInt(min)); in TEST()
[all …]
Dsafe_integer_conversions.h15 inline int ClampToInt(float value) { in ClampToInt() function
26 return ClampToInt(std::floor(value)); in ToFlooredInt()
30 return ClampToInt(std::ceil(value)); in ToCeiledInt()
39 return ClampToInt(rounded); in ToRoundedInt()