summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_utils.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
committerLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
commit375a86403b7fa8d17d7b142c270e2d8e33bb924f (patch)
tree1db1ffddb2bbbcd429cd1d7954b1949bfa54e1ab /core/src/fpdfdoc/doc_utils.cpp
parent492961df3011ccc25646eae12ac6e6dcfe7f26da (diff)
downloadpdfium-375a86403b7fa8d17d7b142c270e2d8e33bb924f.tar.xz
Merge to XFA: Switch most min/max macros to std::min/max.
Fix lint errors along the way. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 . (cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a) Review URL: https://codereview.chromium.org/1577503002 .
Diffstat (limited to 'core/src/fpdfdoc/doc_utils.cpp')
-rw-r--r--core/src/fpdfdoc/doc_utils.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp
index 89836739b3..4856cb51e5 100644
--- a/core/src/fpdfdoc/doc_utils.cpp
+++ b/core/src/fpdfdoc/doc_utils.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "doc_utils.h"
@@ -179,9 +181,9 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color,
FX_FLOAT m = FX_atof((CFX_ByteString)syntax.GetWord());
FX_FLOAT y = FX_atof((CFX_ByteString)syntax.GetWord());
FX_FLOAT k = FX_atof((CFX_ByteString)syntax.GetWord());
- FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
- FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
- FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
+ FX_FLOAT r = 1.0f - std::min(1.0f, c + k);
+ FX_FLOAT g = 1.0f - std::min(1.0f, m + k);
+ FX_FLOAT b = 1.0f - std::min(1.0f, y + k);
color = ArgbEncode(255, (int)(r * 255 + 0.5f), (int)(g * 255 + 0.5f),
(int)(b * 255 + 0.5f));
}