Remove SK_RESOLVE_FILTERS_BEFORE_RESTORE flag (flutter/engine#49563)

Update SaveLayerConsolidation unit tests to allow 1px differences due to rounding differences when Skia elides image filter passes and can calculate the CF and opacity in full float without an intermediate conversion to 8-bit color.

This is the last remaining use of the staging that will allow closing https://g-issues.skia.org/issues/40042615.

*List which issues are fixed by this PR. You must list at least one issue.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Michael Ludwig
2024-05-31 16:38:32 -04:00
committed by GitHub
parent 8613caf1d2
commit 90b9b7a455
2 changed files with 16 additions and 8 deletions

View File

@@ -2650,7 +2650,7 @@ class CanvasCompareTester {
static void compareToReference(const RenderResult* test_result,
const RenderResult* ref_result,
const std::string& info,
SkRect* bounds,
const SkRect* bounds,
const BoundsTolerance* tolerance,
const DlColor bg,
bool fuzzyCompares = false,
@@ -3960,15 +3960,24 @@ TEST_F(DisplayListRendering, SaveLayerConsolidation) {
// when we claim that they are compatible and they aren't.
const bool always = false;
// In some circumstances, Skia can combine image filter evaluations
// and elide a renderpass. In this case rounding and precision of inputs
// to color filters may cause the output to differ by 1.
if (always || same) {
CanvasCompareTester::quickCompareToReference(
nested_results.get(), combined_results.get(), same,
"nested " + desc1 + " then " + desc2);
CanvasCompareTester::compareToReference(
nested_results.get(), combined_results.get(),
"nested " + desc1 + " then " + desc2, /*bounds=*/nullptr,
/*tolerance=*/nullptr, DlColor::kTransparent(),
/*fuzzyCompares=*/true, combined_results->width(),
combined_results->height(), /*printMismatches=*/true);
}
if (always || rev_same) {
CanvasCompareTester::quickCompareToReference(
reverse_results.get(), combined_results.get(), rev_same,
"nested " + desc2 + " then " + desc1);
CanvasCompareTester::compareToReference(
reverse_results.get(), combined_results.get(),
"nested " + desc2 + " then " + desc1, /*bounds=*/nullptr,
/*tolerance=*/nullptr, DlColor::kTransparent(),
/*fuzzyCompares=*/true, combined_results->width(),
combined_results->height(), /*printMismatches=*/true);
}
};

View File

@@ -11,7 +11,6 @@ flutter_defines = [
# Staging
"SK_LEGACY_IGNORE_DRAW_VERTICES_BLEND_WITH_NO_SHADER",
"SK_RESOLVE_FILTERS_BEFORE_RESTORE",
"SK_DISABLE_LEGACY_METAL_BACKEND_SURFACE",
"SK_DISABLE_LEGACY_PARAGRAPH_UNICODE",