Fix some nits in CFX_DIBBase and one of its callers.

- Make the ClipTo() declaration match the definition.
- Consistently use size_t to store GetRequiredPaletteSize() return
  values.
- Do more checks with check_op.h functions.

Change-Id: I6c4cc1bea4a3775e23b5972f9188cae43df58e73
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/86591
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/dib/cfx_dibbase.cpp b/core/fxge/dib/cfx_dibbase.cpp
index 6842362..9819e0e 100644
--- a/core/fxge/dib/cfx_dibbase.cpp
+++ b/core/fxge/dib/cfx_dibbase.cpp
@@ -256,7 +256,7 @@
                           src_left, src_top);
   const size_t plt_size = pSrcBitmap->GetRequiredPaletteSize();
   pdfium::span<const uint32_t> src_span = pSrcBitmap->GetPaletteSpan();
-  CHECK(plt_size <= src_span.size());
+  CHECK_LE(plt_size, src_span.size());
 
   const uint32_t* src_plt = src_span.data();
   for (size_t i = 0; i < plt_size; ++i)
@@ -770,8 +770,8 @@
   if (width == 0 || height == 0)
     return false;
 
-  DCHECK(width > 0);
-  DCHECK(height > 0);
+  DCHECK_GT(width, 0);
+  DCHECK_GT(height, 0);
 
   if (dest_left > m_Width || dest_top > m_Height)
     return false;
diff --git a/core/fxge/dib/cfx_dibbase.h b/core/fxge/dib/cfx_dibbase.h
index 0473b52..be8ff7f 100644
--- a/core/fxge/dib/cfx_dibbase.h
+++ b/core/fxge/dib/cfx_dibbase.h
@@ -61,7 +61,7 @@
   void SetPalette(pdfium::span<const uint32_t> src_palette);
 
   RetainPtr<CFX_DIBitmap> Realize() const;
-  RetainPtr<CFX_DIBitmap> ClipTo(const FX_RECT& clip) const;
+  RetainPtr<CFX_DIBitmap> ClipTo(const FX_RECT& rect) const;
   RetainPtr<CFX_DIBitmap> ConvertTo(FXDIB_Format format) const;
   RetainPtr<CFX_DIBitmap> StretchTo(int dest_width,
                                     int dest_height,
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index ce8f61d..51c8f2c 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -675,9 +675,9 @@
       if (pSource->HasPalette()) {
         dst32Storage.reset(FX_Alloc2D(uint32_t, width, height));
         SkPMColor* dst32Pixels = dst32Storage.get();
-        const unsigned src_palette_size = pSource->GetRequiredPaletteSize();
+        const size_t src_palette_size = pSource->GetRequiredPaletteSize();
         pdfium::span<const uint32_t> src_palette = pSource->GetPaletteSpan();
-        CHECK(src_palette_size <= src_palette.size());
+        CHECK_LE(src_palette_size, src_palette.size());
         for (int y = 0; y < height; ++y) {
           const uint8_t* srcRow =
               static_cast<const uint8_t*>(buffer) + y * rowBytes;