Lukasz Anforowicz a1229deddf [rust png] Fix handling of discard_transparency in EncodeBGRAPNG.
https://pdfium-review.googlesource.com/c/pdfium/+/136570 has landed an
implementation of `EncodeBGRAPNG` that ignores `discard_transparency`.
This behavior was different from the old, `libpng`-based implementation
as shown by the new `EncodeBGRAPNGAndDiscardTransparency` test where
the last assertion (`EXPECT_EQ(rgba_output[3], 255)`) would pass with
`libpng`-based implementation but (before this CL) fail with the
Rust-based implementation.

Bug: 444045690
Change-Id: Ifa894e36ab0f568aeea8a4421bc8ed9010f23d6b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/138891
Auto-Submit: Łukasz Anforowicz <lukasza@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2025-12-03 14:35:49 -08:00

36 lines
812 B
Plaintext

# Copyright 2018 The PDFium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../pdfium.gni")
import("../../testing/test.gni")
source_set("image_diff") {
testonly = true
sources = [ "image_diff_png.h" ]
deps = []
if (pdf_use_skia) {
sources += [ "image_diff_png_skia.cpp" ]
deps += [ "//skia" ]
} else {
sources += [ "image_diff_png_libpng.cpp" ]
deps += [
"../../third_party:png",
"../../third_party:zlib",
]
}
configs += [
"../../:pdfium_strict_config",
"../../:pdfium_noshorten_config",
]
public_deps = [ "../../core/fxcrt" ]
}
pdfium_unittest_source_set("unittests") {
sources = [ "image_diff_png_unittests.cpp" ]
deps = [ ":image_diff" ]
pdfium_root_dir = "../../"
}