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

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

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.h
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h
index 6de25ff59168423d5a8fb24ceeaf1fdc58d6914d..e00546072bd35ad48e924e0c2f338fc0e11fb5b3 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h
+++ b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h
@@ -24,7 +24,7 @@
#define SpotLightSource_h
#include "platform/graphics/filters/LightSource.h"
-#include <algorithm>
+#include "wtf/MathExtras.h"
namespace blink {
@@ -55,7 +55,7 @@ private:
: LightSource(LS_SPOT)
, m_position(position)
, m_direction(direction)
- , m_specularExponent(std::min(std::max(specularExponent, 1.0f), 128.0f))
+ , m_specularExponent(clampTo(specularExponent, 1.0f, 128.0f))
, m_limitingConeAngle(limitingConeAngle)
{
}

Powered by Google App Engine
This is Rietveld 408576698