summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_colorstate.h1
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp16
-rw-r--r--core/fpdfapi/render/cpdf_transferfunc.cpp8
-rw-r--r--core/fpdfapi/render/cpdf_transferfunc.h2
4 files changed, 14 insertions, 13 deletions
diff --git a/core/fpdfapi/page/cpdf_colorstate.h b/core/fpdfapi/page/cpdf_colorstate.h
index 9619051e2c..cae79b28e2 100644
--- a/core/fpdfapi/page/cpdf_colorstate.h
+++ b/core/fpdfapi/page/cpdf_colorstate.h
@@ -54,6 +54,7 @@ class CPDF_ColorState {
void SetDefault();
+ // TODO(thestig): Rename these to BGR.
uint32_t m_FillRGB;
uint32_t m_StrokeRGB;
CPDF_Color m_FillColor;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 0022fb1bdb..1ded1ca496 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1357,8 +1357,8 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj,
if (MissingFillColor(pColorState))
pColorState = &m_InitialStates.m_ColorState;
- FX_COLORREF rgb = pColorState->GetFillRGB();
- if (rgb == (uint32_t)-1)
+ FX_COLORREF bgr = pColorState->GetFillRGB();
+ if (bgr == 0xFFFFFFFF)
return 0;
int32_t alpha =
@@ -1369,9 +1369,9 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj,
GetTransferFunc(pObj->m_GeneralState.GetTR()));
}
if (pObj->m_GeneralState.GetTransferFunc())
- rgb = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(rgb);
+ bgr = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(bgr);
}
- return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
+ return m_Options.TranslateColor(ArgbEncode(alpha, bgr));
}
FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
@@ -1382,8 +1382,8 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
if (MissingStrokeColor(pColorState))
pColorState = &m_InitialStates.m_ColorState;
- FX_COLORREF rgb = pColorState->GetStrokeRGB();
- if (rgb == (uint32_t)-1)
+ FX_COLORREF bgr = pColorState->GetStrokeRGB();
+ if (bgr == 0xFFFFFFFF)
return 0;
int32_t alpha = static_cast<int32_t>(pObj->m_GeneralState.GetStrokeAlpha() *
@@ -1394,9 +1394,9 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
GetTransferFunc(pObj->m_GeneralState.GetTR()));
}
if (pObj->m_GeneralState.GetTransferFunc())
- rgb = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(rgb);
+ bgr = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(bgr);
}
- return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
+ return m_Options.TranslateColor(ArgbEncode(alpha, bgr));
}
void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
diff --git a/core/fpdfapi/render/cpdf_transferfunc.cpp b/core/fpdfapi/render/cpdf_transferfunc.cpp
index 98528c3c14..c28afde0d9 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 rgb) const {
- return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)],
- m_Samples[256 + FXSYS_GetGValue(rgb)],
- m_Samples[512 + FXSYS_GetBValue(rgb)]);
+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)]);
}
RetainPtr<CFX_DIBSource> CPDF_TransferFunc::TranslateImage(
diff --git a/core/fpdfapi/render/cpdf_transferfunc.h b/core/fpdfapi/render/cpdf_transferfunc.h
index d7e21fcfef..de95a439c3 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 src) const;
+ FX_COLORREF TranslateColor(FX_COLORREF bgr) const;
RetainPtr<CFX_DIBSource> TranslateImage(const RetainPtr<CFX_DIBSource>& pSrc);
const CPDF_Document* GetDocument() const { return m_pPDFDoc.Get(); }