Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_BASE_MATH_UTIL_H_ | 5 #ifndef CC_BASE_MATH_UTIL_H_ |
| 6 #define CC_BASE_MATH_UTIL_H_ | 6 #define CC_BASE_MATH_UTIL_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 static bool FromValue(const base::Value*, gfx::Rect* out_rect); | 170 static bool FromValue(const base::Value*, gfx::Rect* out_rect); |
| 171 static scoped_ptr<base::Value> AsValue(gfx::PointF q); | 171 static scoped_ptr<base::Value> AsValue(gfx::PointF q); |
| 172 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); | 172 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); |
| 173 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); | 173 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); |
| 174 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); | 174 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); |
| 175 | 175 |
| 176 // Returns a base::Value representation of the floating point value. | 176 // Returns a base::Value representation of the floating point value. |
| 177 // If the value is inf, returns max double/float representation. | 177 // If the value is inf, returns max double/float representation. |
| 178 static scoped_ptr<base::Value> AsValueSafely(double value); | 178 static scoped_ptr<base::Value> AsValueSafely(double value); |
| 179 static scoped_ptr<base::Value> AsValueSafely(float value); | 179 static scoped_ptr<base::Value> AsValueSafely(float value); |
| 180 | |
| 181 // Check if matrices are of a certain type using approximate math. Each | |
| 182 // function gets a tolerance parameter to specify the maximum allowed | |
| 183 // absolute difference to the exact values. | |
| 184 static bool IsMatrixApproximatelyPureTranslation(const SkMatrix44& matrix, | |
|
danakj
2013/10/15 15:34:35
s/Pure//
Dominik Grewe
2013/10/15 17:04:19
I think "Pure" was chosen to indicate that the mat
| |
| 185 SkMScalar tolerance); | |
| 186 static bool IsMatrixApproximatelyIntegerTransform(const SkMatrix44& matrix, | |
| 187 SkMScalar tolerance); | |
| 180 }; | 188 }; |
| 181 | 189 |
| 182 } // namespace cc | 190 } // namespace cc |
| 183 | 191 |
| 184 #endif // CC_BASE_MATH_UTIL_H_ | 192 #endif // CC_BASE_MATH_UTIL_H_ |
| OLD | NEW |