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

Unified Diff: third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp

Issue 1530723004: Use clampTo instead of chaining std::max(std::min(...)) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handling that minimumThumbLength > trackLen. Created 5 years 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/platform/graphics/filters/SpotLightSource.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp
index 2eb311e64a794f0cef82d89be7ab8e8805a182ed..752685fcb39baa974ff0608aca51298557ecd88b 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp
@@ -33,7 +33,7 @@
#include "platform/graphics/filters/SpotLightSource.h"
#include "platform/text/TextStream.h"
-#include <algorithm>
+#include "wtf/MathExtras.h"
namespace blink {
@@ -55,7 +55,7 @@ bool SpotLightSource::setPointsAt(const FloatPoint3D& direction)
bool SpotLightSource::setSpecularExponent(float specularExponent)
{
- specularExponent = std::min(std::max(specularExponent, 1.0f), 128.0f);
+ specularExponent = clampTo(specularExponent, 1.0f, 128.0f);
if (m_specularExponent == specularExponent)
return false;
m_specularExponent = specularExponent;

Powered by Google App Engine
This is Rietveld 408576698