Skip to content

Commit

Permalink
Remove SK_RESOLVE_FILTERS_BEFORE_RESTORE flag (flutter#49563)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lhkbob authored May 31, 2024
1 parent 4e86afc commit 1814031
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
23 changes: 16 additions & 7 deletions display_list/testing/dl_rendering_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
};

Expand Down
1 change: 0 additions & 1 deletion skia/flutter_defines.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down

0 comments on commit 1814031

Please sign in to comment.