Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 7133ce2

Browse files
committed
Make test adjustments
1 parent 8fde328 commit 7133ce2

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

entity/entity_unittests.cc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -681,22 +681,24 @@ TEST_F(EntityTest, GaussianBlurFilter) {
681681
auto callback = [&](ContentContext& context, RenderPass& pass) -> bool {
682682
if (first_frame) {
683683
first_frame = false;
684-
ImGui::SetNextWindowSize({450, 150});
685-
ImGui::SetNextWindowPos({200, 450});
684+
ImGui::SetNextWindowSize({500, 170});
685+
ImGui::SetNextWindowPos({300, 550});
686686
}
687687

688688
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));
689693
static float offset[2] = {500, 400};
690694
ImGui::SliderFloat2("Translation", &offset[0], 0,
691695
pass.GetRenderTargetSize().width);
692696
static float rotation = 0;
693697
ImGui::SliderFloat("Rotation", &rotation, 0, kPi * 2);
694-
static float scale[2] = {1, 1};
698+
static float scale[2] = {0.8, 0.8};
695699
ImGui::SliderFloat2("Scale", &scale[0], 0, 3);
696700
static float skew[2] = {0, 0};
697701
ImGui::SliderFloat2("Skew", &skew[0], -3, 3);
698-
static float blur_amount[2] = {20, 20};
699-
ImGui::SliderFloat2("Blur", &blur_amount[0], 0, 200);
700702
ImGui::End();
701703

702704
auto blend = FilterContents::MakeBlend(Entity::BlendMode::kPlus,
@@ -716,12 +718,16 @@ TEST_F(EntityTest, GaussianBlurFilter) {
716718
entity.SetContents(blur);
717719
entity.SetTransformation(ctm);
718720

721+
entity.Render(context, pass);
722+
723+
// The following entity renders the expected transformed input.
719724
Entity cover_entity;
720725
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));
722727
cover_entity.SetTransformation(ctm);
723728

724-
return entity.Render(context, pass) && cover_entity.Render(context, pass);
729+
cover_entity.Render(context, pass);
730+
return true;
725731
};
726732
ASSERT_TRUE(OpenPlaygroundHere(callback));
727733
}

0 commit comments

Comments
 (0)