Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9da3749

Browse files
committed
[Impeller] Add checkbox for toggling the ColorWheel cache
1 parent 623c935 commit 9da3749

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

impeller/aiks/aiks_unittests.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <utility>
1111

1212
#include "flutter/testing/testing.h"
13+
#include "imgui.h"
1314
#include "impeller/aiks/aiks_playground.h"
1415
#include "impeller/aiks/canvas.h"
1516
#include "impeller/aiks/image.h"
@@ -1392,6 +1393,7 @@ TEST_P(AiksTest, ColorWheel) {
13921393

13931394
auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
13941395
// UI state.
1396+
static bool cache_the_wheel = true;
13951397
static int current_blend_index = 3;
13961398
static float dst_alpha = 1;
13971399
static float src_alpha = 1;
@@ -1401,6 +1403,7 @@ TEST_P(AiksTest, ColorWheel) {
14011403

14021404
ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
14031405
{
1406+
ImGui::Checkbox("Cache the wheel", &cache_the_wheel);
14041407
ImGui::ListBox("Blending mode", &current_blend_index,
14051408
blend_mode_names.data(), blend_mode_names.size());
14061409
ImGui::SliderFloat("Source alpha", &src_alpha, 0, 1);
@@ -1414,7 +1417,7 @@ TEST_P(AiksTest, ColorWheel) {
14141417
static Point content_scale;
14151418
Point new_content_scale = GetContentScale();
14161419

1417-
if (new_content_scale != content_scale) {
1420+
if (!cache_the_wheel || new_content_scale != content_scale) {
14181421
content_scale = new_content_scale;
14191422

14201423
// Render the color wheel to an image.

0 commit comments

Comments
 (0)