Mark parts of CPDF_RenderStatus::CompositeDIBitmap() as Windows-only

The only way for CompositeDIBitmap() to get a mask bitmap is through
CPDF_ImageRenderer::StartDIBBaseFallback(), which is Windows-only. Thus
parts of CompositeDIBitmap() that handle mask bitmaps are also
Windows-only, and otherwise not reachable.

Change-Id: Ibeeba3f05e5d86d18a8fc4ced38fbc274659f4a2
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/123150
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@google.com>
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 3510e34..d2e7cfb 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1232,7 +1232,20 @@
   CHECK(bitmap);
 
   if (blend_mode == BlendMode::kNormal) {
-    if (!bitmap->IsMaskFormat()) {
+    if (bitmap->IsMaskFormat()) {
+#if BUILDFLAG(IS_WIN)
+      FX_ARGB fill_argb = m_Options.TranslateColor(mask_argb);
+      if (alpha != 1.0f) {
+        auto& bgra = reinterpret_cast<FX_BGRA_STRUCT<uint8_t>&>(fill_argb);
+        bgra.alpha *= FXSYS_roundf(alpha * 255) / 255;
+      }
+      if (m_pDevice->SetBitMask(bitmap, left, top, fill_argb)) {
+        return;
+      }
+#else
+      NOTREACHED_NORETURN();
+#endif
+    } else {
       if (alpha != 1.0f) {
         if (CFX_DefaultRenderDevice::UseSkiaRenderer()) {
           CFX_Matrix matrix = CFX_RenderDevice::GetFlipMatrix(
@@ -1246,15 +1259,6 @@
       if (m_pDevice->SetDIBits(bitmap, left, top)) {
         return;
       }
-    } else {
-      FX_ARGB fill_argb = m_Options.TranslateColor(mask_argb);
-      if (alpha != 1.0f) {
-        auto& bgra = reinterpret_cast<FX_BGRA_STRUCT<uint8_t>&>(fill_argb);
-        bgra.alpha *= FXSYS_roundf(alpha * 255) / 255;
-      }
-      if (m_pDevice->SetBitMask(bitmap, left, top, fill_argb)) {
-        return;
-      }
     }
   }
   bool bIsolated = transparency.IsIsolated();
@@ -1287,9 +1291,13 @@
       left = std::min(left, 0);
       top = std::min(top, 0);
       if (bitmap->IsMaskFormat()) {
+#if BUILDFLAG(IS_WIN)
         pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(),
                               bitmap, mask_argb, left, top, blend_mode, nullptr,
                               false);
+#else
+        NOTREACHED_NORETURN();
+#endif
       } else {
         pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(),
                                 bitmap, left, top, blend_mode, nullptr, false);
@@ -1319,9 +1327,13 @@
   const int width = bitmap->GetWidth();
   const int height = bitmap->GetHeight();
   if (bitmap->IsMaskFormat()) {
+#if BUILDFLAG(IS_WIN)
     backdrop->CompositeMask(left - bbox.left, top - bbox.top, width, height,
                             std::move(bitmap), mask_argb, 0, 0, blend_mode,
                             nullptr, false);
+#else
+    NOTREACHED_NORETURN();
+#endif
   } else {
     backdrop->CompositeBitmap(left - bbox.left, top - bbox.top, width, height,
                               std::move(bitmap), 0, 0, blend_mode, nullptr,