diff options
author | Lei Zhang <thestig@chromium.org> | 2018-03-20 15:25:57 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-20 15:25:57 +0000 |
commit | 2e6405c333d8daae4e3edaa6b48f5ac5a8d7675b (patch) | |
tree | df8f6a28b695c34407b3bbe28220584f421afc0e /fpdfsdk/cpdfsdk_widget.cpp | |
parent | b3a5240832fce3f0b706c16070a1e69c2c1edb86 (diff) | |
download | pdfium-2e6405c333d8daae4e3edaa6b48f5ac5a8d7675b.tar.xz |
Change ArgbToColorRef() to ArgbToAlphaAndColorRef().chromium/3377
Since that is what it really returns. Add a replacement ArgbToColorRef()
that only returns a FX_COLORREF, and remove a duplicate implementation.
Then update callers and only use ArgbToAlphaAndColorRef() where
appropriate.
Also update comments to explain what FX_COLORREF is.
Change-Id: I5ed3d71683898dc2b3a66395dea0ec2562c14a68
Reviewed-on: https://pdfium-review.googlesource.com/28575
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index 0d765ed947..6d81829bc9 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -41,17 +41,6 @@ #include "xfa/fxfa/parser/cxfa_node.h" #endif // PDF_ENABLE_XFA -namespace { - -// Convert a FX_ARGB to a FX_COLORREF. -FX_COLORREF ARGBToColorRef(FX_ARGB argb) { - return (((static_cast<uint32_t>(argb) & 0x00FF0000) >> 16) | - (static_cast<uint32_t>(argb) & 0x0000FF00) | - ((static_cast<uint32_t>(argb) & 0x000000FF) << 16)); -} - -} // namespace - CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm) @@ -428,14 +417,14 @@ WideString CPDFSDK_Widget::GetName() const { bool CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const { CPDF_FormControl* pFormCtrl = GetFormControl(); int iColorType = 0; - color = ARGBToColorRef(pFormCtrl->GetBackgroundColor(iColorType)); + color = ArgbToColorRef(pFormCtrl->GetBackgroundColor(iColorType)); return iColorType != CFX_Color::kTransparent; } bool CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const { CPDF_FormControl* pFormCtrl = GetFormControl(); int iColorType = 0; - color = ARGBToColorRef(pFormCtrl->GetBorderColor(iColorType)); + color = ArgbToColorRef(pFormCtrl->GetBorderColor(iColorType)); return iColorType != CFX_Color::kTransparent; } @@ -448,7 +437,7 @@ bool CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const { FX_ARGB argb; int iColorType = CFX_Color::kTransparent; da.GetColor(argb, iColorType); - color = ARGBToColorRef(argb); + color = ArgbToColorRef(argb); return iColorType != CFX_Color::kTransparent; } |