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

Unified Diff: base/numerics/saturated_arithmetic_arm.h

Issue 2744423002: Handle large rects better. (Closed)
Patch Set: Add comment and change constant reference. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/numerics/saturated_arithmetic.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/numerics/saturated_arithmetic_arm.h
diff --git a/base/numerics/saturated_arithmetic_arm.h b/base/numerics/saturated_arithmetic_arm.h
index e5017e4ea37e685649e28d1ca2d93f3dee27a2d8..732f5f2c1f5f5668387649f0e1b2b0fd6b4a51ff 100644
--- a/base/numerics/saturated_arithmetic_arm.h
+++ b/base/numerics/saturated_arithmetic_arm.h
@@ -33,6 +33,12 @@ inline int32_t SaturatedNegative(int32_t a) {
return SaturatedSubtraction(0, a);
}
+inline int32_t SaturatedAbsolute(int32_t a) {
+ if (a >= 0)
+ return a;
+ return SaturatedNegative(a);
+}
+
inline int GetMaxSaturatedSetResultForTesting(int fractional_shift) {
// For ARM Asm version the set function maxes out to the biggest
// possible integer part with the fractional part zero'd out.
« no previous file with comments | « base/numerics/saturated_arithmetic.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698