Change CFX_DIBitmap::CalculatePitchAndSize() parameter ordering.

Height followed by width is unintuitive. Flip it around and fix callers.
Some existing callers had been calling CalculatePitchAndSize() in the
wrong order, but luckily those did not matter. The ordering only affects
the pitch and those callers did not use the pitch value.

Change-Id: I8ac97e1d58185ecb98f660c7c0a3825af627af01
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73392
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index ad12939..61e1222 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -48,7 +48,7 @@
   m_Pitch = 0;
 
   Optional<PitchAndSize> pitch_size =
-      CalculatePitchAndSize(height, width, format, pitch);
+      CalculatePitchAndSize(width, height, format, pitch);
   if (!pitch_size.has_value())
     return false;
 
@@ -842,8 +842,8 @@
 
 // static
 Optional<CFX_DIBitmap::PitchAndSize> CFX_DIBitmap::CalculatePitchAndSize(
-    int height,
     int width,
+    int height,
     FXDIB_Format format,
     uint32_t pitch) {
   if (width <= 0 || height <= 0)
diff --git a/core/fxge/dib/cfx_dibitmap.h b/core/fxge/dib/cfx_dibitmap.h
index 27a8de0..dfeb3c2 100644
--- a/core/fxge/dib/cfx_dibitmap.h
+++ b/core/fxge/dib/cfx_dibitmap.h
@@ -106,8 +106,8 @@
   // If |pitch| is non-zero, then that be used as the actual pitch.
   // The actual pitch will be used to calculate the size.
   // Returns the calculated pitch and size on success, or nullopt on failure.
-  static Optional<PitchAndSize> CalculatePitchAndSize(int height,
-                                                      int width,
+  static Optional<PitchAndSize> CalculatePitchAndSize(int width,
+                                                      int height,
                                                       FXDIB_Format format,
                                                       uint32_t pitch);