diff options
author | Lei Zhang <thestig@chromium.org> | 2016-01-08 15:31:47 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-01-08 15:31:47 -0800 |
commit | 9adfbb0920a258e916003b1ee9515e97879db82a (patch) | |
tree | 69c568cf9857ea028da91cc3a73f15a21a2c4c73 /fpdfsdk/src/pdfwindow/PWL_Utils.cpp | |
parent | e5ae7226fc3ffad3f76995d31a0f6b2254d50656 (diff) | |
download | pdfium-9adfbb0920a258e916003b1ee9515e97879db82a.tar.xz |
Switch most min/max macros to std::min/max.
Fix lint errors along the way.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1567343002 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Utils.cpp')
-rw-r--r-- | fpdfsdk/src/pdfwindow/PWL_Utils.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp index 3b0f3beff9..27ba8bc99f 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp @@ -4,8 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "fpdfsdk/include/pdfwindow/PWL_Icon.h" #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" + +#include <algorithm> + +#include "fpdfsdk/include/pdfwindow/PWL_Icon.h" #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) @@ -1256,7 +1259,7 @@ void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC, if (dC < 0 || dC > 1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || dK > 1) return; - dGray = 1.0f - FX_MIN(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK); + dGray = 1.0f - std::min(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK); } void CPWL_Utils::ConvertGRAY2CMYK(FX_FLOAT dGray, @@ -1302,9 +1305,9 @@ void CPWL_Utils::ConvertCMYK2RGB(FX_FLOAT dC, if (dC < 0 || dC > 1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || dK > 1) return; - dR = 1.0f - FX_MIN(1.0f, dC + dK); - dG = 1.0f - FX_MIN(1.0f, dM + dK); - dB = 1.0f - FX_MIN(1.0f, dY + dK); + dR = 1.0f - std::min(1.0f, dC + dK); + dG = 1.0f - std::min(1.0f, dM + dK); + dB = 1.0f - std::min(1.0f, dY + dK); } void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR, @@ -1320,7 +1323,7 @@ void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR, dC = 1.0f - dR; dM = 1.0f - dG; dY = 1.0f - dB; - dK = FX_MIN(dC, FX_MIN(dM, dY)); + dK = std::min(dC, std::min(dM, dY)); } void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, |