summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-20 21:06:35 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-20 21:06:35 +0000
commit40d37b1a8077031a078b374eaf6644d89e506d23 (patch)
tree72928249b6b2c0c230917518a5a616cf757c0da8 /core/fpdfapi/render
parentaff457782dcb9c2f7fa82e3c9c469182c5b8ad15 (diff)
downloadpdfium-40d37b1a8077031a078b374eaf6644d89e506d23.tar.xz
Rename "RGB" methods/variables to "ColorRef" in CPDF_ColorState.
Change-Id: I196e3148d680c9efeaf9609dd3ddbfe3f6635fa6 Reviewed-on: https://pdfium-review.googlesource.com/28576 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 1ded1ca496..a0b6713274 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1046,14 +1046,14 @@ bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
m_InitialStates.CopyStates(*pInitialStates);
if (pParentState) {
if (!m_InitialStates.m_ColorState.HasFillColor()) {
- m_InitialStates.m_ColorState.SetFillRGB(
- pParentState->m_InitialStates.m_ColorState.GetFillRGB());
+ m_InitialStates.m_ColorState.SetFillColorRef(
+ pParentState->m_InitialStates.m_ColorState.GetFillColorRef());
m_InitialStates.m_ColorState.GetMutableFillColor()->Copy(
pParentState->m_InitialStates.m_ColorState.GetFillColor());
}
if (!m_InitialStates.m_ColorState.HasStrokeColor()) {
- m_InitialStates.m_ColorState.SetStrokeRGB(
- pParentState->m_InitialStates.m_ColorState.GetFillRGB());
+ m_InitialStates.m_ColorState.SetStrokeColorRef(
+ pParentState->m_InitialStates.m_ColorState.GetFillColorRef());
m_InitialStates.m_ColorState.GetMutableStrokeColor()->Copy(
pParentState->m_InitialStates.m_ColorState.GetStrokeColor());
}
@@ -1357,8 +1357,8 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj,
if (MissingFillColor(pColorState))
pColorState = &m_InitialStates.m_ColorState;
- FX_COLORREF bgr = pColorState->GetFillRGB();
- if (bgr == 0xFFFFFFFF)
+ FX_COLORREF colorref = pColorState->GetFillColorRef();
+ if (colorref == 0xFFFFFFFF)
return 0;
int32_t alpha =
@@ -1368,10 +1368,12 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj,
pObj->m_GeneralState.SetTransferFunc(
GetTransferFunc(pObj->m_GeneralState.GetTR()));
}
- if (pObj->m_GeneralState.GetTransferFunc())
- bgr = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(bgr);
+ if (pObj->m_GeneralState.GetTransferFunc()) {
+ colorref =
+ pObj->m_GeneralState.GetTransferFunc()->TranslateColor(colorref);
+ }
}
- return m_Options.TranslateColor(ArgbEncode(alpha, bgr));
+ return m_Options.TranslateColor(ArgbEncode(alpha, colorref));
}
FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
@@ -1382,8 +1384,8 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
if (MissingStrokeColor(pColorState))
pColorState = &m_InitialStates.m_ColorState;
- FX_COLORREF bgr = pColorState->GetStrokeRGB();
- if (bgr == 0xFFFFFFFF)
+ FX_COLORREF colorref = pColorState->GetStrokeColorRef();
+ if (colorref == 0xFFFFFFFF)
return 0;
int32_t alpha = static_cast<int32_t>(pObj->m_GeneralState.GetStrokeAlpha() *
@@ -1393,10 +1395,12 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
pObj->m_GeneralState.SetTransferFunc(
GetTransferFunc(pObj->m_GeneralState.GetTR()));
}
- if (pObj->m_GeneralState.GetTransferFunc())
- bgr = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(bgr);
+ if (pObj->m_GeneralState.GetTransferFunc()) {
+ colorref =
+ pObj->m_GeneralState.GetTransferFunc()->TranslateColor(colorref);
+ }
}
- return m_Options.TranslateColor(ArgbEncode(alpha, bgr));
+ return m_Options.TranslateColor(ArgbEncode(alpha, colorref));
}
void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
@@ -1710,10 +1714,11 @@ std::unique_ptr<CPDF_GraphicStates> CPDF_RenderStatus::CloneObjStates(
? pSrcStates->m_ColorState.GetStrokeColor()
: pSrcStates->m_ColorState.GetFillColor();
if (!pObjColor->IsNull()) {
- pStates->m_ColorState.SetFillRGB(
- bStroke ? pSrcStates->m_ColorState.GetStrokeRGB()
- : pSrcStates->m_ColorState.GetFillRGB());
- pStates->m_ColorState.SetStrokeRGB(pStates->m_ColorState.GetFillRGB());
+ pStates->m_ColorState.SetFillColorRef(
+ bStroke ? pSrcStates->m_ColorState.GetStrokeColorRef()
+ : pSrcStates->m_ColorState.GetFillColorRef());
+ pStates->m_ColorState.SetStrokeColorRef(
+ pStates->m_ColorState.GetFillColorRef());
}
return pStates;
}