diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-29 18:45:39 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-29 18:45:39 +0000 |
commit | 162a31a6af1538acf7ac9835111626161287d742 (patch) | |
tree | 7235629237d6ff187e68a116604acd83c6700b1a /core/fxge/dib | |
parent | ac8357b3ec7e1fe4000ebcae5ce65a38bfeb5cb1 (diff) | |
download | pdfium-162a31a6af1538acf7ac9835111626161287d742.tar.xz |
Get rid of FXARGB_MAKE macro.
ArgbEncode() does the same thing.
Change-Id: Ibb05ed4aae720c0a5ba66771699c0d7e11230921
Reviewed-on: https://pdfium-review.googlesource.com/32230
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/dib')
-rw-r--r-- | core/fxge/dib/cfx_dibitmap.cpp | 8 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibsource.cpp | 2 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagetransformer.cpp | 4 | ||||
-rw-r--r-- | core/fxge/dib/cfx_scanlinecompositor.cpp | 36 | ||||
-rw-r--r-- | core/fxge/dib/fx_dib_main.cpp | 4 |
5 files changed, 27 insertions, 27 deletions
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index 15e821cf11..f17ca52095 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp @@ -738,8 +738,8 @@ void CFX_DIBitmap::ConvertBGRColorScale(uint32_t forecolor, FXARGB_G(m_pPalette.get()[i]), FXARGB_B(m_pPalette.get()[i])); m_pPalette.get()[i] = - FXARGB_MAKE(0xff, br + (fr - br) * gray / 255, - bg + (fg - bg) * gray / 255, bb + (fb - bb) * gray / 255); + ArgbEncode(0xff, br + (fr - br) * gray / 255, + bg + (fg - bg) * gray / 255, bb + (fb - bb) * gray / 255); } return; } @@ -1153,8 +1153,8 @@ bool CFX_DIBitmap::CompositeRect(int left, for (int col = 0; col < width; col++) { uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { - FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2], - color_p[1], color_p[0])); + FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, color_p[2], + color_p[1], color_p[0])); dest_scan += 4; continue; } diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibsource.cpp index f140a5e838..757547783d 100644 --- a/core/fxge/dib/cfx_dibsource.cpp +++ b/core/fxge/dib/cfx_dibsource.cpp @@ -302,7 +302,7 @@ void ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, std::tie(r, g, b) = AdobeCMYK_to_sRGB1( FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i])); - dst_plt[i] = FXARGB_MAKE(0xff, r, g, b); + dst_plt[i] = ArgbEncode(0xff, r, g, b); } } else { memcpy(dst_plt, src_plt, plt_size * 4); diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp index 68867b5560..9cd5cea10e 100644 --- a/core/fxge/dib/cfx_imagetransformer.cpp +++ b/core/fxge/dib/cfx_imagetransformer.cpp @@ -132,7 +132,7 @@ void WriteColorResult(std::function<uint8_t(int offset)> func, uint32_t* dest32 = reinterpret_cast<uint32_t*>(dest); if (bHasAlpha) { if (format == FXDIB_Argb) { - *dest32 = FXARGB_TODIB(FXARGB_MAKE(func(3), red_y, green_m, blue_c)); + *dest32 = FXARGB_TODIB(ArgbEncode(func(3), red_y, green_m, blue_c)); } else if (format == FXDIB_Rgba) { dest[0] = blue_c; dest[1] = green_m; @@ -146,7 +146,7 @@ void WriteColorResult(std::function<uint8_t(int offset)> func, if (format == FXDIB_Cmyka) { *dest32 = FXCMYK_TODIB(CmykEncode(blue_c, green_m, red_y, func(3))); } else { - *dest32 = FXARGB_TODIB(FXARGB_MAKE(kOpaqueAlpha, red_y, green_m, blue_c)); + *dest32 = FXARGB_TODIB(ArgbEncode(kOpaqueAlpha, red_y, green_m, blue_c)); } } diff --git a/core/fxge/dib/cfx_scanlinecompositor.cpp b/core/fxge/dib/cfx_scanlinecompositor.cpp index ae27ee0246..948dd59838 100644 --- a/core/fxge/dib/cfx_scanlinecompositor.cpp +++ b/core/fxge/dib/cfx_scanlinecompositor.cpp @@ -394,8 +394,8 @@ void CompositeRow_Argb2Argb(uint8_t* dest_scan, if (!has_src) ++src_scan; } else { - FXARGB_SETDIB(dest_scan, FXARGB_MAKE((src_alpha << 24), src_scan[2], - src_scan[1], *src_scan)); + FXARGB_SETDIB(dest_scan, ArgbEncode((src_alpha << 24), src_scan[2], + src_scan[1], *src_scan)); } if (!has_dest) { dest_scan += dest_offset; @@ -464,8 +464,8 @@ void CompositeRow_Rgb2Argb_Blend_NoClip(uint8_t* dest_scan, if (src_Bpp == 4) { FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); } else { - FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], - src_scan[0])); + FXARGB_SETDIB(dest_scan, ArgbEncode(0xff, src_scan[2], src_scan[1], + src_scan[0])); } dest_scan += 4; } @@ -637,7 +637,7 @@ void CompositeRow_Rgb2Argb_NoBlend_NoClip(uint8_t* dest_scan, FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); } else { FXARGB_SETDIB(dest_scan, - FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0])); + ArgbEncode(0xff, src_scan[2], src_scan[1], src_scan[0])); } dest_scan += 4; src_scan += src_Bpp; @@ -1322,10 +1322,10 @@ void CompositeRow_8bppRgb2Argb_NoBlend(uint8_t* dest_scan, if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255; - FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); + FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, src_r, src_g, src_b)); } else { FXARGB_SETDIB(dest_scan, - FXARGB_MAKE(*src_alpha_scan, src_r, src_g, src_b)); + ArgbEncode(*src_alpha_scan, src_r, src_g, src_b)); } dest_scan += 4; src_alpha_scan++; @@ -1511,7 +1511,7 @@ void CompositeRow_ByteMask2Argb(uint8_t* dest_scan, } uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { - FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); + FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } @@ -1769,7 +1769,7 @@ void CompositeRow_BitMask2Argb(uint8_t* dest_scan, int blend_type, const uint8_t* clip_scan) { if (blend_type == FXDIB_BLEND_NORMAL && !clip_scan && mask_alpha == 255) { - FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b); + FX_ARGB argb = ArgbEncode(0xff, src_r, src_g, src_b); for (int col = 0; col < pixel_count; col++) { if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) { FXARGB_SETDIB(dest_scan, argb); @@ -1791,7 +1791,7 @@ void CompositeRow_BitMask2Argb(uint8_t* dest_scan, } uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { - FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); + FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } @@ -2072,8 +2072,8 @@ void CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, if (src_Bpp == 4) { FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); } else { - FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], - src_scan[1], src_scan[0])); + FXARGB_SETRGBORDERDIB( + dest_scan, ArgbEncode(0xff, src_scan[2], src_scan[1], src_scan[0])); } dest_scan += 4; src_scan += src_Bpp; @@ -2151,7 +2151,7 @@ void CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan, FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); } else { FXARGB_SETRGBORDERDIB( - dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0])); + dest_scan, ArgbEncode(0xff, src_scan[2], src_scan[1], src_scan[0])); } dest_scan += 4; src_scan += src_Bpp; @@ -2578,7 +2578,7 @@ void CompositeRow_ByteMask2Argb_RgbByteOrder(uint8_t* dest_scan, uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETRGBORDERDIB(dest_scan, - FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); + ArgbEncode(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } @@ -2682,7 +2682,7 @@ void CompositeRow_BitMask2Argb_RgbByteOrder(uint8_t* dest_scan, int blend_type, const uint8_t* clip_scan) { if (blend_type == FXDIB_BLEND_NORMAL && !clip_scan && mask_alpha == 255) { - FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b); + FX_ARGB argb = ArgbEncode(0xff, src_r, src_g, src_b); for (int col = 0; col < pixel_count; col++) { if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) { FXARGB_SETRGBORDERDIB(dest_scan, argb); @@ -2705,7 +2705,7 @@ void CompositeRow_BitMask2Argb_RgbByteOrder(uint8_t* dest_scan, uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETRGBORDERDIB(dest_scan, - FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); + ArgbEncode(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } @@ -2950,7 +2950,7 @@ void CFX_ScanlineCompositor::InitSourcePalette(FXDIB_Format src_format, std::tie(r, g, b) = AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk)); - pPalette[i] = FXARGB_MAKE(0xff, r, g, b); + pPalette[i] = ArgbEncode(0xff, r, g, b); } } return; @@ -2985,7 +2985,7 @@ void CFX_ScanlineCompositor::InitSourcePalette(FXDIB_Format src_format, std::tie(r, g, b) = AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk)); - pPalette[i] = FXARGB_MAKE(0xff, r, g, b); + pPalette[i] = ArgbEncode(0xff, r, g, b); } } } diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp index e2e2213e8f..2fd3cc05e5 100644 --- a/core/fxge/dib/fx_dib_main.cpp +++ b/core/fxge/dib/fx_dib_main.cpp @@ -93,8 +93,8 @@ FX_COLORREF ArgbToColorRef(FX_ARGB argb) { } FX_ARGB AlphaAndColorRefToArgb(int a, FX_COLORREF colorref) { - return FXARGB_MAKE(a, FXSYS_GetRValue(colorref), FXSYS_GetGValue(colorref), - FXSYS_GetBValue(colorref)); + return ArgbEncode(a, FXSYS_GetRValue(colorref), FXSYS_GetGValue(colorref), + FXSYS_GetBValue(colorref)); } FX_ARGB StringToFXARGB(const WideStringView& wsValue) { |