summaryrefslogtreecommitdiff
path: root/core/fpdfapi
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/fpdfapi
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/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_colorstate.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_transferfunc.cpp8
-rw-r--r--core/fpdfapi/render/cpdf_transferfunc.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_colorstate.cpp b/core/fpdfapi/page/cpdf_colorstate.cpp
index 2361552556..227fd62045 100644
--- a/core/fpdfapi/page/cpdf_colorstate.cpp
+++ b/core/fpdfapi/page/cpdf_colorstate.cpp
@@ -99,7 +99,7 @@ void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern,
return;
}
}
- pData->m_FillColorRef = ret ? FXSYS_RGB(R, G, B) : 0xFFFFFFFF;
+ pData->m_FillColorRef = ret ? FXSYS_BGR(B, G, R) : 0xFFFFFFFF;
}
void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
@@ -118,7 +118,7 @@ void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
}
}
pData->m_StrokeColorRef =
- pData->m_StrokeColor.GetRGB(&R, &G, &B) ? FXSYS_RGB(R, G, B) : 0xFFFFFFFF;
+ pData->m_StrokeColor.GetRGB(&R, &G, &B) ? FXSYS_BGR(B, G, R) : 0xFFFFFFFF;
}
void CPDF_ColorState::SetColor(CPDF_Color& color,
@@ -138,7 +138,7 @@ void CPDF_ColorState::SetColor(CPDF_Color& color,
int R;
int G;
int B;
- *colorref = color.GetRGB(&R, &G, &B) ? FXSYS_RGB(R, G, B) : 0xFFFFFFFF;
+ *colorref = color.GetRGB(&R, &G, &B) ? FXSYS_BGR(B, G, R) : 0xFFFFFFFF;
}
CPDF_ColorState::ColorData::ColorData()
diff --git a/core/fpdfapi/render/cpdf_transferfunc.cpp b/core/fpdfapi/render/cpdf_transferfunc.cpp
index c28afde0d9..25717437d3 100644
--- a/core/fpdfapi/render/cpdf_transferfunc.cpp
+++ b/core/fpdfapi/render/cpdf_transferfunc.cpp
@@ -14,10 +14,10 @@ CPDF_TransferFunc::CPDF_TransferFunc(CPDF_Document* pDoc) : m_pPDFDoc(pDoc) {}
CPDF_TransferFunc::~CPDF_TransferFunc() {}
-FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF bgr) const {
- return FXSYS_RGB(m_Samples[FXSYS_GetRValue(bgr)],
- m_Samples[256 + FXSYS_GetGValue(bgr)],
- m_Samples[512 + FXSYS_GetBValue(bgr)]);
+FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF colorref) const {
+ return FXSYS_BGR(m_Samples[512 + FXSYS_GetBValue(colorref)],
+ m_Samples[256 + FXSYS_GetGValue(colorref)],
+ m_Samples[FXSYS_GetRValue(colorref)]);
}
RetainPtr<CFX_DIBSource> CPDF_TransferFunc::TranslateImage(
diff --git a/core/fpdfapi/render/cpdf_transferfunc.h b/core/fpdfapi/render/cpdf_transferfunc.h
index de95a439c3..dfc186ec6c 100644
--- a/core/fpdfapi/render/cpdf_transferfunc.h
+++ b/core/fpdfapi/render/cpdf_transferfunc.h
@@ -19,7 +19,7 @@ class CPDF_TransferFunc : public Retainable {
template <typename T, typename... Args>
friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
- FX_COLORREF TranslateColor(FX_COLORREF bgr) const;
+ FX_COLORREF TranslateColor(FX_COLORREF colorref) const;
RetainPtr<CFX_DIBSource> TranslateImage(const RetainPtr<CFX_DIBSource>& pSrc);
const CPDF_Document* GetDocument() const { return m_pPDFDoc.Get(); }