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 /core/fxge/fx_dib.h | |
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 'core/fxge/fx_dib.h')
-rw-r--r-- | core/fxge/fx_dib.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h index 8134c5066d..5dcfac4962 100644 --- a/core/fxge/fx_dib.h +++ b/core/fxge/fx_dib.h @@ -37,9 +37,13 @@ struct PixelWeight { int m_Weights[1]; }; -typedef uint32_t FX_ARGB; -typedef uint32_t FX_COLORREF; -typedef uint32_t FX_CMYK; +using FX_ARGB = uint32_t; + +// FX_COLORREF, like win32 COLORREF, is BGR. +using FX_COLORREF = uint32_t; + +using FX_CMYK = uint32_t; + class CFX_ClipRgn; class CFX_DIBSource; class CStretchEngine; @@ -86,11 +90,14 @@ inline FX_CMYK CmykEncode(int c, int m, int y, int k) { return (c << 24) | (m << 16) | (y << 8) | k; } -// Returns tuple a, r, g, b +// Returns (a, r, g, b) std::tuple<int, int, int, int> ArgbDecode(FX_ARGB argb); -// Returns pair a, rgb -std::pair<int, FX_COLORREF> ArgbToColorRef(FX_ARGB argb); +// Returns (a, FX_COLORREF) +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) { return (a << 24) | (r << 16) | (g << 8) | b; |