@@ -681,22 +681,24 @@ TEST_F(EntityTest, GaussianBlurFilter) {
681
681
auto callback = [&](ContentContext& context, RenderPass& pass) -> bool {
682
682
if (first_frame) {
683
683
first_frame = false ;
684
- ImGui::SetNextWindowSize ({450 , 150 });
685
- ImGui::SetNextWindowPos ({200 , 450 });
684
+ ImGui::SetNextWindowSize ({500 , 170 });
685
+ ImGui::SetNextWindowPos ({300 , 550 });
686
686
}
687
687
688
688
ImGui::Begin (" Controls" );
689
+ static float blur_amount[2 ] = {20 , 20 };
690
+ ImGui::SliderFloat2 (" Blur" , &blur_amount[0 ], 0 , 200 );
691
+ static Color cover_color (1 , 0 , 0 , 0.2 );
692
+ ImGui::ColorEdit4 (" Cover color" , reinterpret_cast <float *>(&cover_color));
689
693
static float offset[2 ] = {500 , 400 };
690
694
ImGui::SliderFloat2 (" Translation" , &offset[0 ], 0 ,
691
695
pass.GetRenderTargetSize ().width );
692
696
static float rotation = 0 ;
693
697
ImGui::SliderFloat (" Rotation" , &rotation, 0 , kPi * 2 );
694
- static float scale[2 ] = {1 , 1 };
698
+ static float scale[2 ] = {0.8 , 0.8 };
695
699
ImGui::SliderFloat2 (" Scale" , &scale[0 ], 0 , 3 );
696
700
static float skew[2 ] = {0 , 0 };
697
701
ImGui::SliderFloat2 (" Skew" , &skew[0 ], -3 , 3 );
698
- static float blur_amount[2 ] = {20 , 20 };
699
- ImGui::SliderFloat2 (" Blur" , &blur_amount[0 ], 0 , 200 );
700
702
ImGui::End ();
701
703
702
704
auto blend = FilterContents::MakeBlend (Entity::BlendMode::kPlus ,
@@ -716,12 +718,16 @@ TEST_F(EntityTest, GaussianBlurFilter) {
716
718
entity.SetContents (blur);
717
719
entity.SetTransformation (ctm);
718
720
721
+ entity.Render (context, pass);
722
+
723
+ // The following entity renders the expected transformed input.
719
724
Entity cover_entity;
720
725
cover_entity.SetPath (PathBuilder{}.AddRect (rect).TakePath ());
721
- cover_entity.SetContents (SolidColorContents::Make (Color ( 1 , 0 , 0 , 0.5 ) ));
726
+ cover_entity.SetContents (SolidColorContents::Make (cover_color ));
722
727
cover_entity.SetTransformation (ctm);
723
728
724
- return entity.Render (context, pass) && cover_entity.Render (context, pass);
729
+ cover_entity.Render (context, pass);
730
+ return true ;
725
731
};
726
732
ASSERT_TRUE (OpenPlaygroundHere (callback));
727
733
}
0 commit comments