Ω-W1-T3 review fixes: skip meter invalidate when covered; push fast-path predicates into core

Fixes the critical finding — Browse/curve-popup no longer trigger 60 Hz
whole-client repaints when the meter is invisible. Pushes the fast-path and
self-containment geometry into master_meter with tests; batches the four minor
findings.
This commit is contained in:
2026-08-03 13:31:50 -04:00
parent 4320bfdb08
commit dd067a192e
9 changed files with 102 additions and 21 deletions
+17 -1
View File
@@ -77,8 +77,20 @@ void ReaSamplerEditor::invalidate() {
void ReaSamplerEditor::invalidateMeter() {
if (!childHwnd_) return;
// The meter is covered (Browse, the curve popup) or has nothing to draw (empty state) —
// ballistics still advance in onMeterTimer, but nothing on screen changed, so invalidating
// anything here would only buy a whole-client repaint of chrome/waveform/deck the meter
// never touches. Distinct from "bounds not resolved yet" below: this is a fact about what
// the face is showing, not about whether meterRects_ happens to be populated.
const bool meterOnScreen =
view_ == View::kSample && curvePopup_ == CurveTarget::kNone && !selectedId_.empty();
if (!meterOnScreen) return;
const Rect& f = meterRects_.field;
if (f.empty()) { // nothing cached (see meterRects_) — the whole face has to answer
if (f.empty()) {
// On screen, but no full paint has resolved its bounds yet (first paint, or a resize
// just dropped the cache) — the whole-client fallback is cheap here because the window
// is already fully invalid from the resize/creation that caused this.
invalidate();
return;
}
@@ -155,6 +167,10 @@ void ReaSamplerEditor::removedFromParent() {
childHwnd_ = nullptr;
}
releaseBackBuffer(); // a client-area bitmap outlives nothing here
// Unreachable today (WM_PAINT outranks WM_TIMER, so a reopen's first paint resolves this
// before any meter tick can read it stale) — cleared anyway so the invariant is structural,
// not a timing accident, the same reason onSize clears it on resize.
meterRects_ = {};
}
tresult PLUGIN_API ReaSamplerEditor::onSize(ViewRect* newSize) {