diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.cpp | 4 | ||||
-rw-r--r-- | core/fxge/dib/fx_dib_main.cpp | 6 | ||||
-rw-r--r-- | core/fxge/fx_dib.h | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index a0b6713274..d5204fe500 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -1373,7 +1373,7 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj, pObj->m_GeneralState.GetTransferFunc()->TranslateColor(colorref); } } - return m_Options.TranslateColor(ArgbEncode(alpha, colorref)); + return m_Options.TranslateColor(AlphaAndColorRefToArgb(alpha, colorref)); } FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const { @@ -1400,7 +1400,7 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const { pObj->m_GeneralState.GetTransferFunc()->TranslateColor(colorref); } } - return m_Options.TranslateColor(ArgbEncode(alpha, colorref)); + return m_Options.TranslateColor(AlphaAndColorRefToArgb(alpha, colorref)); } void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath, diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp index 5d7b585979..6c3a236edd 100644 --- a/core/fxge/dib/fx_dib_main.cpp +++ b/core/fxge/dib/fx_dib_main.cpp @@ -87,9 +87,9 @@ FX_COLORREF ArgbToColorRef(FX_ARGB argb) { return FXSYS_RGB(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb)); } -uint32_t ArgbEncode(int a, FX_COLORREF bgr) { - return FXARGB_MAKE(a, FXSYS_GetRValue(bgr), FXSYS_GetGValue(bgr), - FXSYS_GetBValue(bgr)); +FX_ARGB AlphaAndColorRefToArgb(int a, FX_COLORREF colorref) { + return FXARGB_MAKE(a, FXSYS_GetRValue(colorref), FXSYS_GetGValue(colorref), + FXSYS_GetBValue(colorref)); } FX_ARGB StringToFXARGB(const WideStringView& wsValue) { diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h index 5dcfac4962..0878dfd7fd 100644 --- a/core/fxge/fx_dib.h +++ b/core/fxge/fx_dib.h @@ -99,11 +99,11 @@ std::pair<int, FX_COLORREF> ArgbToAlphaAndColorRef(FX_ARGB argb); // Returns FX_COLORREF. FX_COLORREF ArgbToColorRef(FX_ARGB argb); -inline FX_ARGB ArgbEncode(int a, int r, int g, int b) { +constexpr FX_ARGB ArgbEncode(int a, int r, int g, int b) { return (a << 24) | (r << 16) | (g << 8) | b; } -// TODO(thestig): Rename to AlphaAndColorRefToArgb(). -FX_ARGB ArgbEncode(int a, FX_COLORREF bgr); + +FX_ARGB AlphaAndColorRefToArgb(int a, FX_COLORREF colorref); FX_ARGB StringToFXARGB(const WideStringView& view); |