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

Unified Diff: third_party/WebKit/Source/wtf/SaturatedArithmetic.h

Issue 1456173004: wtf: Eliminate inliner abuse in saturatedSet function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: third_party/WebKit/Source/wtf/SaturatedArithmetic.h
diff --git a/third_party/WebKit/Source/wtf/SaturatedArithmetic.h b/third_party/WebKit/Source/wtf/SaturatedArithmetic.h
index 2f2aeaccae7e5d2fc21bba7c486facc1b6bf0d27..a627b532ddc9e310b6210422ed4bd847cec7a7dd 100644
--- a/third_party/WebKit/Source/wtf/SaturatedArithmetic.h
+++ b/third_party/WebKit/Source/wtf/SaturatedArithmetic.h
@@ -86,7 +86,8 @@ inline int getMinSaturatedSetResultForTesting(int FractionalShift)
return std::numeric_limits<int>::min();
}
-ALWAYS_INLINE int saturatedSet(int value, int FractionalShift)
+template <int FractionalShift>
+ALWAYS_INLINE int saturatedSet(int value)
{
const int intMaxForLayoutUnit =
std::numeric_limits<int>::max() >> FractionalShift;
@@ -104,7 +105,8 @@ ALWAYS_INLINE int saturatedSet(int value, int FractionalShift)
}
-ALWAYS_INLINE int saturatedSet(unsigned value, int FractionalShift)
+template <int FractionalShift>
+ALWAYS_INLINE int saturatedSet(unsigned value)
{
const unsigned intMaxForLayoutUnit =
std::numeric_limits<int>::max() >> FractionalShift;
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutUnit.h ('k') | third_party/WebKit/Source/wtf/SaturatedArithmeticTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698