[Skia] Fix the issue that tile borders are rendered in a darker color
When drawing tiles with transparency, the borders of the tiles will
have a darker shade of color due to overlapping unless stroking the
paths of the borders are skipped.
This process is already handled by CFX_SkiaDeviceDriver::DrawPath()
when `CFX_SkiaDeviceDriver` has `m_groupKnockout` set to true. However,
`m_groupKnockout` is never set to true when Skia is enabled because
its device cap contains the `FXRC_FILLSTROKE_PATH` option.
Since CFX_SkiaDeviceDriver::DrawPaths() can handle drawing transparent
tiles correctly and we should avoid calling
CFX_RenderDevice::DrawFillStrokePath() for Skia rendering, this CL sets
`m_groupKnockout` to true for Skia to directly handle this special case
through CFX_SkiaDeviceDriver::DrawPaths().
Bug: pdfium:1748
Change-Id: I55ae5745aa76d173c7c017bbc206f37656dc5e7a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/94372
Commit-Queue: Nigi <nigi@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_rendertiling.cpp b/core/fpdfapi/render/cpdf_rendertiling.cpp
index 2e0fc88..571ffb2 100644
--- a/core/fpdfapi/render/cpdf_rendertiling.cpp
+++ b/core/fpdfapi/render/cpdf_rendertiling.cpp
@@ -37,7 +37,8 @@
return nullptr;
}
CFX_DefaultRenderDevice bitmap_device;
- bitmap_device.Attach(pBitmap, false, nullptr, false);
+ bitmap_device.Attach(pBitmap, /*bRgbByteOrder=*/false,
+ /*pBackdropBitmap=*/nullptr, /*bGroupKnockout=*/true);
pBitmap->Clear(0);
CFX_FloatRect cell_bbox =
pPattern->pattern_to_form().TransformRect(pPattern->bbox());
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index 6903a24..b697dcc 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -330,9 +330,6 @@
# TODO(pdfium:1747): Remove after associated bug is fixed
bug_1258634.in * * * skia
-# TODO(pdfium:1748): Remove after associated bug is fixed
-bug_1286.in * * * skia
-
# TODO(pdfium:1331): Remove after associated bug is fixed
bug_1331.in * * * *