Change ArgbToAlphaAndColorRef() to return uint8_t for the alpha value
The alpha value is always in the range [0, 255].
Change-Id: I4a4e94679422ee542d9e2ab0f19e5dccca86ce3a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/123890
Reviewed-by: Tom Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/dib/fx_dib.cpp b/core/fxge/dib/fx_dib.cpp
index 315e958..918459a 100644
--- a/core/fxge/dib/fx_dib.cpp
+++ b/core/fxge/dib/fx_dib.cpp
@@ -53,7 +53,7 @@
return {FXARGB_B(argb), FXARGB_G(argb), FXARGB_R(argb)};
}
-std::pair<int, FX_COLORREF> ArgbToAlphaAndColorRef(FX_ARGB argb) {
+std::pair<uint8_t, FX_COLORREF> ArgbToAlphaAndColorRef(FX_ARGB argb) {
return {FXARGB_A(argb), ArgbToColorRef(argb)};
}
diff --git a/core/fxge/dib/fx_dib.h b/core/fxge/dib/fx_dib.h
index 363d26e..9a0f699 100644
--- a/core/fxge/dib/fx_dib.h
+++ b/core/fxge/dib/fx_dib.h
@@ -180,7 +180,7 @@
FX_BGR_STRUCT<uint8_t> ArgbToBGRStruct(FX_ARGB argb);
// Returns (a, FX_COLORREF)
-std::pair<int, FX_COLORREF> ArgbToAlphaAndColorRef(FX_ARGB argb);
+std::pair<uint8_t, FX_COLORREF> ArgbToAlphaAndColorRef(FX_ARGB argb);
FX_COLORREF ArgbToColorRef(FX_ARGB argb);
FX_ARGB AlphaAndColorRefToArgb(int a, FX_COLORREF colorref);