@@ -101,8 +101,6 @@ TEST_P(AiksTest, CanRenderTiledTexture) {
101101 if (first_frame) {
102102 first_frame = false ;
103103 GenerateMipmap (context, texture, " table_mountain_nx" );
104- ImGui::SetNextWindowSize ({480 , 100 });
105- ImGui::SetNextWindowPos ({100 , 550 });
106104 }
107105
108106 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
@@ -303,14 +301,7 @@ TEST_P(AiksTest, CanSaveLayerStandalone) {
303301}
304302
305303TEST_P (AiksTest, CanRenderLinearGradient) {
306- bool first_frame = true ;
307304 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
308- if (first_frame) {
309- first_frame = false ;
310- ImGui::SetNextWindowSize ({480 , 100 });
311- ImGui::SetNextWindowPos ({100 , 550 });
312- }
313-
314305 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
315306 const Entity::TileMode tile_modes[] = {
316307 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -361,14 +352,7 @@ TEST_P(AiksTest, CanRenderLinearGradient) {
361352}
362353
363354TEST_P (AiksTest, CanRenderLinearGradientManyColors) {
364- bool first_frame = true ;
365355 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
366- if (first_frame) {
367- first_frame = false ;
368- ImGui::SetNextWindowSize ({480 , 100 });
369- ImGui::SetNextWindowPos ({100 , 550 });
370- }
371-
372356 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
373357 const Entity::TileMode tile_modes[] = {
374358 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -433,14 +417,7 @@ TEST_P(AiksTest, CanRenderLinearGradientManyColors) {
433417}
434418
435419TEST_P (AiksTest, CanRenderLinearGradientWayManyColors) {
436- bool first_frame = true ;
437420 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
438- if (first_frame) {
439- first_frame = false ;
440- ImGui::SetNextWindowSize ({480 , 100 });
441- ImGui::SetNextWindowPos ({100 , 550 });
442- }
443-
444421 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
445422 const Entity::TileMode tile_modes[] = {
446423 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -495,14 +472,7 @@ TEST_P(AiksTest, CanRenderLinearGradientWayManyColors) {
495472}
496473
497474TEST_P (AiksTest, CanRenderLinearGradientManyColorsUnevenStops) {
498- bool first_frame = true ;
499475 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
500- if (first_frame) {
501- first_frame = false ;
502- ImGui::SetNextWindowSize ({480 , 100 });
503- ImGui::SetNextWindowPos ({100 , 550 });
504- }
505-
506476 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
507477 const Entity::TileMode tile_modes[] = {
508478 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -559,14 +529,7 @@ TEST_P(AiksTest, CanRenderLinearGradientManyColorsUnevenStops) {
559529}
560530
561531TEST_P (AiksTest, CanRenderRadialGradient) {
562- bool first_frame = true ;
563532 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
564- if (first_frame) {
565- first_frame = false ;
566- ImGui::SetNextWindowSize ({480 , 100 });
567- ImGui::SetNextWindowPos ({100 , 550 });
568- }
569-
570533 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
571534 const Entity::TileMode tile_modes[] = {
572535 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -614,14 +577,7 @@ TEST_P(AiksTest, CanRenderRadialGradient) {
614577}
615578
616579TEST_P (AiksTest, CanRenderRadialGradientManyColors) {
617- bool first_frame = true ;
618580 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
619- if (first_frame) {
620- first_frame = false ;
621- ImGui::SetNextWindowSize ({480 , 100 });
622- ImGui::SetNextWindowPos ({100 , 550 });
623- }
624-
625581 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
626582 const Entity::TileMode tile_modes[] = {
627583 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -683,14 +639,7 @@ TEST_P(AiksTest, CanRenderRadialGradientManyColors) {
683639}
684640
685641TEST_P (AiksTest, CanRenderSweepGradient) {
686- bool first_frame = true ;
687642 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
688- if (first_frame) {
689- first_frame = false ;
690- ImGui::SetNextWindowSize ({480 , 100 });
691- ImGui::SetNextWindowPos ({100 , 550 });
692- }
693-
694643 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
695644 const Entity::TileMode tile_modes[] = {
696645 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -737,14 +686,7 @@ TEST_P(AiksTest, CanRenderSweepGradient) {
737686}
738687
739688TEST_P (AiksTest, CanRenderSweepGradientManyColors) {
740- bool first_frame = true ;
741689 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
742- if (first_frame) {
743- first_frame = false ;
744- ImGui::SetNextWindowSize ({480 , 100 });
745- ImGui::SetNextWindowPos ({100 , 550 });
746- }
747-
748690 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
749691 const Entity::TileMode tile_modes[] = {
750692 Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -835,14 +777,7 @@ TEST_P(AiksTest, CanRenderDifferentShapesWithSameColorSource) {
835777}
836778
837779TEST_P (AiksTest, CanPictureConvertToImage) {
838- bool first_frame = true ;
839780 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
840- if (first_frame) {
841- first_frame = false ;
842- ImGui::SetNextWindowSize ({480 , 100 });
843- ImGui::SetNextWindowPos ({100 , 550 });
844- }
845-
846781 static int size[2 ] = {1000 , 1000 };
847782 ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_AlwaysAutoResize);
848783 ImGui::SliderInt2 (" Size" , size, 0 , 1000 );
@@ -1296,13 +1231,7 @@ TEST_P(AiksTest, ColorWheel) {
12961231 std::shared_ptr<Image> color_wheel_image;
12971232 Matrix color_wheel_transform;
12981233
1299- bool first_frame = true ;
13001234 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
1301- if (first_frame) {
1302- first_frame = false ;
1303- ImGui::SetNextWindowPos ({25 , 25 });
1304- }
1305-
13061235 // UI state.
13071236 static int current_blend_index = 3 ;
13081237 static float dst_alpha = 1 ;
@@ -1430,19 +1359,12 @@ TEST_P(AiksTest, TransformMultipliesCorrectly) {
14301359
14311360TEST_P (AiksTest, SolidStrokesRenderCorrectly) {
14321361 // Compare with https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2
1433- bool first_frame = true ;
14341362 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
1435- if (first_frame) {
1436- first_frame = false ;
1437- ImGui::SetNextWindowSize ({480 , 100 });
1438- ImGui::SetNextWindowPos ({100 , 550 });
1439- }
1440-
14411363 static Color color = Color::Black ().WithAlpha (0.5 );
14421364 static float scale = 3 ;
14431365 static bool add_circle_clip = true ;
14441366
1445- ImGui::Begin (" Controls" );
1367+ ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_AlwaysAutoResize );
14461368 ImGui::ColorEdit4 (" Color" , reinterpret_cast <float *>(&color));
14471369 ImGui::SliderFloat (" Scale" , &scale, 0 , 6 );
14481370 ImGui::Checkbox (" Circle clip" , &add_circle_clip);
@@ -1500,14 +1422,7 @@ TEST_P(AiksTest, SolidStrokesRenderCorrectly) {
15001422
15011423TEST_P (AiksTest, GradientStrokesRenderCorrectly) {
15021424 // Compare with https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2
1503- bool first_frame = true ;
15041425 auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
1505- if (first_frame) {
1506- first_frame = false ;
1507- ImGui::SetNextWindowSize ({480 , 100 });
1508- ImGui::SetNextWindowPos ({100 , 550 });
1509- }
1510-
15111426 static float scale = 3 ;
15121427 static bool add_circle_clip = true ;
15131428 const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
@@ -1517,7 +1432,7 @@ TEST_P(AiksTest, GradientStrokesRenderCorrectly) {
15171432 static int selected_tile_mode = 0 ;
15181433 static float alpha = 1 ;
15191434
1520- ImGui::Begin (" Controls" );
1435+ ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_AlwaysAutoResize );
15211436 ImGui::SliderFloat (" Scale" , &scale, 0 , 6 );
15221437 ImGui::Checkbox (" Circle clip" , &add_circle_clip);
15231438 ImGui::SliderFloat (" Alpha" , &alpha, 0 , 1 );
0 commit comments