🎨 Deep Dive · Intermediate

Impeller thành renderer desktop mặc định — thực sự đổi gì

Impeller mặc định trên mobile đã có từ trước. Flutter 3.47 hoàn tất trên macOS, Windows và Linux. App desktop giờ nhắm Metal (macOS) và Vulkan (Windows/Linux) với tập shader cố định, compile lúc build engine.

Sơ đồ: Impeller Default on Desktop

Bạn được gì

  • Hết jank compile shader khi animation chạy lần đầu.
  • Chữ SDF — glyph sắc hơn trên màn desktop mật độ pixel thấp hơn.
  • Wide Gamut Color mặc định trên macOS khi phần cứng hỗ trợ.

Opt-out Skia tạm thời

Nền tảngCách tắt
macOSFLTEnableImpeller=false trong Info.plist
Windowsproject.set_impeller_switch(flutter::ImpellerSwitch::Disabled) trong main.cpp
Linuxfl_dart_project_set_enable_impeller(project, FALSE) trong my_application.cc

Hãy file bug. Fallback sẽ bị gỡ.

Nên test lại

  1. FragmentShader tùy chỉnh và effect nặng saveLayer.
  2. Platform view / external texture.
  3. Luồng print/export từng giả định color management của Skia.

Chạy profile mode trước. Frame vẫn dài thì vẫn là UI vs raster — Impeller chỉ lấy việc ở nhánh compile shader, không lấy việc trong build() của bạn.

#Flutter#Impeller#Desktop#Rendering#Performance