@@ -369,43 +369,42 @@ TEST_P(GaussianBlurFilterContentsTest, TextureContentsWithDestinationRect) {
369369 }
370370}
371371
372- // TEST_P(GaussianBlurFilterContentsTest,
373- // TextureContentsWithDestinationRectScaled) {
374- // std::shared_ptr<Texture> texture = MakeTexture(ISize(100, 100));
375- // auto texture_contents = std::make_shared<TextureContents>();
376- // texture_contents->SetSourceRect(Rect::MakeSize(texture->GetSize()));
377- // texture_contents->SetTexture(texture);
378- // texture_contents->SetDestinationRect(Rect::MakeXYWH(
379- // 50, 40, texture->GetSize().width, texture->GetSize().height));
380-
381- // fml::StatusOr<Scalar> sigma_radius_1 =
382- // CalculateSigmaForBlurRadius(1.0, Matrix());
383- // auto contents = std::make_unique<GaussianBlurFilterContents>(
384- // sigma_radius_1.value(), sigma_radius_1.value(),
385- // Entity::TileMode::kDecal, FilterContents::BlurStyle::kNormal,
386- // /*mask_geometry=*/nullptr);
387- // contents->SetInputs({FilterInput::Make(texture_contents)});
388- // std::shared_ptr<ContentContext> renderer = GetContentContext();
389-
390- // Entity entity;
391- // entity.SetTransform(Matrix::MakeScale({2.0, 2.0, 1.0}));
392- // std::optional<Entity> result =
393- // contents->GetEntity(*renderer, entity, /*coverage_hint=*/{});
394- // EXPECT_TRUE(result.has_value());
395- // if (result.has_value()) {
396- // EXPECT_EQ(result.value().GetBlendMode(), BlendMode::kSourceOver);
397- // std::optional<Rect> result_coverage = result.value().GetCoverage();
398- // std::optional<Rect> contents_coverage = contents->GetCoverage(entity);
399- // EXPECT_TRUE(result_coverage.has_value());
400- // EXPECT_TRUE(contents_coverage.has_value());
401- // if (result_coverage.has_value() && contents_coverage.has_value()) {
402- // EXPECT_TRUE(RectNear(result_coverage.value(),
403- // contents_coverage.value()));
404- // EXPECT_TRUE(RectNear(contents_coverage.value(),
405- // Rect::MakeXYWH(94.f, 74.f, 212.f, 212.f)));
406- // }
407- // }
408- // }
372+ TEST_P (GaussianBlurFilterContentsTest,
373+ TextureContentsWithDestinationRectScaled) {
374+ std::shared_ptr<Texture> texture = MakeTexture (ISize (100 , 100 ));
375+ auto texture_contents = std::make_shared<TextureContents>();
376+ texture_contents->SetSourceRect (Rect::MakeSize (texture->GetSize ()));
377+ texture_contents->SetTexture (texture);
378+ texture_contents->SetDestinationRect (Rect::MakeXYWH (
379+ 50 , 40 , texture->GetSize ().width , texture->GetSize ().height ));
380+
381+ fml::StatusOr<Scalar> sigma_radius_1 =
382+ CalculateSigmaForBlurRadius (1.0 , Matrix ());
383+ auto contents = std::make_unique<GaussianBlurFilterContents>(
384+ sigma_radius_1.value (), sigma_radius_1.value (), Entity::TileMode::kDecal ,
385+ FilterContents::BlurStyle::kNormal ,
386+ /* mask_geometry=*/ nullptr );
387+ contents->SetInputs ({FilterInput::Make (texture_contents)});
388+ std::shared_ptr<ContentContext> renderer = GetContentContext ();
389+
390+ Entity entity;
391+ entity.SetTransform (Matrix::MakeScale ({2.0 , 2.0 , 1.0 }));
392+ std::optional<Entity> result =
393+ contents->GetEntity (*renderer, entity, /* coverage_hint=*/ {});
394+ EXPECT_TRUE (result.has_value ());
395+ if (result.has_value ()) {
396+ EXPECT_EQ (result.value ().GetBlendMode (), BlendMode::kSourceOver );
397+ std::optional<Rect> result_coverage = result.value ().GetCoverage ();
398+ std::optional<Rect> contents_coverage = contents->GetCoverage (entity);
399+ EXPECT_TRUE (result_coverage.has_value ());
400+ EXPECT_TRUE (contents_coverage.has_value ());
401+ if (result_coverage.has_value () && contents_coverage.has_value ()) {
402+ EXPECT_TRUE (RectNear (result_coverage.value (), contents_coverage.value ()));
403+ EXPECT_TRUE (RectNear (contents_coverage.value (),
404+ Rect::MakeXYWH (98 .f , 78 .f , 204 .0f , 204 .f )));
405+ }
406+ }
407+ }
409408
410409TEST_P (GaussianBlurFilterContentsTest, TextureContentsWithEffectTransform) {
411410 Matrix effect_transform = Matrix::MakeScale ({2.0 , 2.0 , 1.0 });
0 commit comments