summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-21 13:37:06 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-21 13:37:06 +0000
commit4f7479ad5bd977eff1d08c65c44cb8d3950a2d77 (patch)
treecc6d1cae52603b508fe68c0fb326050032f3ec09 /core/fpdfdoc
parent78faa4365445f69890dc990e4d07a68e68e89ae4 (diff)
downloadpdfium-4f7479ad5bd977eff1d08c65c44cb8d3950a2d77.tar.xz
Change FXSYS_RGB() to FXSYS_BGR().
Also change it from a macro to a constexpr function. Change-Id: I8b2bb42c45a23da6db136abdaee24132db4471c6 Reviewed-on: https://pdfium-review.googlesource.com/28579 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/cpdf_bookmark.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpdf_bookmark.cpp b/core/fpdfdoc/cpdf_bookmark.cpp
index cc7e127d23..5f8997d647 100644
--- a/core/fpdfdoc/cpdf_bookmark.cpp
+++ b/core/fpdfdoc/cpdf_bookmark.cpp
@@ -14,6 +14,12 @@
#include "core/fpdfdoc/cpdf_nametree.h"
#include "core/fxge/fx_dib.h"
+namespace {
+
+constexpr uint32_t kBlackBGR = FXSYS_BGR(0, 0, 0);
+
+} // namespace
+
CPDF_Bookmark::CPDF_Bookmark() {}
CPDF_Bookmark::CPDF_Bookmark(const CPDF_Bookmark& that) = default;
@@ -24,16 +30,16 @@ CPDF_Bookmark::~CPDF_Bookmark() {}
uint32_t CPDF_Bookmark::GetColorRef() const {
if (!m_pDict)
- return FXSYS_RGB(0, 0, 0);
+ return kBlackBGR;
CPDF_Array* pColor = m_pDict->GetArrayFor("C");
if (!pColor)
- return FXSYS_RGB(0, 0, 0);
+ return kBlackBGR;
int r = FXSYS_round(pColor->GetNumberAt(0) * 255);
int g = FXSYS_round(pColor->GetNumberAt(1) * 255);
int b = FXSYS_round(pColor->GetNumberAt(2) * 255);
- return FXSYS_RGB(r, g, b);
+ return FXSYS_BGR(b, g, r);
}
uint32_t CPDF_Bookmark::GetFontStyle() const {