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

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: More rebase 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 6b0b61351af0fae0d9fadf053a6ae47ae8d8e7f7..004ac41e89cece505960abe092f9766b278a8ec9 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp
@@ -32,7 +32,7 @@
#include "platform/graphics/filters/SpotLightSource.h"
#include "platform/text/TextStream.h"
-#include <algorithm>
+#include "wtf/MathExtras.h"
namespace blink {
@@ -54,7 +54,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