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

Unified Diff: third_party/WebKit/Source/platform/LayoutUnit.h

Issue 2171813002: Better performance for -LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | third_party/WebKit/Source/wtf/SaturatedArithmetic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/LayoutUnit.h
diff --git a/third_party/WebKit/Source/platform/LayoutUnit.h b/third_party/WebKit/Source/platform/LayoutUnit.h
index f8fd072314a06f65754c9f9277faa8a0d42a32cd..16677770cb0f7be5762cf5721fd9ef0027c4a294 100644
--- a/third_party/WebKit/Source/platform/LayoutUnit.h
+++ b/third_party/WebKit/Source/platform/LayoutUnit.h
@@ -644,12 +644,8 @@ inline float operator-(const float a, const LayoutUnit& b)
inline LayoutUnit operator-(const LayoutUnit& a)
{
- // -min() is saturated to max().
- if (a == LayoutUnit::min())
- return LayoutUnit::max();
-
LayoutUnit returnVal;
- returnVal.setRawValue(-a.rawValue());
+ returnVal.setRawValue(saturatedNegative(a.rawValue()));
return returnVal;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/SaturatedArithmetic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698