@@ -101,8 +101,6 @@ TEST_P(AiksTest, CanRenderTiledTexture) {
101
101
if (first_frame) {
102
102
first_frame = false ;
103
103
GenerateMipmap (context, texture, " table_mountain_nx" );
104
- ImGui::SetNextWindowSize ({480 , 100 });
105
- ImGui::SetNextWindowPos ({100 , 550 });
106
104
}
107
105
108
106
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
@@ -303,14 +301,7 @@ TEST_P(AiksTest, CanSaveLayerStandalone) {
303
301
}
304
302
305
303
TEST_P (AiksTest, CanRenderLinearGradient) {
306
- bool first_frame = true ;
307
304
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
-
314
305
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
315
306
const Entity::TileMode tile_modes[] = {
316
307
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -361,14 +352,7 @@ TEST_P(AiksTest, CanRenderLinearGradient) {
361
352
}
362
353
363
354
TEST_P (AiksTest, CanRenderLinearGradientManyColors) {
364
- bool first_frame = true ;
365
355
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
-
372
356
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
373
357
const Entity::TileMode tile_modes[] = {
374
358
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -433,14 +417,7 @@ TEST_P(AiksTest, CanRenderLinearGradientManyColors) {
433
417
}
434
418
435
419
TEST_P (AiksTest, CanRenderLinearGradientWayManyColors) {
436
- bool first_frame = true ;
437
420
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
-
444
421
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
445
422
const Entity::TileMode tile_modes[] = {
446
423
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -495,14 +472,7 @@ TEST_P(AiksTest, CanRenderLinearGradientWayManyColors) {
495
472
}
496
473
497
474
TEST_P (AiksTest, CanRenderLinearGradientManyColorsUnevenStops) {
498
- bool first_frame = true ;
499
475
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
-
506
476
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
507
477
const Entity::TileMode tile_modes[] = {
508
478
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -559,14 +529,7 @@ TEST_P(AiksTest, CanRenderLinearGradientManyColorsUnevenStops) {
559
529
}
560
530
561
531
TEST_P (AiksTest, CanRenderRadialGradient) {
562
- bool first_frame = true ;
563
532
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
-
570
533
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
571
534
const Entity::TileMode tile_modes[] = {
572
535
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -614,14 +577,7 @@ TEST_P(AiksTest, CanRenderRadialGradient) {
614
577
}
615
578
616
579
TEST_P (AiksTest, CanRenderRadialGradientManyColors) {
617
- bool first_frame = true ;
618
580
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
-
625
581
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
626
582
const Entity::TileMode tile_modes[] = {
627
583
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -683,14 +639,7 @@ TEST_P(AiksTest, CanRenderRadialGradientManyColors) {
683
639
}
684
640
685
641
TEST_P (AiksTest, CanRenderSweepGradient) {
686
- bool first_frame = true ;
687
642
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
-
694
643
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
695
644
const Entity::TileMode tile_modes[] = {
696
645
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -737,14 +686,7 @@ TEST_P(AiksTest, CanRenderSweepGradient) {
737
686
}
738
687
739
688
TEST_P (AiksTest, CanRenderSweepGradientManyColors) {
740
- bool first_frame = true ;
741
689
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
-
748
690
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
749
691
const Entity::TileMode tile_modes[] = {
750
692
Entity::TileMode::kClamp , Entity::TileMode::kRepeat ,
@@ -835,14 +777,7 @@ TEST_P(AiksTest, CanRenderDifferentShapesWithSameColorSource) {
835
777
}
836
778
837
779
TEST_P (AiksTest, CanPictureConvertToImage) {
838
- bool first_frame = true ;
839
780
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
-
846
781
static int size[2 ] = {1000 , 1000 };
847
782
ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_AlwaysAutoResize);
848
783
ImGui::SliderInt2 (" Size" , size, 0 , 1000 );
@@ -1296,13 +1231,7 @@ TEST_P(AiksTest, ColorWheel) {
1296
1231
std::shared_ptr<Image> color_wheel_image;
1297
1232
Matrix color_wheel_transform;
1298
1233
1299
- bool first_frame = true ;
1300
1234
auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
1301
- if (first_frame) {
1302
- first_frame = false ;
1303
- ImGui::SetNextWindowPos ({25 , 25 });
1304
- }
1305
-
1306
1235
// UI state.
1307
1236
static int current_blend_index = 3 ;
1308
1237
static float dst_alpha = 1 ;
@@ -1430,19 +1359,12 @@ TEST_P(AiksTest, TransformMultipliesCorrectly) {
1430
1359
1431
1360
TEST_P (AiksTest, SolidStrokesRenderCorrectly) {
1432
1361
// Compare with https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2
1433
- bool first_frame = true ;
1434
1362
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
-
1441
1363
static Color color = Color::Black ().WithAlpha (0.5 );
1442
1364
static float scale = 3 ;
1443
1365
static bool add_circle_clip = true ;
1444
1366
1445
- ImGui::Begin (" Controls" );
1367
+ ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_AlwaysAutoResize );
1446
1368
ImGui::ColorEdit4 (" Color" , reinterpret_cast <float *>(&color));
1447
1369
ImGui::SliderFloat (" Scale" , &scale, 0 , 6 );
1448
1370
ImGui::Checkbox (" Circle clip" , &add_circle_clip);
@@ -1500,14 +1422,7 @@ TEST_P(AiksTest, SolidStrokesRenderCorrectly) {
1500
1422
1501
1423
TEST_P (AiksTest, GradientStrokesRenderCorrectly) {
1502
1424
// Compare with https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2
1503
- bool first_frame = true ;
1504
1425
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
-
1511
1426
static float scale = 3 ;
1512
1427
static bool add_circle_clip = true ;
1513
1428
const char * tile_mode_names[] = {" Clamp" , " Repeat" , " Mirror" , " Decal" };
@@ -1517,7 +1432,7 @@ TEST_P(AiksTest, GradientStrokesRenderCorrectly) {
1517
1432
static int selected_tile_mode = 0 ;
1518
1433
static float alpha = 1 ;
1519
1434
1520
- ImGui::Begin (" Controls" );
1435
+ ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_AlwaysAutoResize );
1521
1436
ImGui::SliderFloat (" Scale" , &scale, 0 , 6 );
1522
1437
ImGui::Checkbox (" Circle clip" , &add_circle_clip);
1523
1438
ImGui::SliderFloat (" Alpha" , &alpha, 0 , 1 );
0 commit comments