Rename CFX_DIBBase::IsAlphaMask() to IsMask().

The underlying format has two separate flags bits: one for alpha, and
one for mask. This method is only checking for the mask bit, and is
not affected by the alpha bit. Removing alpha from the name made it
less confusing to me.

Change-Id: I2d138b865f883eb0c585f63a8f86328a17080991
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/75435
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index 5e38033..0ba29e5 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -181,7 +181,7 @@
     int32_t set_r = 0;
     int32_t set_g = 0;
     int32_t set_b = 0;
-    if (!pBitmap->IsAlphaMask()) {
+    if (!pBitmap->IsMask()) {
       std::tie(reset_a, reset_r, reset_g, reset_b) =
           ArgbDecode(pBitmap->GetPaletteArgb(0));
       std::tie(set_a, set_r, set_g, set_b) =
@@ -317,7 +317,7 @@
     m_pStream = pdfium::MakeRetain<CPDF_Stream>();
 
   m_pStream->InitStream(dest_span, std::move(pDict));
-  m_bIsMask = pBitmap->IsAlphaMask();
+  m_bIsMask = pBitmap->IsMask();
   m_Width = BitmapWidth;
   m_Height = BitmapHeight;
 }
diff --git a/core/fpdfapi/page/cpdf_transferfuncdib.cpp b/core/fpdfapi/page/cpdf_transferfuncdib.cpp
index 50e181f..44e9c91 100644
--- a/core/fpdfapi/page/cpdf_transferfuncdib.cpp
+++ b/core/fpdfapi/page/cpdf_transferfuncdib.cpp
@@ -33,7 +33,7 @@
 CPDF_TransferFuncDIB::~CPDF_TransferFuncDIB() = default;
 
 FXDIB_Format CPDF_TransferFuncDIB::GetDestFormat() const {
-  if (m_pSrc->IsAlphaMask())
+  if (m_pSrc->IsMask())
     return FXDIB_Format::k8bppMask;
 
 #if defined(OS_APPLE)
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index 0e1f059..160c584 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -91,7 +91,7 @@
   m_FillArgb = 0;
   m_bPatternColor = false;
   m_pPattern = nullptr;
-  if (m_pDIBBase->IsAlphaMask()) {
+  if (m_pDIBBase->IsMask()) {
     const CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor();
     if (pColor && pColor->IsPattern()) {
       m_pPattern.Reset(pColor->GetPattern());
@@ -450,7 +450,7 @@
       return false;
     }
   }
-  if (m_pDIBBase->IsAlphaMask()) {
+  if (m_pDIBBase->IsMask()) {
     if (m_BitmapAlpha != 255)
       m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
     if (m_pRenderStatus->GetRenderDevice()->StretchBitMaskWithFlags(
@@ -493,7 +493,7 @@
     return false;
   }
   RetainPtr<CFX_DIBBase> pAlphaMask;
-  if (m_pDIBBase->IsAlphaMask())
+  if (m_pDIBBase->IsMask())
     pAlphaMask = m_pDIBBase;
   else
     pAlphaMask = m_pDIBBase->CloneAlphaMask();
@@ -572,7 +572,7 @@
   if (!pBitmap)
     return false;
 
-  if (pBitmap->IsAlphaMask()) {
+  if (pBitmap->IsMask()) {
     if (m_BitmapAlpha != 255)
       m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
     m_Result = m_pRenderStatus->GetRenderDevice()->SetBitMask(
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 698dd53..4baedf5 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1253,7 +1253,7 @@
     return;
 
   if (blend_mode == BlendMode::kNormal) {
-    if (!pDIBitmap->IsAlphaMask()) {
+    if (!pDIBitmap->IsMask()) {
       if (bitmap_alpha < 255) {
 #if defined(_SKIA_SUPPORT_)
         std::unique_ptr<CFX_ImageRenderer> dummy;
@@ -1292,7 +1292,7 @@
        (m_pDevice->GetRenderCaps() & FXRC_GET_BITS) && !bBackAlphaRequired);
   if (bGetBackGround) {
     if (bIsolated || !transparency.IsGroup()) {
-      if (!pDIBitmap->IsAlphaMask())
+      if (!pDIBitmap->IsMask())
         m_pDevice->SetDIBitsWithBlend(pDIBitmap, left, top, blend_mode);
       return;
     }
@@ -1312,7 +1312,7 @@
                               BlendMode::kNormal, nullptr, false);
       left = std::min(left, 0);
       top = std::min(top, 0);
-      if (pDIBitmap->IsAlphaMask()) {
+      if (pDIBitmap->IsMask()) {
         pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(),
                               pDIBitmap, mask_argb, left, top, blend_mode,
                               nullptr, false);
@@ -1327,7 +1327,7 @@
     if (m_pDevice->GetBackDrop()) {
       m_pDevice->SetDIBits(pClone, rect.left, rect.top);
     } else {
-      if (!pDIBitmap->IsAlphaMask()) {
+      if (!pDIBitmap->IsMask()) {
         m_pDevice->SetDIBitsWithBlend(pDIBitmap, rect.left, rect.top,
                                       blend_mode);
       }
@@ -1344,7 +1344,7 @@
   if (!pBackdrop)
     return;
 
-  if (pDIBitmap->IsAlphaMask()) {
+  if (pDIBitmap->IsMask()) {
     pBackdrop->CompositeMask(left - back_left, top - back_top,
                              pDIBitmap->GetWidth(), pDIBitmap->GetHeight(),
                              pDIBitmap, mask_argb, 0, 0, blend_mode, nullptr,
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 6fcbb8c..e46140c 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -827,7 +827,7 @@
 
   if (m_pDevice->GetBPP() == 8) {
     ASSERT(!m_bRgbByteOrder);
-    if (m_pDevice->IsAlphaMask())
+    if (m_pDevice->IsMask())
       m_Gray = 255;
     else
       m_Gray = FXRGB2GRAY(FXARGB_R(color), FXARGB_G(color), FXARGB_B(color));
@@ -856,7 +856,7 @@
         m_pBackdropDevice->GetBuffer() + m_pBackdropDevice->GetPitch() * y;
   }
   int Bpp = m_pDevice->GetBPP() / 8;
-  bool bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
+  bool bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsMask();
   unsigned num_spans = sl.num_spans();
   typename Scanline::const_iterator span = sl.begin();
   while (1) {
@@ -1066,7 +1066,7 @@
                   FXRC_BLEND_MODE | FXRC_SOFT_CLIP;
       if (m_pBitmap->HasAlpha()) {
         flags |= FXRC_ALPHA_OUTPUT;
-      } else if (m_pBitmap->IsAlphaMask()) {
+      } else if (m_pBitmap->IsMask()) {
         if (m_pBitmap->GetBPP() == 1)
           flags |= FXRC_BITMASK_OUTPUT;
         else
@@ -1360,7 +1360,7 @@
   if (!m_pBitmap->GetBuffer())
     return true;
 
-  if (pBitmap->IsAlphaMask()) {
+  if (pBitmap->IsMask()) {
     return m_pBitmap->CompositeMask(left, top, src_rect.Width(),
                                     src_rect.Height(), pBitmap, argb,
                                     src_rect.left, src_rect.top, blend_type,
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index f5baedb..aa3bdb1 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -690,7 +690,7 @@
                                           int left,
                                           int top,
                                           BlendMode blend_mode) {
-  ASSERT(!pBitmap->IsAlphaMask());
+  ASSERT(!pBitmap->IsMask());
   FX_RECT dest_rect(left, top, left + pBitmap->GetWidth(),
                     top + pBitmap->GetHeight());
   dest_rect.Intersect(m_ClipBox);
@@ -959,7 +959,7 @@
     if (!CreateCompatibleBitmap(bitmap, pixel_width, pixel_height))
       return false;
   }
-  if (!bitmap->HasAlpha() && !bitmap->IsAlphaMask()) {
+  if (!bitmap->HasAlpha() && !bitmap->IsMask()) {
     bitmap->Clear(0xFFFFFFFF);
     if (!GetDIBits(bitmap, bmp_rect.left, bmp_rect.top))
       return false;
@@ -1010,7 +1010,7 @@
     DrawNormalTextHelper(bitmap, pGlyph, nrows, point->x, point->y, start_col,
                          end_col, normalize, x_subpixel, a, r, g, b);
   }
-  if (bitmap->IsAlphaMask())
+  if (bitmap->IsMask())
     SetBitMask(bitmap, bmp_rect.left, bmp_rect.top, fill_color);
   else
     SetDIBits(bitmap, bmp_rect.left, bmp_rect.top);
diff --git a/core/fxge/dib/cfx_dibbase.cpp b/core/fxge/dib/cfx_dibbase.cpp
index 44eff54..ef9d6b6 100644
--- a/core/fxge/dib/cfx_dibbase.cpp
+++ b/core/fxge/dib/cfx_dibbase.cpp
@@ -789,7 +789,7 @@
 }
 
 size_t CFX_DIBBase::GetPaletteSize() const {
-  if (IsAlphaMask())
+  if (IsMask())
     return 0;
 
   switch (GetBppFromFormat(m_Format)) {
@@ -803,7 +803,7 @@
 }
 
 uint32_t CFX_DIBBase::GetPaletteArgb(int index) const {
-  ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
+  ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsMask());
   if (HasPalette())
     return GetPaletteSpan()[index];
 
@@ -820,13 +820,13 @@
 }
 
 void CFX_DIBBase::SetPaletteArgb(int index, uint32_t color) {
-  ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
+  ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsMask());
   BuildPalette();
   m_palette[index] = color;
 }
 
 int CFX_DIBBase::FindPalette(uint32_t color) const {
-  ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
+  ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsMask());
   if (HasPalette()) {
     int palsize = (1 << GetBPP());
     pdfium::span<const uint32_t> palette = GetPaletteSpan();
diff --git a/core/fxge/dib/cfx_dibbase.h b/core/fxge/dib/cfx_dibbase.h
index 6c11b69..c8550cf 100644
--- a/core/fxge/dib/cfx_dibbase.h
+++ b/core/fxge/dib/cfx_dibbase.h
@@ -59,10 +59,10 @@
   const uint32_t* GetPaletteData() const { return m_palette.data(); }
   int GetBPP() const { return GetBppFromFormat(m_Format); }
 
-  bool IsAlphaMask() const { return GetIsMaskFromFormat(m_Format); }
+  bool IsMask() const { return GetIsMaskFromFormat(m_Format); }
   bool HasAlpha() const { return GetIsAlphaFromFormat(m_Format); }
   bool IsCmykImage() const { return GetIsCmykFromFormat(m_Format); }
-  bool IsOpaqueImage() const { return !IsAlphaMask() && !HasAlpha(); }
+  bool IsOpaqueImage() const { return !IsMask() && !HasAlpha(); }
 
   size_t GetPaletteSize() const;
 
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 3b3cbe3..d8da3ba 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -278,7 +278,7 @@
     return false;
 
   RetainPtr<CFX_DIBBase> pSrcClone = pSrcBitmap;
-  if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask())
+  if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsMask())
     return false;
 
   if (pSrcBitmap->GetBPP() == 1) {
@@ -289,7 +289,7 @@
   int srcOffset = pSrcBitmap->GetFormat() == FXDIB_Format::kArgb ? 3 : 0;
   int destOffset = 0;
   if (destChannel == FXDIB_Alpha) {
-    if (IsAlphaMask()) {
+    if (IsMask()) {
       if (!ConvertFormat(FXDIB_Format::k8bppMask))
         return false;
     } else {
@@ -301,7 +301,7 @@
         destOffset = 3;
     }
   } else {
-    if (IsAlphaMask())
+    if (IsMask())
       return false;
 
     if (GetBPP() < 24) {
@@ -370,7 +370,7 @@
 
   int destOffset;
   if (destChannel == FXDIB_Alpha) {
-    if (IsAlphaMask()) {
+    if (IsMask()) {
       if (!ConvertFormat(FXDIB_Format::k8bppMask)) {
         return false;
       }
@@ -386,7 +386,7 @@
       }
     }
   } else {
-    if (IsAlphaMask()) {
+    if (IsMask()) {
       return false;
     }
     if (GetBPP() < 24) {
@@ -433,12 +433,12 @@
   if (!m_pBuffer)
     return false;
 
-  if (!pSrcBitmap->IsAlphaMask()) {
+  if (!pSrcBitmap->IsMask()) {
     NOTREACHED();
     return false;
   }
 
-  if (!IsAlphaMask() && !HasAlpha())
+  if (!IsMask() && !HasAlpha())
     return LoadChannelFromAlpha(FXDIB_Alpha, pSrcBitmap);
 
   RetainPtr<CFX_DIBitmap> pSrcClone = pSrcBitmap.As<CFX_DIBitmap>();
@@ -449,7 +449,7 @@
     if (!pSrcClone)
       return false;
   }
-  if (IsAlphaMask()) {
+  if (IsMask()) {
     if (!ConvertFormat(FXDIB_Format::k8bppMask))
       return false;
 
@@ -829,7 +829,7 @@
 }
 
 bool CFX_DIBitmap::ConvertColorScale(uint32_t forecolor, uint32_t backcolor) {
-  if (!m_pBuffer || IsAlphaMask())
+  if (!m_pBuffer || IsMask())
     return false;
 
   if (IsCmykImage())
@@ -884,7 +884,7 @@
                                    BlendMode blend_type,
                                    const CFX_ClipRgn* pClipRgn,
                                    bool bRgbByteOrder) {
-  if (pSrcBitmap->IsAlphaMask()) {
+  if (pSrcBitmap->IsMask()) {
     // Should have called CompositeMask().
     NOTREACHED();
     return false;
@@ -964,7 +964,7 @@
                                  BlendMode blend_type,
                                  const CFX_ClipRgn* pClipRgn,
                                  bool bRgbByteOrder) {
-  if (!pMask->IsAlphaMask()) {
+  if (!pMask->IsMask()) {
     // Should have called CompositeBitmap().
     NOTREACHED();
     return false;
@@ -1051,7 +1051,7 @@
   uint8_t* color_p = reinterpret_cast<uint8_t*>(&dst_color);
   if (GetBppFromFormat(m_Format) == 8) {
     uint8_t gray = 255;
-    if (!IsAlphaMask()) {
+    if (!IsMask()) {
       if (alpha_flag >> 8) {
         uint8_t r;
         uint8_t g;
diff --git a/core/fxge/dib/cfx_imagerenderer.cpp b/core/fxge/dib/cfx_imagerenderer.cpp
index 8cbf880..0db7fd1 100644
--- a/core/fxge/dib/cfx_imagerenderer.cpp
+++ b/core/fxge/dib/cfx_imagerenderer.cpp
@@ -96,7 +96,7 @@
   if (!pBitmap || !pBitmap->GetBuffer())
     return false;
 
-  if (pBitmap->IsAlphaMask()) {
+  if (pBitmap->IsMask()) {
     if (m_BitmapAlpha != 255)
       m_MaskColor = FXARGB_MUL_ALPHA(m_MaskColor, m_BitmapAlpha);
     m_pDevice->CompositeMask(
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index f39b03e..84368b8 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -102,7 +102,7 @@
 }
 
 FXDIB_Format GetTransformedFormat(const RetainPtr<CFX_DIBBase>& pDrc) {
-  if (pDrc->IsAlphaMask())
+  if (pDrc->IsMask())
     return FXDIB_Format::k8bppMask;
 
   FXDIB_Format format = pDrc->GetFormat();
@@ -448,7 +448,7 @@
   CalcData cdata = {pTransformed.Get(), result2stretch,
                     m_Storer.GetBitmap()->GetBuffer(),
                     m_Storer.GetBitmap()->GetPitch()};
-  if (m_Storer.GetBitmap()->IsAlphaMask()) {
+  if (m_Storer.GetBitmap()->IsMask()) {
     CalcAlpha(cdata);
   } else {
     int Bpp = m_Storer.GetBitmap()->GetBPP() / 8;
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 520ae98..6ba27d6 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -641,11 +641,11 @@
   void* buffer = pSource->GetBuffer();
   if (!buffer)
     return false;
-  SkColorType colorType = forceAlpha || pSource->IsAlphaMask()
+  SkColorType colorType = forceAlpha || pSource->IsMask()
                               ? SkColorType::kAlpha_8_SkColorType
                               : SkColorType::kGray_8_SkColorType;
   SkAlphaType alphaType =
-      pSource->IsAlphaMask() ? kPremul_SkAlphaType : kOpaque_SkAlphaType;
+      pSource->IsMask() ? kPremul_SkAlphaType : kOpaque_SkAlphaType;
   int width = pSource->GetWidth();
   int height = pSource->GetHeight();
   int rowBytes = pSource->GetPitch();
@@ -1882,7 +1882,7 @@
                   FXRC_BLEND_MODE | FXRC_SOFT_CLIP | FXRC_SHADING;
       if (m_pBitmap->HasAlpha()) {
         flags |= FXRC_ALPHA_OUTPUT;
-      } else if (m_pBitmap->IsAlphaMask()) {
+      } else if (m_pBitmap->IsMask()) {
         if (m_pBitmap->GetBPP() == 1) {
           flags |= FXRC_BITMASK_OUTPUT;
         } else {
@@ -2447,7 +2447,7 @@
 
 #if defined(_SKIA_SUPPORT_PATHS_)
   Flush();
-  if (pBitmap->IsAlphaMask()) {
+  if (pBitmap->IsMask()) {
     return m_pBitmap->CompositeMask(left, top, src_rect.Width(),
                                     src_rect.Height(), pBitmap, argb,
                                     src_rect.left, src_rect.top, blend_type,
@@ -2533,7 +2533,7 @@
     SetBitmapMatrix(matrix, width, height, &skMatrix);
     m_pCanvas->concat(skMatrix);
     SkPaint paint;
-    SetBitmapPaint(pSource->IsAlphaMask(), !m_FillOptions.aliased_path, argb,
+    SetBitmapPaint(pSource->IsMask(), !m_FillOptions.aliased_path, argb,
                    bitmap_alpha, blend_type, &paint);
     // TODO(caryclark) Once Skia supports 8 bit src to 8 bit dst remove this
     if (m_pBitmap && m_pBitmap->GetBPP() == 8 && pSource->GetBPP() == 8) {
@@ -2667,8 +2667,8 @@
     SetBitmapMatrix(matrix, srcWidth, srcHeight, &skMatrix);
     m_pCanvas->concat(skMatrix);
     SkPaint paint;
-    SetBitmapPaint(pSource->IsAlphaMask(), !m_FillOptions.aliased_path,
-                   0xFFFFFFFF, bitmap_alpha, blend_type, &paint);
+    SetBitmapPaint(pSource->IsMask(), !m_FillOptions.aliased_path, 0xFFFFFFFF,
+                   bitmap_alpha, blend_type, &paint);
     sk_sp<SkImage> skSrc = SkImage::MakeFromBitmap(skBitmap);
     sk_sp<SkShader> skSrcShader =
         skSrc->makeShader(SkTileMode::kClamp, SkTileMode::kClamp);
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index f0801d0..e391505 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -312,7 +312,7 @@
     return false;
 
   int alpha = FXARGB_A(color);
-  if (pSource->IsAlphaMask() && (alpha < 255 || pSource->GetBPP() != 1))
+  if (pSource->IsMask() && (alpha < 255 || pSource->GetBPP() != 1))
     return false;
 
   m_pStream->WriteString("q\n");
@@ -339,7 +339,7 @@
     uint32_t output_size;
     bool compressed = FaxCompressData(std::move(src_buf), width, height,
                                       &output_buf, &output_size);
-    if (pSource->IsAlphaMask()) {
+    if (pSource->IsMask()) {
       SetColor(color);
       m_bColorSet = false;
       buf << " true[";
@@ -353,7 +353,7 @@
       buf << "<</K -1/EndOfBlock false/Columns " << width << "/Rows " << height
           << ">>/CCITTFaxDecode filter ";
     }
-    if (pSource->IsAlphaMask())
+    if (pSource->IsMask())
       buf << "iM\n";
     else
       buf << "false 1 colorimage\n";
diff --git a/core/fxge/win32/cgdi_display_driver.cpp b/core/fxge/win32/cgdi_display_driver.cpp
index 9e9a968..f438be1 100644
--- a/core/fxge/win32/cgdi_display_driver.cpp
+++ b/core/fxge/win32/cgdi_display_driver.cpp
@@ -77,7 +77,7 @@
                                   int top,
                                   BlendMode blend_type) {
   ASSERT(blend_type == BlendMode::kNormal);
-  if (pSource->IsAlphaMask()) {
+  if (pSource->IsMask()) {
     int width = pSource->GetWidth(), height = pSource->GetHeight();
     int alpha = FXARGB_A(color);
     if (pSource->GetBPP() != 1 || alpha != 255) {
@@ -163,7 +163,7 @@
     return UseFoxitStretchEngine(pSource, color, dest_left, dest_top,
                                  dest_width, dest_height, pClipRect, options);
   }
-  if (pSource->IsAlphaMask()) {
+  if (pSource->IsMask()) {
     FX_RECT image_rect;
     image_rect.left = dest_width > 0 ? dest_left : dest_left + dest_width;
     image_rect.right = dest_width > 0 ? dest_left + dest_width : dest_left;
diff --git a/core/fxge/win32/cgdi_printer_driver.cpp b/core/fxge/win32/cgdi_printer_driver.cpp
index 11888ea..d027140 100644
--- a/core/fxge/win32/cgdi_printer_driver.cpp
+++ b/core/fxge/win32/cgdi_printer_driver.cpp
@@ -75,7 +75,7 @@
                                   int left,
                                   int top,
                                   BlendMode blend_type) {
-  if (pSource->IsAlphaMask()) {
+  if (pSource->IsMask()) {
     FX_RECT clip_rect(left, top, left + src_rect.Width(),
                       top + src_rect.Height());
     return StretchDIBits(pSource, color, left - src_rect.left,
@@ -84,7 +84,7 @@
                          FXDIB_ResampleOptions(), BlendMode::kNormal);
   }
   ASSERT(pSource);
-  ASSERT(!pSource->IsAlphaMask());
+  ASSERT(!pSource->IsMask());
   ASSERT(blend_type == BlendMode::kNormal);
   if (pSource->HasAlpha())
     return false;
@@ -106,7 +106,7 @@
                                       const FX_RECT* pClipRect,
                                       const FXDIB_ResampleOptions& options,
                                       BlendMode blend_type) {
-  if (pSource->IsAlphaMask()) {
+  if (pSource->IsMask()) {
     int alpha = FXARGB_A(color);
     if (pSource->GetBPP() != 1 || alpha != 255)
       return false;
@@ -168,7 +168,7 @@
                                     std::unique_ptr<CFX_ImageRenderer>* handle,
                                     BlendMode blend_type) {
   if (bitmap_alpha < 255 || pSource->HasAlpha() ||
-      (pSource->IsAlphaMask() && (pSource->GetBPP() != 1))) {
+      (pSource->IsMask() && (pSource->GetBPP() != 1))) {
     return false;
   }
   CFX_FloatRect unit_rect = matrix.GetUnitRect();
diff --git a/testing/fuzzers/pdf_scanlinecompositor_fuzzer.cc b/testing/fuzzers/pdf_scanlinecompositor_fuzzer.cc
index 4c23918..48ae4ab 100644
--- a/testing/fuzzers/pdf_scanlinecompositor_fuzzer.cc
+++ b/testing/fuzzers/pdf_scanlinecompositor_fuzzer.cc
@@ -65,7 +65,7 @@
   std::unique_ptr<CFX_ClipRgn> clip_rgn;
   if (is_clip)
     clip_rgn = std::make_unique<CFX_ClipRgn>(width, height);
-  if (src_bitmap->IsAlphaMask()) {
+  if (src_bitmap->IsMask()) {
     dest_bitmap->CompositeMask(dest_left, dest_top, width, height, src_bitmap,
                                argb, src_left, src_top, blend_mode,
                                clip_rgn.get(), is_rgb_byte_order);
diff --git a/xfa/fxfa/cxfa_imagerenderer.cpp b/xfa/fxfa/cxfa_imagerenderer.cpp
index 8b96e3a..dd6f099 100644
--- a/xfa/fxfa/cxfa_imagerenderer.cpp
+++ b/xfa/fxfa/cxfa_imagerenderer.cpp
@@ -67,7 +67,7 @@
       return false;
     }
   }
-  if (m_pDIBBase->IsAlphaMask()) {
+  if (m_pDIBBase->IsMask()) {
     if (m_pDevice->StretchBitMaskWithFlags(m_pDIBBase, dest_left, dest_top,
                                            dest_width, dest_height, 0,
                                            options)) {
@@ -98,7 +98,7 @@
     if (!pBitmap)
       return false;
 
-    if (pBitmap->IsAlphaMask()) {
+    if (pBitmap->IsMask()) {
       m_pDevice->SetBitMask(pBitmap, m_pTransformer->result().left,
                             m_pTransformer->result().top, 0);
     } else {
@@ -121,7 +121,7 @@
   if (!pDIBitmap)
     return;
 
-  if (!pDIBitmap->IsAlphaMask()) {
+  if (!pDIBitmap->IsMask()) {
     if (m_pDevice->SetDIBits(pDIBitmap, left, top))
       return;
   } else if (m_pDevice->SetBitMask(pDIBitmap, left, top, 0)) {
@@ -132,7 +132,7 @@
                         (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) &&
                          (m_pDevice->GetRenderCaps() & FXRC_GET_BITS));
   if (bGetBackGround) {
-    if (pDIBitmap->IsAlphaMask())
+    if (pDIBitmap->IsMask())
       return;
 
     m_pDevice->SetDIBitsWithBlend(pDIBitmap, left, top, BlendMode::kNormal);