Repository navigation
perf: draw rain, clouds, and the wavefront with less work - #632
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PiscesXD
force-pushed
the
perf/cheaper-drawing
branch
from
October 30, 2026 16:17
8bc8c29 to
9041729
Compare
Member
|
LGTM |
PiscesXD
approved these changes
Oct 30, 2026
lowrt
approved these changes
Oct 31, 2026
Platform: all Optimization(zh-Hant): 首頁卡片上的雨水少算幾步,看起來一樣 Optimization(en-US): rain on the home card takes fewer steps and looks the same
Platform: all Optimization(zh-Hant): 大雨和大雪少畫一些粒子,看起來一樣 Optimization(en-US): heavy rain and snow draw fewer particles and look the same
Platform: all Optimization(zh-Hant): 玻璃上的雨滴改成先畫成一張小圖,看起來一樣 Optimization(en-US): raindrops on the glass are drawn from one small picture and look the same
Platform: all Optimization(zh-Hant): 雲的顏色改在每一幀之前算好,看起來一樣 Optimization(en-US): cloud colors are worked out before each frame and look the same
Platform: all Optimization(zh-Hant): 地震波前不到一個像素就不重畫,畫出來的是當下的範圍 Optimization(en-US): an earthquake wavefront is redrawn only after it moves a pixel, at its current size
lowrt
force-pushed
the
perf/cheaper-drawing
branch
from
November 1, 2026 05:02
9041729 to
d2607d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
這個 PR 做了什麼
畫面該少算的少算。地震波前該畫的時候,畫的是當下的範圍,不是上一拍留下的半徑。
正式程式碼,五則 commit:
card_water_field.dart、rain_on_card.dartprecipitation_field.dart、weather_sky_background.dartrain_on_glass.dart、shaders/weather/rain_on_glass.fragsky_clouds.dart、weather_sky_painter.dart、shaders/cloud/clouds.fragwavefrontTick每 200 ms 醒一次,像素門檻疊在這上面,沒有取代它。進行中的寫入仍會被跳過,那是 main 上已有的行為。框選覆蓋改成第一次立刻算、之後每 200 ms。已取消的速報不畫、也不把閘門撐著。樣式重載會清掉上一組環。wavefront_cadence.dart、geo_circle.dart、rts_layer.dart、report_replay_page.dart測試與正式程式碼分開:
uMode、sampler 變 2previewtag 的場景改成走同一條烘焙。預設的tool/dev/test.sh不會跑它們沒有做、也刻意不做:定位點的脈衝、雲的雙線性取樣、走時表、日出、星圖。沒有在 iOS 或 Android 實機上看過畫面,也沒有量 FPS 或耗電;上面的數字是程式裡的常數,不是實機量測。EEW 推估公式沒有動,
eew_estimator_test.dart的 golden 沒有改。pubspec.lock裡本機 MapLibre 的絕對路徑沒有進任何一則 commit。相關 issue
開 PR 前搜過
gh issue list --state all --search 'rain OR wavefront OR shader OR 發熱 OR 波前'。沒有對應的 issue。怎麼驗
本機在推之前:
tool/dev/analyze.sh通過tool/check/commits.sh origin/main..HEAD通過(5 則)tool/check.sh通過:格式、analyze、workflow、l10n、lockfile、完整測試 3636 通過(另有 6 個跳過)。CI 跑的是 Linux,本機是 Darwin回放那兩則 tier 測試只鎖「次像素的波前不會每一拍都重畫」。回放時鐘是
Stopwatch,tester.pump不會把波往前推,所以它不再數 60 Hz 和 5 Hz。頻率改由rts_layer_eew_push_test.dart在 zoom 14 鎖:高階每一拍、低階一秒五次。實機還沒看。用
tool/run.sh開起來之後:wavefrontTicktool/dev/test.sh --tags preview test/shaders/preview_render_test.dart test/shaders/rain_on_glass_test.dart安全關鍵的部分是波前半徑,不是推估。推估器沒改。半徑由
wavefrontUploadDue決定:沒過一個像素就沿用上一圈,過了就用呼叫當下的半徑(縮小也一樣)。圖層測試用會跟著FakeAsync走的時鐘,避免DateTime.now()在假時間裡凍結、門檻看起來永遠通過。檢查清單
tool/check/commits.sh origin/main..HEAD通過—— commit 訊息就是更新日誌,格式見 commit.md
mise exec -- flutter analyze與mise exec -- flutter test通過—— 實際跑的是
tool/dev/analyze.sh與 pre-push 的tool/check.sh(完整測試 3636 通過)。沒有直接打mise execAppLocalizations,沒有寫死gh pr checks:每一項都是 pass 或 skipped)—— 沒過不能合併,見 pr.md
——
build、Android、iOS、code-review、changes、codecov/project、codecov/patch都是 passAppSpacing/AppRadius/AppMotion,深色模式看過,文字對比度可接受
—— 沒有改版面 tokens。外觀是雨、雲、波前的繪製量,還沒在實機對過,深色模式也還沒看