Skip to content

perf: remove BackdropFilter to reduce GPU overheating#88

Merged
sparkleMing merged 1 commit into
mainfrom
perf/remove-backdrop-filter
May 15, 2026
Merged

perf: remove BackdropFilter to reduce GPU overheating#88
sparkleMing merged 1 commit into
mainfrom
perf/remove-backdrop-filter

Conversation

@sparkleMing
Copy link
Copy Markdown
Collaborator

Summary

移除 12 处 BackdropFilter 使用,解决滚动时 GPU 高负载导致的卡顿和发热问题。

Problem

BackdropFilter 在每一帧都执行像素级高斯模糊,是 GPU 密集型操作。在 Timeline 列表中,屏幕上同时可见 3-5 张带模糊的卡片时,GPU 负载成倍增加,导致严重发热和掉帧。

Solution

用更高不透明度的半透明容器替代 BackdropFilter,保持相近的视觉效果,GPU 开销接近零。

改动范围

文件 移除数量 替代方案
classic_card.dart 4 半透明容器 + 渐变
event_card.dart 1 82% 不透明白色背景
snapshot_card.dart 1 纯白背景 + 阴影
system_task_card.dart 1 alpha 0.92 白色背景
timeline_screen.dart 2 alpha 0.92 渐变白色
radial_menu.dart 1 半透明白色遮罩动画
agent_activity_widget.dart 1 alpha 0.88 白色背景
insight_screen.dart 1 实色渐变按钮
persona_chat_screen.dart 2 深色半透明容器

保留的 BackdropFilter(2处)

  • share_preview_dialog.dart — 短暂弹窗
  • demo_overlay.dart — 引导覆盖层,只出现一次

Visual Impact

  • Timeline 卡片:几乎无差异(原本背景就接近不透明)
  • Banner/浮层:从毛玻璃变为高不透明度面板,差异轻微
  • Persona chat 输入栏:从磨砂质感变为深色半透明,风格略有变化

Testing

  • flutter analyze 通过,无错误
  • 需要在真机上验证滚动流畅度和发热改善

Remove 12 BackdropFilter usages that caused expensive per-frame gaussian
blur operations, especially during timeline scrolling where multiple cards
were simultaneously computing real-time blur.

Replaced with higher-opacity semi-transparent containers that maintain
similar visual appearance without the GPU cost. Kept BackdropFilter only
in short-lived modal overlays (share_preview_dialog, demo_overlay) where
performance impact is negligible.

Files changed:
- classic_card.dart (4 usages removed)
- event_card.dart (1 usage removed)
- snapshot_card.dart (1 usage removed)
- system_task_card.dart (1 usage removed)
- timeline_screen.dart (2 usages removed)
- radial_menu.dart (1 usage removed)
- agent_activity_widget.dart (1 usage removed)
- insight_screen.dart (1 usage removed)
- persona_chat_screen.dart (2 usages removed)

Also removed unused dart:ui imports where ImageFilter was no longer needed.
@sparkleMing sparkleMing merged commit b20a2bd into main May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant