From 6891f22028ec1c39f84e2f164ccfebcc35dc3b7f Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 7 Oct 2024 17:19:08 -0700 Subject: [PATCH 01/10] Started incorperating the offset with the gaussian blur --- .../filters/gaussian_blur_filter_contents.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index efdd24254f07e..8d2a9ccd88422 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -89,6 +89,7 @@ struct BlurInfo { BlurInfo CalculateBlurInfo(const Entity& entity, const Matrix& effect_transform, Vector2 sigma) { + FML_LOG(ERROR) << entity.GetTransform(); // Source space here is scaled by the entity's transform. This is a // requirement for text to be rendered correctly. You can think of this as // "scaled source space" or "un-rotated local space". The entity's rotation is @@ -666,6 +667,8 @@ std::optional GaussianBlurFilterContents::GetFilterCoverage( Point(blur_info.local_padding.x, blur_info.local_padding.y)); } +static bool foo = true; + // A brief overview how this works: // 1) Snapshot the filter input. // 2) Perform downsample pass. This also inserts the gutter around the input @@ -696,8 +699,13 @@ std::optional GaussianBlurFilterContents::RenderFilter( } Entity snapshot_entity = entity.Clone(); + Scalar foox = entity.GetTransform().m[12]; + Scalar fooy = entity.GetTransform().m[13q]; + snapshot_entity.SetTransform( - Matrix::MakeScale(blur_info.source_space_scalar)); + Matrix::MakeTranslation({foox, fooy, 0}) * + Matrix::MakeScale( + blur_info.source_space_scalar)); std::optional source_expanded_coverage_hint; if (expanded_coverage_hint.has_value()) { @@ -712,13 +720,14 @@ std::optional GaussianBlurFilterContents::RenderFilter( return std::nullopt; } - if (blur_info.scaled_sigma.x < kEhCloseEnough && - blur_info.scaled_sigma.y < kEhCloseEnough) { + if (foo || (blur_info.scaled_sigma.x < kEhCloseEnough && + blur_info.scaled_sigma.y < kEhCloseEnough)) { Entity result = Entity::FromSnapshot(input_snapshot.value(), entity.GetBlendMode()); // No blur to render. result.SetTransform(entity.GetTransform() * Matrix::MakeScale(1.f / blur_info.source_space_scalar) * + Matrix::MakeTranslation({-foox, -fooy, 0}) * input_snapshot->transform); return result; } From 7345f9201660a4d38ca221d37940e7b0fed66869 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 7 Oct 2024 17:19:55 -0700 Subject: [PATCH 02/10] format --- .../contents/filters/gaussian_blur_filter_contents.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 8d2a9ccd88422..10b271e28a67d 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -703,9 +703,8 @@ std::optional GaussianBlurFilterContents::RenderFilter( Scalar fooy = entity.GetTransform().m[13q]; snapshot_entity.SetTransform( - Matrix::MakeTranslation({foox, fooy, 0}) * - Matrix::MakeScale( - blur_info.source_space_scalar)); + Matrix::MakeTranslation({foox, fooy, 0}) * + Matrix::MakeScale(blur_info.source_space_scalar)); std::optional source_expanded_coverage_hint; if (expanded_coverage_hint.has_value()) { @@ -721,7 +720,7 @@ std::optional GaussianBlurFilterContents::RenderFilter( } if (foo || (blur_info.scaled_sigma.x < kEhCloseEnough && - blur_info.scaled_sigma.y < kEhCloseEnough)) { + blur_info.scaled_sigma.y < kEhCloseEnough)) { Entity result = Entity::FromSnapshot(input_snapshot.value(), entity.GetBlendMode()); // No blur to render. From dc40b5f3ddce103eecd76de9d3874c2f7c1380e1 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 08:50:14 -0700 Subject: [PATCH 03/10] typo --- .../entity/contents/filters/gaussian_blur_filter_contents.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 10b271e28a67d..5f8e594ed245f 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -700,7 +700,7 @@ std::optional GaussianBlurFilterContents::RenderFilter( Entity snapshot_entity = entity.Clone(); Scalar foox = entity.GetTransform().m[12]; - Scalar fooy = entity.GetTransform().m[13q]; + Scalar fooy = entity.GetTransform().m[13]; snapshot_entity.SetTransform( Matrix::MakeTranslation({foox, fooy, 0}) * From 884baa7459d66aa73d1b23b9b6dcef3e32122b41 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 09:39:35 -0700 Subject: [PATCH 04/10] added test --- .../display_list/aiks_dl_blur_unittests.cc | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/impeller/display_list/aiks_dl_blur_unittests.cc b/impeller/display_list/aiks_dl_blur_unittests.cc index 84c9dc2e09149..4e1cbb131a293 100644 --- a/impeller/display_list/aiks_dl_blur_unittests.cc +++ b/impeller/display_list/aiks_dl_blur_unittests.cc @@ -60,6 +60,45 @@ TEST_P(AiksTest, SolidColorOvalsMaskBlurTinySigma) { ASSERT_TRUE(OpenPlaygroundHere(builder.Build())); } +TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { + DisplayListBuilder builder; + builder.Scale(GetContentScale().x, GetContentScale().y); + + DlPaint background_paint; + background_paint.setColor(DlColor(1, 0.1, 0.1, 0.1, DlColorSpace::kSRGB)); + builder.DrawPaint(background_paint); + + std::vector colors = {DlColor::kRed(), DlColor::kBlue()}; + std::vector stops = {0.0, 1.0}; + + Scalar sigma = 5; + DlPaint paint; + paint.setMaskFilter(DlBlurMaskFilter::Make(DlBlurStyle::kNormal, sigma)); + auto gradient = DlColorSource::MakeLinear( + {0, 0}, {200, 200}, 2, colors.data(), stops.data(), DlTileMode::kClamp); + paint.setColorSource(gradient); + paint.setColor(DlColor::kWhite()); + paint.setDrawStyle(DlDrawStyle::kStroke); + paint.setStrokeWidth(20); + + builder.Save(); + builder.Translate(100, 100); + + { + DlPaint line_paint; + line_paint.setColor(DlColor::kWhite()); + builder.DrawLine({100, 0}, {100, 60}, line_paint); + builder.DrawLine({0, 30}, {200, 30}, line_paint); + } + + SkRRect rrect = + SkRRect::MakeRectXY(SkRect::MakeXYWH(0, 0, 200.0f, 60.0f), 50, 100); + builder.DrawRRect(rrect, paint); + builder.Restore(); + + ASSERT_TRUE(OpenPlaygroundHere(builder.Build())); +} + TEST_P(AiksTest, SolidColorCircleMaskBlurTinySigma) { DisplayListBuilder builder; builder.Scale(GetContentScale().x, GetContentScale().y); From 860996d3f464dd26dd71ec0efc72c168d5516639 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 09:57:23 -0700 Subject: [PATCH 05/10] fixed blur output, added second test --- .../display_list/aiks_dl_blur_unittests.cc | 18 ++++++++++++++---- .../filters/gaussian_blur_filter_contents.cc | 8 +++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/impeller/display_list/aiks_dl_blur_unittests.cc b/impeller/display_list/aiks_dl_blur_unittests.cc index 4e1cbb131a293..dc3470991dcc2 100644 --- a/impeller/display_list/aiks_dl_blur_unittests.cc +++ b/impeller/display_list/aiks_dl_blur_unittests.cc @@ -60,9 +60,10 @@ TEST_P(AiksTest, SolidColorOvalsMaskBlurTinySigma) { ASSERT_TRUE(OpenPlaygroundHere(builder.Build())); } -TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { +sk_sp DoGradientOvalStrokeMaskBlur(Vector2 content_Scale, + Scalar sigma) { DisplayListBuilder builder; - builder.Scale(GetContentScale().x, GetContentScale().y); + builder.Scale(content_Scale.x, content_Scale.y); DlPaint background_paint; background_paint.setColor(DlColor(1, 0.1, 0.1, 0.1, DlColorSpace::kSRGB)); @@ -71,7 +72,6 @@ TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { std::vector colors = {DlColor::kRed(), DlColor::kBlue()}; std::vector stops = {0.0, 1.0}; - Scalar sigma = 5; DlPaint paint; paint.setMaskFilter(DlBlurMaskFilter::Make(DlBlurStyle::kNormal, sigma)); auto gradient = DlColorSource::MakeLinear( @@ -96,7 +96,17 @@ TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { builder.DrawRRect(rrect, paint); builder.Restore(); - ASSERT_TRUE(OpenPlaygroundHere(builder.Build())); + return builder.Build(); +} + +TEST_P(AiksTest, GradientOvalStrokeMaskBlurSigmaZero) { + ASSERT_TRUE(OpenPlaygroundHere( + DoGradientOvalStrokeMaskBlur(GetContentScale(), /*sigma=*/0))); +} + +TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { + ASSERT_TRUE(OpenPlaygroundHere( + DoGradientOvalStrokeMaskBlur(GetContentScale(), /*sigma=*/10))); } TEST_P(AiksTest, SolidColorCircleMaskBlurTinySigma) { diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 5f8e594ed245f..aaeffffc32421 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -89,7 +89,6 @@ struct BlurInfo { BlurInfo CalculateBlurInfo(const Entity& entity, const Matrix& effect_transform, Vector2 sigma) { - FML_LOG(ERROR) << entity.GetTransform(); // Source space here is scaled by the entity's transform. This is a // requirement for text to be rendered correctly. You can think of this as // "scaled source space" or "un-rotated local space". The entity's rotation is @@ -667,8 +666,6 @@ std::optional GaussianBlurFilterContents::GetFilterCoverage( Point(blur_info.local_padding.x, blur_info.local_padding.y)); } -static bool foo = true; - // A brief overview how this works: // 1) Snapshot the filter input. // 2) Perform downsample pass. This also inserts the gutter around the input @@ -719,8 +716,8 @@ std::optional GaussianBlurFilterContents::RenderFilter( return std::nullopt; } - if (foo || (blur_info.scaled_sigma.x < kEhCloseEnough && - blur_info.scaled_sigma.y < kEhCloseEnough)) { + if (blur_info.scaled_sigma.x < kEhCloseEnough && + blur_info.scaled_sigma.y < kEhCloseEnough) { Entity result = Entity::FromSnapshot(input_snapshot.value(), entity.GetBlendMode()); // No blur to render. @@ -835,6 +832,7 @@ std::optional GaussianBlurFilterContents::RenderFilter( .transform = entity.GetTransform() * // Matrix::MakeScale(1.f / blur_info.source_space_scalar) * // + Matrix::MakeTranslation({-foox, -fooy, 0}) * downsample_pass_args.transform * // Matrix::MakeScale(1 / downsample_pass_args.effective_scalar), .sampler_descriptor = sampler_desc, From a2d9ab223d20d8ea14758e7d8f31091802273884 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 10:02:58 -0700 Subject: [PATCH 06/10] tidied up naming --- .../filters/gaussian_blur_filter_contents.cc | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index aaeffffc32421..f230b2de67a12 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -74,6 +74,9 @@ Vector2 ExtractScale(const Matrix& matrix) { struct BlurInfo { /// The scalar that is used to get from source space to unrotated local space. Vector2 source_space_scalar; + /// The translation that is used to get from source space to unrotated local + /// space. + Vector2 source_space_offset; /// Sigma when considering an entity's scale and the effect transform. Vector2 scaled_sigma; /// Blur radius in source pixels based on scaled_sigma. @@ -95,6 +98,8 @@ BlurInfo CalculateBlurInfo(const Entity& entity, // applied to the result of the blur as part of the result's transform. const Vector2 source_space_scalar = ExtractScale(entity.GetTransform().Basis()); + const Vector2 source_space_offset = + Vector2(entity.GetTransform().m[12], entity.GetTransform().m[13]); Vector2 scaled_sigma = (effect_transform.Basis() * Matrix::MakeScale(source_space_scalar) * // @@ -110,6 +115,7 @@ BlurInfo CalculateBlurInfo(const Entity& entity, (Matrix::MakeScale(source_space_scalar) * padding).Abs(); return { .source_space_scalar = source_space_scalar, + .source_space_offset = source_space_offset, .scaled_sigma = scaled_sigma, .blur_radius = blur_radius, .padding = padding, @@ -696,11 +702,8 @@ std::optional GaussianBlurFilterContents::RenderFilter( } Entity snapshot_entity = entity.Clone(); - Scalar foox = entity.GetTransform().m[12]; - Scalar fooy = entity.GetTransform().m[13]; - snapshot_entity.SetTransform( - Matrix::MakeTranslation({foox, fooy, 0}) * + Matrix::MakeTranslation(blur_info.source_space_offset) * Matrix::MakeScale(blur_info.source_space_scalar)); std::optional source_expanded_coverage_hint; @@ -721,10 +724,11 @@ std::optional GaussianBlurFilterContents::RenderFilter( Entity result = Entity::FromSnapshot(input_snapshot.value(), entity.GetBlendMode()); // No blur to render. - result.SetTransform(entity.GetTransform() * - Matrix::MakeScale(1.f / blur_info.source_space_scalar) * - Matrix::MakeTranslation({-foox, -fooy, 0}) * - input_snapshot->transform); + result.SetTransform( + entity.GetTransform() * + Matrix::MakeScale(1.f / blur_info.source_space_scalar) * + Matrix::MakeTranslation(-1 * blur_info.source_space_offset) * + input_snapshot->transform); return result; } @@ -832,8 +836,8 @@ std::optional GaussianBlurFilterContents::RenderFilter( .transform = entity.GetTransform() * // Matrix::MakeScale(1.f / blur_info.source_space_scalar) * // - Matrix::MakeTranslation({-foox, -fooy, 0}) * - downsample_pass_args.transform * // + Matrix::MakeTranslation(-1 * blur_info.source_space_offset) * + downsample_pass_args.transform * // Matrix::MakeScale(1 / downsample_pass_args.effective_scalar), .sampler_descriptor = sampler_desc, .opacity = input_snapshot->opacity}, From 1aff4476d26e0eea842de7b1ece9e5adc95e9b8a Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 10:14:44 -0700 Subject: [PATCH 07/10] asserted and fixed blur styles --- .../display_list/aiks_dl_blur_unittests.cc | 31 ++++++++++++++----- .../filters/gaussian_blur_filter_contents.cc | 14 ++++++--- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/impeller/display_list/aiks_dl_blur_unittests.cc b/impeller/display_list/aiks_dl_blur_unittests.cc index dc3470991dcc2..4185b173086bc 100644 --- a/impeller/display_list/aiks_dl_blur_unittests.cc +++ b/impeller/display_list/aiks_dl_blur_unittests.cc @@ -61,7 +61,8 @@ TEST_P(AiksTest, SolidColorOvalsMaskBlurTinySigma) { } sk_sp DoGradientOvalStrokeMaskBlur(Vector2 content_Scale, - Scalar sigma) { + Scalar sigma, + DlBlurStyle style) { DisplayListBuilder builder; builder.Scale(content_Scale.x, content_Scale.y); @@ -73,7 +74,7 @@ sk_sp DoGradientOvalStrokeMaskBlur(Vector2 content_Scale, std::vector stops = {0.0, 1.0}; DlPaint paint; - paint.setMaskFilter(DlBlurMaskFilter::Make(DlBlurStyle::kNormal, sigma)); + paint.setMaskFilter(DlBlurMaskFilter::Make(style, sigma)); auto gradient = DlColorSource::MakeLinear( {0, 0}, {200, 200}, 2, colors.data(), stops.data(), DlTileMode::kClamp); paint.setColorSource(gradient); @@ -99,14 +100,30 @@ sk_sp DoGradientOvalStrokeMaskBlur(Vector2 content_Scale, return builder.Build(); } +// https://github.com/flutter/flutter/issues/155930 +TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { + ASSERT_TRUE(OpenPlaygroundHere(DoGradientOvalStrokeMaskBlur( + GetContentScale(), /*sigma=*/10, DlBlurStyle::kNormal))); +} + TEST_P(AiksTest, GradientOvalStrokeMaskBlurSigmaZero) { - ASSERT_TRUE(OpenPlaygroundHere( - DoGradientOvalStrokeMaskBlur(GetContentScale(), /*sigma=*/0))); + ASSERT_TRUE(OpenPlaygroundHere(DoGradientOvalStrokeMaskBlur( + GetContentScale(), /*sigma=*/0, DlBlurStyle::kNormal))); } -TEST_P(AiksTest, GradientOvalStrokeMaskBlur) { - ASSERT_TRUE(OpenPlaygroundHere( - DoGradientOvalStrokeMaskBlur(GetContentScale(), /*sigma=*/10))); +TEST_P(AiksTest, GradientOvalStrokeMaskBlurOuter) { + ASSERT_TRUE(OpenPlaygroundHere(DoGradientOvalStrokeMaskBlur( + GetContentScale(), /*sigma=*/10, DlBlurStyle::kOuter))); +} + +TEST_P(AiksTest, GradientOvalStrokeMaskBlurInner) { + ASSERT_TRUE(OpenPlaygroundHere(DoGradientOvalStrokeMaskBlur( + GetContentScale(), /*sigma=*/10, DlBlurStyle::kInner))); +} + +TEST_P(AiksTest, GradientOvalStrokeMaskBlurSolid) { + ASSERT_TRUE(OpenPlaygroundHere(DoGradientOvalStrokeMaskBlur( + GetContentScale(), /*sigma=*/10, DlBlurStyle::kSolid))); } TEST_P(AiksTest, SolidColorCircleMaskBlurTinySigma) { diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index f230b2de67a12..f7f71e3d9d3f6 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -551,7 +551,8 @@ Entity ApplyBlurStyle(FilterContents::BlurStyle blur_style, const Snapshot& input_snapshot, Entity blur_entity, const Geometry* geometry, - Vector2 source_space_scalar) { + Vector2 source_space_scalar, + Vector2 source_space_offset) { switch (blur_style) { case FilterContents::BlurStyle::kNormal: return blur_entity; @@ -569,9 +570,11 @@ Entity ApplyBlurStyle(FilterContents::BlurStyle blur_style, Entity::FromSnapshot(input_snapshot, entity.GetBlendMode()); Entity result; Matrix blurred_transform = blur_entity.GetTransform(); - Matrix snapshot_transform = entity.GetTransform() * // - Matrix::MakeScale(1.f / source_space_scalar) * - input_snapshot.transform; + Matrix snapshot_transform = + entity.GetTransform() * // + Matrix::MakeScale(1.f / source_space_scalar) * + Matrix::MakeTranslation(-1 * source_space_offset) * + input_snapshot.transform; result.SetContents(Contents::MakeAnonymous( fml::MakeCopyable([blur_entity = blur_entity.Clone(), blurred_transform, snapshot_transform, @@ -845,7 +848,8 @@ std::optional GaussianBlurFilterContents::RenderFilter( return ApplyBlurStyle(mask_blur_style_, entity, inputs[0], input_snapshot.value(), std::move(blur_output_entity), - mask_geometry_, blur_info.source_space_scalar); + mask_geometry_, blur_info.source_space_scalar, + blur_info.source_space_offset); } Scalar GaussianBlurFilterContents::CalculateBlurRadius(Scalar sigma) { From 6d45daeca7b3726634a53f4a4ebe145a5ace9c45 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 10:46:26 -0700 Subject: [PATCH 08/10] golden golden --- testing/impeller_golden_tests_output.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testing/impeller_golden_tests_output.txt b/testing/impeller_golden_tests_output.txt index 7d56e0f10a301..00c4ad46566cb 100644 --- a/testing/impeller_golden_tests_output.txt +++ b/testing/impeller_golden_tests_output.txt @@ -715,6 +715,21 @@ impeller_Play_AiksTest_GaussianBlurStyleSolid_Metal.png impeller_Play_AiksTest_GaussianBlurStyleSolid_OpenGLES.png impeller_Play_AiksTest_GaussianBlurStyleSolid_Vulkan.png impeller_Play_AiksTest_GaussianBlurWithoutDecalSupport_Metal.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurInner_Metal.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurInner_OpenGLES.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurInner_Vulkan.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurOuter_Metal.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurOuter_OpenGLES.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurOuter_Vulkan.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurSigmaZero_Metal.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurSigmaZero_OpenGLES.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurSigmaZero_Vulkan.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurSolid_Metal.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurSolid_OpenGLES.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlurSolid_Vulkan.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlur_Metal.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlur_OpenGLES.png +impeller_Play_AiksTest_GradientOvalStrokeMaskBlur_Vulkan.png impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Metal.png impeller_Play_AiksTest_GradientStrokesRenderCorrectly_OpenGLES.png impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Vulkan.png From 1e9effc0ffe2b31bdb452907df86ce63ccb904cc Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 13:38:22 -0700 Subject: [PATCH 09/10] added content scale to CanRenderEmojiTextFrameWithBlur --- impeller/display_list/aiks_dl_text_unittests.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/impeller/display_list/aiks_dl_text_unittests.cc b/impeller/display_list/aiks_dl_text_unittests.cc index 03c79971b2b12..2119841ebd0ab 100644 --- a/impeller/display_list/aiks_dl_text_unittests.cc +++ b/impeller/display_list/aiks_dl_text_unittests.cc @@ -283,6 +283,7 @@ TEST_P(AiksTest, CanRenderEmojiTextFrame) { TEST_P(AiksTest, CanRenderEmojiTextFrameWithBlur) { DisplayListBuilder builder; + builder.Scale(GetContentScale().x, GetContentScale().y); DlPaint paint; paint.setColor(DlColor::ARGB(1, 0.1, 0.1, 0.1)); builder.DrawPaint(paint); From fba6c3bb2823ca52fe9148dc82985059ae0bd3f2 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 8 Oct 2024 13:49:27 -0700 Subject: [PATCH 10/10] fixed coverage expansion --- .../entity/contents/filters/gaussian_blur_filter_contents.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index f7f71e3d9d3f6..d2e39ead1817b 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -712,6 +712,7 @@ std::optional GaussianBlurFilterContents::RenderFilter( std::optional source_expanded_coverage_hint; if (expanded_coverage_hint.has_value()) { source_expanded_coverage_hint = expanded_coverage_hint->TransformBounds( + Matrix::MakeTranslation(blur_info.source_space_offset) * Matrix::MakeScale(blur_info.source_space_scalar) * entity.GetTransform().Invert()); }