From 305f7dd2d5ecdf3b0ae98d4adaacb83ae21909f2 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 13:44:20 -0800 Subject: [PATCH 01/12] [Impeller] cleaned up aiks test headers and introduced AiksInteractiveTest for imgui tests --- impeller/aiks/aiks_blur_unittests.cc | 4 ---- impeller/aiks/aiks_gradient_unittests.cc | 3 --- impeller/aiks/aiks_playground.cc | 1 + 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/impeller/aiks/aiks_blur_unittests.cc b/impeller/aiks/aiks_blur_unittests.cc index 7e76260f364e6..19d7305d0a1b8 100644 --- a/impeller/aiks/aiks_blur_unittests.cc +++ b/impeller/aiks/aiks_blur_unittests.cc @@ -5,11 +5,7 @@ #include "flutter/impeller/aiks/aiks_unittests.h" #include "impeller/aiks/canvas.h" -#include "impeller/entity/contents/conical_gradient_contents.h" -#include "impeller/entity/contents/filters/inputs/filter_input.h" -#include "impeller/entity/contents/solid_color_contents.h" #include "impeller/entity/render_target_cache.h" -#include "impeller/geometry/geometry_asserts.h" #include "impeller/geometry/path_builder.h" #include "impeller/playground/widgets.h" #include "impeller/renderer/testing/mocks.h" diff --git a/impeller/aiks/aiks_gradient_unittests.cc b/impeller/aiks/aiks_gradient_unittests.cc index 70fe173daaf2c..19f124204fdde 100644 --- a/impeller/aiks/aiks_gradient_unittests.cc +++ b/impeller/aiks/aiks_gradient_unittests.cc @@ -6,16 +6,13 @@ #include "impeller/aiks/canvas.h" #include "impeller/entity/contents/conical_gradient_contents.h" -#include "impeller/entity/contents/filters/inputs/filter_input.h" #include "impeller/entity/contents/linear_gradient_contents.h" #include "impeller/entity/contents/radial_gradient_contents.h" -#include "impeller/entity/contents/solid_color_contents.h" #include "impeller/entity/contents/sweep_gradient_contents.h" #include "impeller/geometry/geometry_asserts.h" #include "impeller/geometry/path_builder.h" #include "impeller/playground/widgets.h" #include "third_party/imgui/imgui.h" -#include "txt/platform.h" //////////////////////////////////////////////////////////////////////////////// // This is for tests of Canvas that are interested the results of rendering diff --git a/impeller/aiks/aiks_playground.cc b/impeller/aiks/aiks_playground.cc index 8714b54697ac2..4f56cce31e41b 100644 --- a/impeller/aiks/aiks_playground.cc +++ b/impeller/aiks/aiks_playground.cc @@ -24,6 +24,7 @@ void AiksPlayground::SetTypographerContext( } void AiksPlayground::TearDown() { + inspector_.HackResetDueToTextureLeaks(); PlaygroundTest::TearDown(); } From ec3f440c937db54a018890d5277d2882d6a62dd8 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 14:24:59 -0800 Subject: [PATCH 02/12] removed exemption for colorwheel --- impeller/aiks/aiks_playground.cc | 9 +++++++-- impeller/aiks/aiks_playground.h | 5 +++++ impeller/aiks/aiks_unittests.cc | 6 +++--- impeller/golden_tests/golden_playground_test.h | 5 +++++ impeller/golden_tests/golden_playground_test_mac.cc | 7 ++++++- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/impeller/aiks/aiks_playground.cc b/impeller/aiks/aiks_playground.cc index 4f56cce31e41b..db1545425f771 100644 --- a/impeller/aiks/aiks_playground.cc +++ b/impeller/aiks/aiks_playground.cc @@ -9,7 +9,6 @@ #include "impeller/aiks/aiks_context.h" #include "impeller/typographer/backends/skia/typographer_context_skia.h" #include "impeller/typographer/typographer_context.h" -#include "third_party/imgui/imgui.h" namespace impeller { @@ -24,7 +23,6 @@ void AiksPlayground::SetTypographerContext( } void AiksPlayground::TearDown() { - inspector_.HackResetDueToTextureLeaks(); PlaygroundTest::TearDown(); } @@ -58,4 +56,11 @@ bool AiksPlayground::OpenPlaygroundHere(AiksPlaygroundCallback callback) { }); } +bool AiksPlayground::ImGuiBegin(const char* name, + bool* p_open, + ImGuiWindowFlags flags) { + ImGui::Begin(name, p_open, flags); + return true; +} + } // namespace impeller diff --git a/impeller/aiks/aiks_playground.h b/impeller/aiks/aiks_playground.h index 64490cb679254..9a6bfc90beb09 100644 --- a/impeller/aiks/aiks_playground.h +++ b/impeller/aiks/aiks_playground.h @@ -11,6 +11,7 @@ #include "impeller/aiks/picture.h" #include "impeller/playground/playground_test.h" #include "impeller/typographer/typographer_context.h" +#include "third_party/imgui/imgui.h" namespace impeller { @@ -32,6 +33,10 @@ class AiksPlayground : public PlaygroundTest { bool OpenPlaygroundHere(AiksPlaygroundCallback callback); + static bool ImGuiBegin(const char* name, + bool* p_open, + ImGuiWindowFlags flags); + private: std::shared_ptr typographer_context_; AiksInspector inspector_; diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index 801b3ef760b26..fa592f29989f8 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -1162,8 +1162,8 @@ TEST_P(AiksTest, ColorWheel) { static Color color1 = Color::Green(); static Color color2 = Color::Blue(); - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - { + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::Checkbox("Cache the wheel", &cache_the_wheel); ImGui::ListBox("Blending mode", ¤t_blend_index, blend_modes.blend_mode_names.data(), @@ -1173,8 +1173,8 @@ TEST_P(AiksTest, ColorWheel) { ImGui::ColorEdit4("Color B", reinterpret_cast(&color1)); ImGui::ColorEdit4("Color C", reinterpret_cast(&color2)); ImGui::SliderFloat("Destination alpha", &dst_alpha, 0, 1); + ImGui::End(); } - ImGui::End(); static Point content_scale; Point new_content_scale = GetContentScale(); diff --git a/impeller/golden_tests/golden_playground_test.h b/impeller/golden_tests/golden_playground_test.h index 251e98a04e153..e0da049b9e2d2 100644 --- a/impeller/golden_tests/golden_playground_test.h +++ b/impeller/golden_tests/golden_playground_test.h @@ -13,6 +13,7 @@ #include "flutter/impeller/renderer/render_target.h" #include "flutter/testing/testing.h" #include "impeller/typographer/typographer_context.h" +#include "third_party/imgui/imgui.h" #if FML_OS_MACOSX #include "flutter/fml/platform/darwin/scoped_nsautorelease_pool.h" @@ -43,6 +44,10 @@ class GoldenPlaygroundTest bool OpenPlaygroundHere(AiksPlaygroundCallback callback); + static bool ImGuiBegin(const char* name, + bool* p_open, + ImGuiWindowFlags flags); + std::shared_ptr CreateTextureForFixture( const char* fixture_name, bool enable_mipmapping = false) const; diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index 68dee0d60ff4d..258e8ef88bd37 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -72,7 +72,6 @@ static const std::vector kSkipTests = { IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), IMP_AIKSTEST(GaussianBlurRotatedAndClippedInteractive), IMP_AIKSTEST(GradientStrokesRenderCorrectly), - IMP_AIKSTEST(ColorWheel), IMP_AIKSTEST(SceneColorSource), IMP_AIKSTEST(SolidStrokesRenderCorrectly), IMP_AIKSTEST(TextFrameSubpixelAlignment), @@ -235,6 +234,12 @@ bool GoldenPlaygroundTest::OpenPlaygroundHere( return SaveScreenshot(std::move(screenshot)); } +bool GoldenPlaygroundTest::ImGuiBegin(const char* name, + bool* p_open, + ImGuiWindowFlags flags) { + return false; +} + std::shared_ptr GoldenPlaygroundTest::CreateTextureForFixture( const char* fixture_name, bool enable_mipmapping) const { From 73656175a2c960eaaca30eaaa600e8efc53f1365 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 14:33:42 -0800 Subject: [PATCH 03/12] removed more exceptions --- impeller/aiks/aiks_unittests.cc | 49 +++++++++++-------- .../golden_playground_test_mac.cc | 4 -- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index fa592f29989f8..b7075588cc1af 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -818,12 +818,14 @@ TEST_P(AiksTest, TextFrameSubpixelAlignment) { static float phase_variation = 0.2; static float speed = 0.5; static float magnitude = 100; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::SliderFloat("Font size", &font_size, 5, 50); - ImGui::SliderFloat("Phase variation", &phase_variation, 0, 1); - ImGui::SliderFloat("Oscillation speed", &speed, 0, 2); - ImGui::SliderFloat("Oscillation magnitude", &magnitude, 0, 300); - ImGui::End(); + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::SliderFloat("Font size", &font_size, 5, 50); + ImGui::SliderFloat("Phase variation", &phase_variation, 0, 1); + ImGui::SliderFloat("Oscillation speed", &speed, 0, 2); + ImGui::SliderFloat("Oscillation magnitude", &magnitude, 0, 300); + ImGui::End(); + } Canvas canvas; canvas.Scale(GetContentScale()); @@ -1067,15 +1069,15 @@ TEST_P(AiksTest, CanDrawPaintMultipleTimesInteractive) { static Color foreground = Color::Color::OrangeRed().WithAlpha(0.5); static int current_blend_index = 3; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - { + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::ColorEdit4("Background", reinterpret_cast(&background)); ImGui::ColorEdit4("Foreground", reinterpret_cast(&foreground)); ImGui::ListBox("Blend mode", ¤t_blend_index, modes.blend_mode_names.data(), modes.blend_mode_names.size()); + ImGui::End(); } - ImGui::End(); Canvas canvas; canvas.Scale(Vector2(0.2, 0.2)); @@ -1868,14 +1870,16 @@ TEST_P(AiksTest, SceneColorSource) { auto callback = [&](AiksContext& renderer) -> std::optional { Paint paint; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); static Scalar distance = 2; - ImGui::SliderFloat("Distance", &distance, 0, 4); static Scalar y_pos = 0; - ImGui::SliderFloat("Y", &y_pos, -3, 3); static Scalar fov = 45; - ImGui::SliderFloat("FOV", &fov, 1, 180); - ImGui::End(); + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::SliderFloat("Distance", &distance, 0, 4); + ImGui::SliderFloat("Y", &y_pos, -3, 3); + ImGui::SliderFloat("FOV", &fov, 1, 180); + ImGui::End(); + } Scalar angle = GetSecondsElapsed(); auto camera_position = @@ -3066,13 +3070,16 @@ TEST_P(AiksTest, CaptureContext) { auto color = document.AddColor("Background color", Color::CornflowerBlue()); canvas.DrawPaint({.color = color}); - ImGui::Begin("TestDocument", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - document.GetElement()->properties.Iterate([](CaptureProperty& property) { - property.Invoke({.color = [](CaptureColorProperty& p) { - ImGui::ColorEdit4(p.label.c_str(), reinterpret_cast(&p.value)); - }}); - }); - ImGui::End(); + if (AiksTest::ImGuiBegin("TestDocument", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + document.GetElement()->properties.Iterate([](CaptureProperty& property) { + property.Invoke({.color = [](CaptureColorProperty& p) { + ImGui::ColorEdit4(p.label.c_str(), + reinterpret_cast(&p.value)); + }}); + }); + ImGui::End(); + } return canvas.EndRecordingAsPicture(); }; diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index 258e8ef88bd37..cd7152c5a4338 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -63,7 +63,6 @@ const std::unique_ptr& GetSharedVulkanPlayground( // If you add a new playground test to the aiks unittests and you do not want it // to also be a golden test, then add the test name here. static const std::vector kSkipTests = { - IMP_AIKSTEST(CanDrawPaintMultipleTimesInteractive), IMP_AIKSTEST(CanRenderLinearGradientManyColorsUnevenStops), IMP_AIKSTEST(CanRenderRadialGradient), IMP_AIKSTEST(CanRenderRadialGradientManyColors), @@ -72,16 +71,13 @@ static const std::vector kSkipTests = { IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), IMP_AIKSTEST(GaussianBlurRotatedAndClippedInteractive), IMP_AIKSTEST(GradientStrokesRenderCorrectly), - IMP_AIKSTEST(SceneColorSource), IMP_AIKSTEST(SolidStrokesRenderCorrectly), - IMP_AIKSTEST(TextFrameSubpixelAlignment), IMP_AIKSTEST(GaussianBlurAnimatedBackdrop), // TextRotated is flakey and we can't seem to get it to stabilize on Skia // Gold. IMP_AIKSTEST(TextRotated), // Runtime stage based tests get confused with a Metal context. "impeller_Play_AiksTest_CanRenderClippedRuntimeEffects_Vulkan", - IMP_AIKSTEST(CaptureContext), }; static const std::vector kVulkanDenyValidationTests = { From 9b82c1330d7d2b38b48bac0b2dd5369072c55990 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 14:36:09 -0800 Subject: [PATCH 04/12] removed more --- impeller/aiks/aiks_blur_unittests.cc | 12 ++++++------ impeller/golden_tests/golden_playground_test_mac.cc | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/impeller/aiks/aiks_blur_unittests.cc b/impeller/aiks/aiks_blur_unittests.cc index 19d7305d0a1b8..b1593bf72ab7b 100644 --- a/impeller/aiks/aiks_blur_unittests.cc +++ b/impeller/aiks/aiks_blur_unittests.cc @@ -448,14 +448,14 @@ TEST_P(AiksTest, GaussianBlurRotatedAndClippedInteractive) { static float scale = 0.6; static int selected_tile_mode = 3; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - { + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::SliderFloat("Rotation (degrees)", &rotation, -180, 180); ImGui::SliderFloat("Scale", &scale, 0, 2.0); ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, sizeof(tile_mode_names) / sizeof(char*)); + ImGui::End(); } - ImGui::End(); Canvas canvas; Rect bounds = @@ -552,13 +552,13 @@ TEST_P(AiksTest, GaussianBlurAnimatedBackdrop) { Scalar freq = 0.1; Scalar amp = 50.0; auto callback = [&](AiksContext& renderer) -> std::optional { - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - { + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::SliderFloat("Sigma", &sigma, 0, 200); ImGui::SliderFloat("Frequency", &freq, 0.01, 2.0); ImGui::SliderFloat("Amplitude", &, 1, 100); + ImGui::End(); } - ImGui::End(); Canvas canvas; canvas.Scale(GetContentScale()); diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index cd7152c5a4338..22e47bd590a17 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -69,10 +69,8 @@ static const std::vector kSkipTests = { IMP_AIKSTEST(CanRenderBackdropBlurInteractive), IMP_AIKSTEST(ClippedBlurFilterRendersCorrectlyInteractive), IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), - IMP_AIKSTEST(GaussianBlurRotatedAndClippedInteractive), IMP_AIKSTEST(GradientStrokesRenderCorrectly), IMP_AIKSTEST(SolidStrokesRenderCorrectly), - IMP_AIKSTEST(GaussianBlurAnimatedBackdrop), // TextRotated is flakey and we can't seem to get it to stabilize on Skia // Gold. IMP_AIKSTEST(TextRotated), From adea47267b54d6c5aee48c3e4fb17cdb9991a18c Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 14:43:44 -0800 Subject: [PATCH 05/12] removed more exceptions --- impeller/aiks/aiks_gradient_unittests.cc | 76 ++++++++++--------- .../golden_playground_test_mac.cc | 4 - 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/impeller/aiks/aiks_gradient_unittests.cc b/impeller/aiks/aiks_gradient_unittests.cc index 19f124204fdde..a06fec82d7dfa 100644 --- a/impeller/aiks/aiks_gradient_unittests.cc +++ b/impeller/aiks/aiks_gradient_unittests.cc @@ -305,22 +305,24 @@ TEST_P(AiksTest, CanRenderLinearGradientManyColorsUnevenStops) { Entity::TileMode::kMirror, Entity::TileMode::kDecal}; static int selected_tile_mode = 0; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, - sizeof(tile_mode_names) / sizeof(char*)); static Matrix matrix = { 1, 0, 0, 0, // 0, 1, 0, 0, // 0, 0, 1, 0, // 0, 0, 0, 1 // }; - std::string label = "##1"; - for (int i = 0; i < 4; i++) { - ImGui::InputScalarN(label.c_str(), ImGuiDataType_Float, &(matrix.vec[i]), - 4, NULL, NULL, "%.2f", 0); - label[2]++; + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, + sizeof(tile_mode_names) / sizeof(char*)); + std::string label = "##1"; + for (int i = 0; i < 4; i++) { + ImGui::InputScalarN(label.c_str(), ImGuiDataType_Float, + &(matrix.vec[i]), 4, NULL, NULL, "%.2f", 0); + label[2]++; + } + ImGui::End(); } - ImGui::End(); Canvas canvas; Paint paint; @@ -381,22 +383,24 @@ TEST_P(AiksTest, CanRenderRadialGradient) { Entity::TileMode::kMirror, Entity::TileMode::kDecal}; static int selected_tile_mode = 0; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, - sizeof(tile_mode_names) / sizeof(char*)); static Matrix matrix = { 1, 0, 0, 0, // 0, 1, 0, 0, // 0, 0, 1, 0, // 0, 0, 0, 1 // }; - std::string label = "##1"; - for (int i = 0; i < 4; i++) { - ImGui::InputScalarN(label.c_str(), ImGuiDataType_Float, &(matrix.vec[i]), - 4, NULL, NULL, "%.2f", 0); - label[2]++; + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, + sizeof(tile_mode_names) / sizeof(char*)); + std::string label = "##1"; + for (int i = 0; i < 4; i++) { + ImGui::InputScalarN(label.c_str(), ImGuiDataType_Float, + &(matrix.vec[i]), 4, NULL, NULL, "%.2f", 0); + label[2]++; + } + ImGui::End(); } - ImGui::End(); Canvas canvas; Paint paint; @@ -424,22 +428,24 @@ TEST_P(AiksTest, CanRenderRadialGradientManyColors) { Entity::TileMode::kMirror, Entity::TileMode::kDecal}; static int selected_tile_mode = 0; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, - sizeof(tile_mode_names) / sizeof(char*)); static Matrix matrix = { 1, 0, 0, 0, // 0, 1, 0, 0, // 0, 0, 1, 0, // 0, 0, 0, 1 // }; - std::string label = "##1"; - for (int i = 0; i < 4; i++) { - ImGui::InputScalarN(label.c_str(), ImGuiDataType_Float, &(matrix.vec[i]), - 4, NULL, NULL, "%.2f", 0); - label[2]++; + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, + sizeof(tile_mode_names) / sizeof(char*)); + std::string label = "##1"; + for (int i = 0; i < 4; i++) { + ImGui::InputScalarN(label.c_str(), ImGuiDataType_Float, + &(matrix.vec[i]), 4, NULL, NULL, "%.2f", 0); + label[2]++; + } + ImGui::End(); } - ImGui::End(); Canvas canvas; Paint paint; @@ -657,13 +663,15 @@ TEST_P(AiksTest, GradientStrokesRenderCorrectly) { static int selected_tile_mode = 0; static float alpha = 1; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::SliderFloat("Scale", &scale, 0, 6); - ImGui::Checkbox("Circle clip", &add_circle_clip); - ImGui::SliderFloat("Alpha", &alpha, 0, 1); - ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, - sizeof(tile_mode_names) / sizeof(char*)); - ImGui::End(); + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::SliderFloat("Scale", &scale, 0, 6); + ImGui::Checkbox("Circle clip", &add_circle_clip); + ImGui::SliderFloat("Alpha", &alpha, 0, 1); + ImGui::Combo("Tile mode", &selected_tile_mode, tile_mode_names, + sizeof(tile_mode_names) / sizeof(char*)); + ImGui::End(); + } Canvas canvas; canvas.Scale(GetContentScale()); diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index 22e47bd590a17..ae17cd076f2bb 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -63,13 +63,9 @@ const std::unique_ptr& GetSharedVulkanPlayground( // If you add a new playground test to the aiks unittests and you do not want it // to also be a golden test, then add the test name here. static const std::vector kSkipTests = { - IMP_AIKSTEST(CanRenderLinearGradientManyColorsUnevenStops), - IMP_AIKSTEST(CanRenderRadialGradient), - IMP_AIKSTEST(CanRenderRadialGradientManyColors), IMP_AIKSTEST(CanRenderBackdropBlurInteractive), IMP_AIKSTEST(ClippedBlurFilterRendersCorrectlyInteractive), IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), - IMP_AIKSTEST(GradientStrokesRenderCorrectly), IMP_AIKSTEST(SolidStrokesRenderCorrectly), // TextRotated is flakey and we can't seem to get it to stabilize on Skia // Gold. From 0740cb4f5cf431461475a4001527923d0849bb94 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 14:51:13 -0800 Subject: [PATCH 06/12] removed more --- impeller/aiks/aiks_path_unittests.cc | 12 +++++++----- impeller/golden_tests/golden_playground_test_mac.cc | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/impeller/aiks/aiks_path_unittests.cc b/impeller/aiks/aiks_path_unittests.cc index 6f194d0623e0a..09df07f167580 100644 --- a/impeller/aiks/aiks_path_unittests.cc +++ b/impeller/aiks/aiks_path_unittests.cc @@ -185,11 +185,13 @@ TEST_P(AiksTest, SolidStrokesRenderCorrectly) { static float scale = 3; static bool add_circle_clip = true; - ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::ColorEdit4("Color", reinterpret_cast(&color)); - ImGui::SliderFloat("Scale", &scale, 0, 6); - ImGui::Checkbox("Circle clip", &add_circle_clip); - ImGui::End(); + if (AiksTest::ImGuiBegin("Controls", nullptr, + ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::ColorEdit4("Color", reinterpret_cast(&color)); + ImGui::SliderFloat("Scale", &scale, 0, 6); + ImGui::Checkbox("Circle clip", &add_circle_clip); + ImGui::End(); + } Canvas canvas; canvas.Scale(GetContentScale()); diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index ae17cd076f2bb..33fe11571e709 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -66,7 +66,6 @@ static const std::vector kSkipTests = { IMP_AIKSTEST(CanRenderBackdropBlurInteractive), IMP_AIKSTEST(ClippedBlurFilterRendersCorrectlyInteractive), IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), - IMP_AIKSTEST(SolidStrokesRenderCorrectly), // TextRotated is flakey and we can't seem to get it to stabilize on Skia // Gold. IMP_AIKSTEST(TextRotated), From 1d995151123af93c01c68d58102c870acad0308d Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 14:58:12 -0800 Subject: [PATCH 07/12] removed includes --- impeller/aiks/aiks_unittests.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index b7075588cc1af..f4911daa72256 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -21,13 +21,8 @@ #include "impeller/aiks/paint_pass_delegate.h" #include "impeller/aiks/testing/context_spy.h" #include "impeller/core/capture.h" -#include "impeller/entity/contents/conical_gradient_contents.h" #include "impeller/entity/contents/filters/gaussian_blur_filter_contents.h" -#include "impeller/entity/contents/filters/inputs/filter_input.h" -#include "impeller/entity/contents/linear_gradient_contents.h" -#include "impeller/entity/contents/radial_gradient_contents.h" #include "impeller/entity/contents/solid_color_contents.h" -#include "impeller/entity/contents/sweep_gradient_contents.h" #include "impeller/entity/render_target_cache.h" #include "impeller/geometry/color.h" #include "impeller/geometry/constants.h" @@ -38,9 +33,6 @@ #include "impeller/playground/widgets.h" #include "impeller/renderer/command_buffer.h" #include "impeller/renderer/snapshot.h" -#include "impeller/renderer/testing/mocks.h" -#include "impeller/scene/material.h" -#include "impeller/scene/node.h" #include "impeller/typographer/backends/skia/text_frame_skia.h" #include "impeller/typographer/backends/skia/typographer_context_skia.h" #include "impeller/typographer/backends/stb/text_frame_stb.h" @@ -48,7 +40,6 @@ #include "impeller/typographer/backends/stb/typographer_context_stb.h" #include "third_party/imgui/imgui.h" #include "third_party/skia/include/core/SkFontMgr.h" -#include "third_party/skia/include/core/SkTypeface.h" #include "txt/platform.h" namespace impeller { From 9238b046b0d5f109abc0497f36200efe7e4d73e4 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 15:26:40 -0800 Subject: [PATCH 08/12] added back an exemption since it uses lines --- impeller/golden_tests/golden_playground_test_mac.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index 33fe11571e709..8f50a723b591b 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -65,6 +65,7 @@ const std::unique_ptr& GetSharedVulkanPlayground( static const std::vector kSkipTests = { IMP_AIKSTEST(CanRenderBackdropBlurInteractive), IMP_AIKSTEST(ClippedBlurFilterRendersCorrectlyInteractive), + IMP_AIKSTEST(GaussianBlurRotatedAndClippedInteractive), IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), // TextRotated is flakey and we can't seem to get it to stabilize on Skia // Gold. From 981c61754b8f746cef20a542362446582ad810eb Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 16:12:14 -0800 Subject: [PATCH 09/12] oops forgot an exception --- impeller/golden_tests/golden_playground_test_mac.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index 8f50a723b591b..29e501e60a62e 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -63,6 +63,7 @@ const std::unique_ptr& GetSharedVulkanPlayground( // If you add a new playground test to the aiks unittests and you do not want it // to also be a golden test, then add the test name here. static const std::vector kSkipTests = { + IMP_AIKSTEST(GaussianBlurAnimatedBackdrop), IMP_AIKSTEST(CanRenderBackdropBlurInteractive), IMP_AIKSTEST(ClippedBlurFilterRendersCorrectlyInteractive), IMP_AIKSTEST(GaussianBlurRotatedAndClippedInteractive), From d845c2df19b15183f07556514c8fcd810b7366fd Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 16:30:50 -0800 Subject: [PATCH 10/12] drat, these ones need exceptions too --- impeller/golden_tests/golden_playground_test_mac.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index 29e501e60a62e..1d124a7c38a40 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -66,6 +66,8 @@ static const std::vector kSkipTests = { IMP_AIKSTEST(GaussianBlurAnimatedBackdrop), IMP_AIKSTEST(CanRenderBackdropBlurInteractive), IMP_AIKSTEST(ClippedBlurFilterRendersCorrectlyInteractive), + IMP_AIKSTEST(GradientStrokesRenderCorrectly), + IMP_AIKSTEST(SolidStrokesRenderCorrectly), IMP_AIKSTEST(GaussianBlurRotatedAndClippedInteractive), IMP_AIKSTEST(CoverageOriginShouldBeAccountedForInSubpasses), // TextRotated is flakey and we can't seem to get it to stabilize on Skia From ebab832565e7613e700b898e85f6fda87f83d995 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 17:23:29 -0800 Subject: [PATCH 11/12] updated golden number --- testing/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/run_tests.py b/testing/run_tests.py index fa53d5ffad081..d9c90b9fcc31f 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -40,7 +40,7 @@ ENCODING = 'UTF-8' # This number must be updated when adding new golden tests to impeller. -_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES = 557 +_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES = 575 logger = logging.getLogger(__name__) logger_handler = logging.StreamHandler() From 373933fa6dda3b5f7b5d39d5b78275108320c76e Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 12 Feb 2024 17:43:26 -0800 Subject: [PATCH 12/12] updated golden number --- testing/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/run_tests.py b/testing/run_tests.py index d9c90b9fcc31f..bd3712d63f339 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -40,7 +40,7 @@ ENCODING = 'UTF-8' # This number must be updated when adding new golden tests to impeller. -_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES = 575 +_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES = 578 logger = logging.getLogger(__name__) logger_handler = logging.StreamHandler()