Make CPDF_ColorState::SetPattern() less confusing. -- avoid mixed-case local names. Change-Id: I6ca27e61eebaefecff9b3ae5c2d0fd0b7deaab80 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/99253 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_colorstate.cpp b/core/fpdfapi/page/cpdf_colorstate.cpp index bca6e24..bcdd0e0 100644 --- a/core/fpdfapi/page/cpdf_colorstate.cpp +++ b/core/fpdfapi/page/cpdf_colorstate.cpp
@@ -131,19 +131,16 @@ FX_COLORREF* colorref) { DCHECK(color); DCHECK(colorref); - color->SetValueForPattern(pattern, values); int R; int G; int B; - bool ret = color->GetRGB(&R, &G, &B); - if (CPDF_TilingPattern* pTilingPattern = pattern->AsTilingPattern()) { - if (!ret && pTilingPattern->colored()) { - *colorref = 0x00BFBFBF; - return; - } + if (color->GetRGB(&R, &G, &B)) { + *colorref = FXSYS_BGR(B, G, R); + return; } - *colorref = ret ? FXSYS_BGR(B, G, R) : 0xFFFFFFFF; + CPDF_TilingPattern* tiling = pattern->AsTilingPattern(); + *colorref = tiling && tiling->colored() ? 0x00BFBFBF : 0xFFFFFFFF; } CPDF_ColorState::ColorData::ColorData() = default;