From 2263fc5342d2e4e6244ff2e09963f0298ae8d3a0 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Wed, 23 Aug 2023 10:45:20 -0400 Subject: [PATCH] Use decal TileMode in blur image_filter_test.dart The expected color values appear to match the output of Skia's raster backend's blur. Historically, that doesn't support any tile mode other than decal, so while the `makeBlur()` function defaulted to clamp tiling, the output was decal and thus showed the blur fading to transparent. The test draws a 1x1 green rectangle in the center of a 3x3 image. Clamp tiling would actually cause the output of the blur to just copy the central green color to the remaining 8 pixels. This is the output of Skia's GPU blur. I am working to land changes in Skia that make the raster backend handle all tile modes, which then has it match the existing GPU blur's behavior of a constant output for clamp tiling in this test (so it then fails). Decal tiling appears to be more useful for this test case anyways because it creates per-pixel variations that can be validated against. --- testing/dart/image_filter_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/dart/image_filter_test.dart b/testing/dart/image_filter_test.dart index 98435912f8f37..0fa8651656300 100644 --- a/testing/dart/image_filter_test.dart +++ b/testing/dart/image_filter_test.dart @@ -176,7 +176,7 @@ void main() { test('ImageFilter - blur', () async { final Paint paint = Paint() ..color = green - ..imageFilter = makeBlur(1.0, 1.0); + ..imageFilter = makeBlur(1.0, 1.0, TileMode.decal); final Uint32List bytes = await getBytesForPaint(paint); checkBytes(bytes, greenCenterBlurred, greenSideBlurred, greenCornerBlurred);