Skip to content

Commit 968ecb8

Browse files
bderochinmaygarde
authored andcommitted
[Impeller] Add checkbox for toggling the ColorWheel cache (flutter#39986)
[Impeller] Add checkbox for toggling the ColorWheel cache
1 parent 069ee8f commit 968ecb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

impeller/aiks/aiks_unittests.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,7 @@ TEST_P(AiksTest, ColorWheel) {
13921392

13931393
auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
13941394
// UI state.
1395+
static bool cache_the_wheel = true;
13951396
static int current_blend_index = 3;
13961397
static float dst_alpha = 1;
13971398
static float src_alpha = 1;
@@ -1401,6 +1402,7 @@ TEST_P(AiksTest, ColorWheel) {
14011402

14021403
ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
14031404
{
1405+
ImGui::Checkbox("Cache the wheel", &cache_the_wheel);
14041406
ImGui::ListBox("Blending mode", &current_blend_index,
14051407
blend_mode_names.data(), blend_mode_names.size());
14061408
ImGui::SliderFloat("Source alpha", &src_alpha, 0, 1);
@@ -1414,7 +1416,7 @@ TEST_P(AiksTest, ColorWheel) {
14141416
static Point content_scale;
14151417
Point new_content_scale = GetContentScale();
14161418

1417-
if (new_content_scale != content_scale) {
1419+
if (!cache_the_wheel || new_content_scale != content_scale) {
14181420
content_scale = new_content_scale;
14191421

14201422
// Render the color wheel to an image.

0 commit comments

Comments
 (0)