Make the DebugValidate() checks used by CFX_SkiaDeviceDriver less strict
Currently, CFX_SkiaDeviceDriver has a DebugValidate() helper function
that checks both `CFX_SkiaDeviceDriver::m_pBitmap` and
`CFX_SkiaDeviceDriver::m_pBackdropBitmap`. CFX_SkiaDeviceDriver does not
directly interact with `m_pBackdropBitmap`, and RealizeSkImage() can
handle the clones of `m_pBackdropBitmap` passed into
CFX_SkiaDeviceDriver::SetDIBits() for all BPP values. Therefore,
DebugValidate() does not need to restrict `m_pBackdropBitmap` to only 8
and 32 BPP.
As part of this CL, make the entire DebugValidate() implementation
debug-only and unsuppress a pixel test that now passes.
Bug: pdfium:2074
Change-Id: I403dce1cafe1df5166dcbb877c5ceec3fd350c4a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/111994
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nigi <nigi@chromium.org>
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 6a79272..e250308 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -156,14 +156,12 @@
#endif // SHOW_SKIA_PATH
}
-static void DebugValidate(const RetainPtr<CFX_DIBitmap>& bitmap,
- const RetainPtr<CFX_DIBitmap>& device) {
+void DebugValidate(const RetainPtr<CFX_DIBitmap>& bitmap) {
+#if DCHECK_IS_ON()
if (bitmap) {
DCHECK(bitmap->GetBPP() == 8 || bitmap->GetBPP() == 32);
}
- if (device) {
- DCHECK(device->GetBPP() == 8 || device->GetBPP() == 32);
- }
+#endif
}
SkColorType Get32BitSkColorType(bool is_rgb_byte_order) {
@@ -1482,7 +1480,7 @@
int bitmap_alpha,
const CFX_Matrix& matrix,
BlendMode blend_type) {
- DebugValidate(m_pBitmap, m_pBackdropBitmap);
+ DebugValidate(m_pBitmap);
sk_sp<SkImage> skia_source = pSource->RealizeSkImage();
if (!skia_source) {
@@ -1518,7 +1516,7 @@
paint);
}
- DebugValidate(m_pBitmap, m_pBackdropBitmap);
+ DebugValidate(m_pBitmap);
return true;
}
@@ -1569,7 +1567,7 @@
const CFX_Matrix& matrix,
const FXDIB_ResampleOptions& options,
BlendMode blend_type) {
- DebugValidate(m_pBitmap, m_pBackdropBitmap);
+ DebugValidate(m_pBitmap);
sk_sp<SkImage> skia_source = pSource->RealizeSkImage();
if (!skia_source) {
@@ -1613,7 +1611,7 @@
&paint, SkCanvas::kFast_SrcRectConstraint);
}
- DebugValidate(m_pBitmap, m_pBackdropBitmap);
+ DebugValidate(m_pBitmap);
return true;
}
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index e52e043..90dd254 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -703,7 +703,6 @@
# TODO(pdfium:2054): Remove after associated bug is fixed
bug_1258968.in * * * gdi
bug_1383708.in * * * gdi
-bug_986108.in * * * gdi
# TODO(pdfium:2055): Remove after associated bug is fixed
barcode_test.pdf * * * gdi