Remove FXARGB_TODIB(). It is a no-op. Change-Id: Ia9d6c0292bdb5d9a9634ddedc5db6f9ae64cfae8 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/75230 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp index e1139ce..b744004 100644 --- a/core/fpdfapi/page/cpdf_dib.cpp +++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -1097,8 +1097,6 @@ reset_argb = 0; if (m_CompData[0].m_ColorKeyMax == 1) set_argb = 0; - set_argb = FXARGB_TODIB(set_argb); - reset_argb = FXARGB_TODIB(reset_argb); uint32_t* dest_scan = reinterpret_cast<uint32_t*>(m_pMaskedLine.get()); for (int col = 0; col < m_Width; col++) { *dest_scan = GetBitValue(pSrcLine, col) ? set_argb : reset_argb; @@ -1252,8 +1250,6 @@ reset_argb = 0; if (m_CompData[0].m_ColorKeyMax == 1) set_argb = 0; - set_argb = FXARGB_TODIB(set_argb); - reset_argb = FXARGB_TODIB(reset_argb); uint32_t* dest_scan_dword = reinterpret_cast<uint32_t*>(dest_scan); for (int i = 0; i < clip_width; i++) { uint32_t src_x = (clip_left + i) * src_width / dest_width; @@ -1449,7 +1445,7 @@ last_argb = argb; } if (dest_Bpp == 4) { - *reinterpret_cast<uint32_t*>(pDestPixel) = FXARGB_TODIB(argb); + *reinterpret_cast<uint32_t*>(pDestPixel) = argb; } else { *pDestPixel++ = FXARGB_B(argb); *pDestPixel++ = FXARGB_G(argb);
diff --git a/core/fpdfapi/render/cpdf_rendershading.cpp b/core/fpdfapi/render/cpdf_rendershading.cpp index 1394dca..7e02ed5 100644 --- a/core/fpdfapi/render/cpdf_rendershading.cpp +++ b/core/fpdfapi/render/cpdf_rendershading.cpp
@@ -79,9 +79,8 @@ float G = 0.0f; float B = 0.0f; pCS->GetRGB(result_array, &R, &G, &B); - shading_steps[i] = - FXARGB_TODIB(ArgbEncode(alpha, FXSYS_roundf(R * 255), - FXSYS_roundf(G * 255), FXSYS_roundf(B * 255))); + shading_steps[i] = ArgbEncode(alpha, FXSYS_roundf(R * 255), + FXSYS_roundf(G * 255), FXSYS_roundf(B * 255)); } return shading_steps; } @@ -308,8 +307,8 @@ float G = 0.0f; float B = 0.0f; pCS->GetRGB(result_array, &R, &G, &B); - dib_buf[column] = FXARGB_TODIB(ArgbEncode( - alpha, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255))); + dib_buf[column] = ArgbEncode(alpha, (int32_t)(R * 255), + (int32_t)(G * 255), (int32_t)(B * 255)); } } }
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 3f51c3d..d39e0a4 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -901,7 +901,7 @@ if (m_bRgbByteOrder) m_Color = FXARGB_TOBGRORDERDIB(color); else - m_Color = FXARGB_TODIB(color); + m_Color = color; std::tie(m_Alpha, m_Red, m_Green, m_Blue) = ArgbDecode(color); if (m_pDevice->GetBPP() == 1) composite_span = &CFX_Renderer::CompositeSpan1bpp; @@ -980,7 +980,7 @@ int index = 0; if (m_pDevice->GetPalette()) { for (int i = 0; i < 2; i++) { - if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) + if (m_pDevice->GetPalette()[i] == m_Color) index = i; } } else {
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index 364390c..72c003b 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -161,7 +161,7 @@ } case FXDIB_Rgb32: case FXDIB_Argb: { - color = IsCmykImage() ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); + color = IsCmykImage() ? FXCMYK_TODIB(color) : color; #if defined(_SKIA_SUPPORT_) if (FXDIB_Rgb32 == GetFormat() && !IsCmykImage()) color |= 0xFF000000; @@ -1034,7 +1034,7 @@ if (alpha_flag >> 8) dst_color = FXCMYK_TODIB(color); else - dst_color = FXARGB_TODIB(color); + dst_color = color; uint8_t* color_p = reinterpret_cast<uint8_t*>(&dst_color); if (m_bpp == 8) { uint8_t gray = 255;
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp index f8f8fc6..f9891c2 100644 --- a/core/fxge/dib/cfx_imagetransformer.cpp +++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -137,7 +137,7 @@ uint32_t* dest32 = reinterpret_cast<uint32_t*>(dest); if (bHasAlpha) { if (format == FXDIB_Argb) { - *dest32 = FXARGB_TODIB(ArgbEncode(func(3), red_y, green_m, blue_c)); + *dest32 = ArgbEncode(func(3), red_y, green_m, blue_c); } else if (format == FXDIB_Rgba) { dest[0] = blue_c; dest[1] = green_m; @@ -151,7 +151,7 @@ if (format == FXDIB_Cmyka) { *dest32 = FXCMYK_TODIB(CmykEncode(blue_c, green_m, red_y, func(3))); } else { - *dest32 = FXARGB_TODIB(ArgbEncode(kOpaqueAlpha, red_y, green_m, blue_c)); + *dest32 = ArgbEncode(kOpaqueAlpha, red_y, green_m, blue_c); } }
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h index c0329fb..bf47a13 100644 --- a/core/fxge/fx_dib.h +++ b/core/fxge/fx_dib.h
@@ -171,7 +171,6 @@ ((uint8_t*)(p))[0] = (uint8_t)((argb) >> 16), \ ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \ ((uint8_t*)(p))[2] = (uint8_t)(argb) -#define FXARGB_TODIB(argb) (argb) #define FXCMYK_TODIB(cmyk) \ ((uint8_t)((cmyk) >> 24) | ((uint8_t)((cmyk) >> 16)) << 8 | \ ((uint8_t)((cmyk) >> 8)) << 16 | ((uint8_t)(cmyk) << 24))
diff --git a/xfa/fgas/graphics/cfgas_geshading.cpp b/xfa/fgas/graphics/cfgas_geshading.cpp index 2fd9a8a..fcf3b14 100644 --- a/xfa/fgas/graphics/cfgas_geshading.cpp +++ b/xfa/fgas/graphics/cfgas_geshading.cpp
@@ -72,7 +72,6 @@ int32_t b3 = static_cast<int32_t>(i * bScale); // TODO(dsinclair): Add overloads for FX_ARGB. pdfium:437 - m_argbArray[i] = - FXARGB_TODIB(ArgbEncode(a1 + a3, r1 + r3, g1 + g3, b1 + b3)); + m_argbArray[i] = ArgbEncode(a1 + a3, r1 + r3, g1 + g3, b1 + b3); } }