From d5e282648a08a0b68c30edce51fafeeb5d76db7b Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 16 Aug 2018 20:58:38 +0000 Subject: Remove optional bool bType from GetFillArgb() Two variants make the intention much clearer. Change-Id: Ied0d8e6fa8c5524c19cafe8036d7c1b470fda86d Reviewed-on: https://pdfium-review.googlesource.com/40352 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- core/fpdfapi/render/cpdf_renderstatus.cpp | 6 +++--- core/fpdfapi/render/cpdf_renderstatus.h | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index f8a2b5de75..5e554623df 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -1291,8 +1291,8 @@ RetainPtr CPDF_RenderStatus::GetTransferFunc( return pDocCache ? pDocCache->GetTransferFunc(pObj) : nullptr; } -FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj, - bool bType3) const { +FX_ARGB CPDF_RenderStatus::GetFillArgbInternal(CPDF_PageObject* pObj, + bool bType3) const { const CPDF_ColorState* pColorState = &pObj->m_ColorState; if (!bType3 && Type3CharMissingFillColor(m_pType3Char.Get(), pColorState)) return m_T3FillColor; @@ -1808,7 +1808,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, CFX_Matrix char_matrix = pType3Font->GetFontMatrix(); float font_size = textobj->m_TextState.GetFontSize(); char_matrix.Scale(font_size, font_size); - FX_ARGB fill_argb = GetFillArgb(textobj, true); + FX_ARGB fill_argb = GetFillArgbForType3(textobj); int fill_alpha = FXARGB_A(fill_argb); int device_class = m_pDevice->GetDeviceClass(); std::vector glyphs; diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h index b15c1d1482..a7e845f237 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.h +++ b/core/fpdfapi/render/cpdf_renderstatus.h @@ -89,7 +89,14 @@ class CPDF_RenderStatus { RetainPtr GetTransferFunc( const CPDF_Object* pObject) const; - FX_ARGB GetFillArgb(CPDF_PageObject* pObj, bool bType3 = false) const; + + FX_ARGB GetFillArgb(CPDF_PageObject* pObj) const { + return GetFillArgbInternal(pObj, false); + } + FX_ARGB GetFillArgbForType3(CPDF_PageObject* pObj) const { + return GetFillArgbInternal(pObj, true); + } + void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_Matrix* pObj2Device, @@ -107,6 +114,7 @@ class CPDF_RenderStatus { const CPDF_Transparency& transparency); private: + FX_ARGB GetFillArgbInternal(CPDF_PageObject* pObj, bool bType3) const; bool ProcessTransparency(CPDF_PageObject* PageObj, const CFX_Matrix* pObj2Device); void ProcessObjectNoClip(CPDF_PageObject* PageObj, -- cgit v1.2.3