mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Add checkbox for toggling the ColorWheel cache (flutter/engine#39986)
[Impeller] Add checkbox for toggling the ColorWheel cache
This commit is contained in:
parent
6e8933fadd
commit
56dfdf8fbf
@ -1392,6 +1392,7 @@ TEST_P(AiksTest, ColorWheel) {
|
||||
|
||||
auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
|
||||
// UI state.
|
||||
static bool cache_the_wheel = true;
|
||||
static int current_blend_index = 3;
|
||||
static float dst_alpha = 1;
|
||||
static float src_alpha = 1;
|
||||
@ -1401,6 +1402,7 @@ TEST_P(AiksTest, ColorWheel) {
|
||||
|
||||
ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
{
|
||||
ImGui::Checkbox("Cache the wheel", &cache_the_wheel);
|
||||
ImGui::ListBox("Blending mode", ¤t_blend_index,
|
||||
blend_mode_names.data(), blend_mode_names.size());
|
||||
ImGui::SliderFloat("Source alpha", &src_alpha, 0, 1);
|
||||
@ -1414,7 +1416,7 @@ TEST_P(AiksTest, ColorWheel) {
|
||||
static Point content_scale;
|
||||
Point new_content_scale = GetContentScale();
|
||||
|
||||
if (new_content_scale != content_scale) {
|
||||
if (!cache_the_wheel || new_content_scale != content_scale) {
|
||||
content_scale = new_content_scale;
|
||||
|
||||
// Render the color wheel to an image.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user