Remove `CFX_ScanlineCompositor::m_bClip`
This variable is not needed, as the code that reads it can also check if
`clip_scan` is empty or not.
Change-Id: I03bd493bf14ce91c23d8b7b9d1db47940c7e0335
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/123290
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/agg/cfx_agg_bitmapcomposer.cpp b/core/fxge/agg/cfx_agg_bitmapcomposer.cpp
index 48a7440..7673212 100644
--- a/core/fxge/agg/cfx_agg_bitmapcomposer.cpp
+++ b/core/fxge/agg/cfx_agg_bitmapcomposer.cpp
@@ -58,8 +58,7 @@
DCHECK_NE(src_format, FXDIB_Format::k1bppRgb);
m_SrcFormat = src_format;
if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, src_palette,
- m_MaskColor, m_BlendMode,
- m_pClipMask || m_Alpha != 1.0f, m_bRgbByteOrder)) {
+ m_MaskColor, m_BlendMode, m_bRgbByteOrder)) {
return false;
}
if (m_bVertical) {
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 2d996f3..525c7ef 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -584,7 +584,7 @@
CFX_ScanlineCompositor compositor;
if (!compositor.Init(GetFormat(), source->GetFormat(),
source->GetPaletteSpan(), 0, blend_type,
- pClipMask != nullptr, bRgbByteOrder)) {
+ bRgbByteOrder)) {
return false;
}
const int dest_bytes_per_pixel = GetBPP() / 8;
@@ -656,7 +656,7 @@
const int bytes_per_pixel = GetBPP() / 8;
CFX_ScanlineCompositor compositor;
if (!compositor.Init(GetFormat(), pMask->GetFormat(), {}, color, blend_type,
- pClipMask != nullptr, bRgbByteOrder)) {
+ bRgbByteOrder)) {
return false;
}
for (int row = 0; row < height; row++) {
diff --git a/core/fxge/dib/cfx_scanlinecompositor.cpp b/core/fxge/dib/cfx_scanlinecompositor.cpp
index 0785d8a..c9d190a 100644
--- a/core/fxge/dib/cfx_scanlinecompositor.cpp
+++ b/core/fxge/dib/cfx_scanlinecompositor.cpp
@@ -2184,13 +2184,11 @@
pdfium::span<const uint32_t> src_palette,
uint32_t mask_color,
BlendMode blend_type,
- bool bClip,
bool bRgbByteOrder) {
m_SrcFormat = src_format;
m_DestFormat = dest_format;
m_BlendType = blend_type;
m_bRgbByteOrder = bRgbByteOrder;
- m_bClip = bClip;
if (m_DestFormat == FXDIB_Format::kInvalid ||
m_DestFormat == FXDIB_Format::k1bppMask ||
m_DestFormat == FXDIB_Format::k1bppRgb) {
@@ -2317,7 +2315,7 @@
const int dest_Bpp = GetCompsFromFormat(m_DestFormat);
if (m_bRgbByteOrder) {
if (m_BlendType == BlendMode::kNormal) {
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(
dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan);
return;
@@ -2326,7 +2324,7 @@
dest_scan, src_scan, width, dest_Bpp, src_Bpp);
return;
}
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(
dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp,
clip_scan);
@@ -2338,7 +2336,7 @@
}
if (m_BlendType == BlendMode::kNormal) {
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Rgb_NoBlend_Clip(dest_scan, src_scan, width,
dest_Bpp, src_Bpp, clip_scan);
return;
@@ -2347,7 +2345,7 @@
dest_Bpp, src_Bpp);
return;
}
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Rgb_Blend_Clip(dest_scan, src_scan, width, m_BlendType,
dest_Bpp, src_Bpp, clip_scan);
return;
@@ -2359,7 +2357,7 @@
case FXDIB_Format::kArgb: {
if (m_bRgbByteOrder) {
if (m_BlendType == BlendMode::kNormal) {
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(
dest_scan, src_scan, width, src_Bpp, clip_scan);
return;
@@ -2368,7 +2366,7 @@
width, src_Bpp);
return;
}
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(
dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan);
return;
@@ -2379,7 +2377,7 @@
}
if (m_BlendType == BlendMode::kNormal) {
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Argb_NoBlend_Clip(dest_scan, src_scan, width,
src_Bpp, clip_scan);
return;
@@ -2388,7 +2386,7 @@
src_Bpp);
return;
}
- if (m_bClip) {
+ if (!clip_scan.empty()) {
CompositeRow_Rgb2Argb_Blend_Clip(dest_scan, src_scan, width,
m_BlendType, src_Bpp, clip_scan);
return;
diff --git a/core/fxge/dib/cfx_scanlinecompositor.h b/core/fxge/dib/cfx_scanlinecompositor.h
index e5f9aa6..ed1c958 100644
--- a/core/fxge/dib/cfx_scanlinecompositor.h
+++ b/core/fxge/dib/cfx_scanlinecompositor.h
@@ -26,7 +26,6 @@
pdfium::span<const uint32_t> src_palette,
uint32_t mask_color,
BlendMode blend_type,
- bool bClip,
bool bRgbByteOrder);
void CompositeRgbBitmapLine(pdfium::span<uint8_t> dest_scan,
@@ -113,7 +112,6 @@
int m_MaskBlue;
BlendMode m_BlendType = BlendMode::kNormal;
bool m_bRgbByteOrder = false;
- bool m_bClip = false;
};
#endif // CORE_FXGE_DIB_CFX_SCANLINECOMPOSITOR_H_