Skip to content

perf: honor cacheAsBitmap + skip no-op timeline mtx writes - #14

Open
roncarbot wants to merge 2 commits into
devfrom
feature/render-perf
Open

roncarbot wants to merge 2 commits into
devfrom
feature/render-perf

Conversation

@roncarbot

@roncarbot roncarbot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add HONOR_CACHE_AS_BITMAP (default true): SWF-safe path so AS3 cacheAsBitmap sticks without requiring USE_UNSAFE_CACHE_AS_BITMAP. Legacy unsafe flag still OR-enables.
  • Timeline update_mtx_all / scale_rot / pos / colorTransform skip identical hold-frame rewrites that previously dirtied parent caches every tick.
  • E9: Add HONOR_NATIVE_BLENDS (default true): Flash-native blendMode values (LAYER/ERASE/…) return through the getter so Diggy GroundFG LAYER + ERASE child engages ContainerNode.renderToImage / sticky CacheRenderer. Non-native blends still need USE_UNSAFE_BLENDS. Kill-switch: HONOR_NATIVE_BLENDS=false.

Pairs with awayjs/renderer#35 and awayjs/view#7 (E8 sticky CacheRenderer).

Test plan

  • Diggy title: cacheAsBitmap setter roundtrips (honored: 20/20)
  • Diggy GroundMap/HoleCircle AS writes honor when gameplay unlocked
  • Kill-switch: Settings.HONOR_CACHE_AS_BITMAP=false restores legacy no-op
  • Diggy GroundFG: after CreateMap, blendMode==="layer", ERASE child, renderToImage=true, CacheRenderer sticky (contentDirty=false)
  • Diggy gameplay: 50 → 33.4 ms, draws ~254 → ~207; dig-hole visual OK
  • Diggy title E8 kids smoke unchanged: 16.7 ms / ~11 draws / cacheRenders=0
  • Kill-switch: Settings.HONOR_NATIVE_BLENDS=false restores blend getter empty-string gate

Diggy gameplay unlock (2026-09-09)

Coolmath host: http://localhost.coolmathgames.com:8080/Diggy_fixed.html. HoleCircle remains BitmapData stamp (off-list). E9 LAYER path is the in-level CacheRenderer engagement.

E10 Diggy menu (authoring / harness — no new scene commit)

  • MainMenu parallax l1–l7 content-static; mouse parallax is transform-only → E8 sticky CacheRenderer.
  • Per-layer cacheAsBitmap: 100 → 16.7 ms, draws 370 → ~53 GL / ~105 away, cacheRenders=0, 30/30 fps.
  • whole-menu cache discarded (cacheRenders=1 thrash from UI templates).
  • Gameplay leftover: GroundBack ~1223 fills but kids churn → whole-cache thrash (discarded). Dig-dirty: m_mask.graphics → GroundFG LAYER RTT ~10–20 ms/rebuild (expected).

Add HONOR_CACHE_AS_BITMAP (default true) so AS3 cacheAsBitmap sticks
without requiring USE_UNSAFE_CACHE_AS_BITMAP. Timeline update_mtx_* /
colorTransform skip identical hold-frame rewrites that previously
dirtied parent CacheRenderers every tick (E8 Diggy).
DisplayObject.blendMode getter returned "" unless USE_UNSAFE_BLENDS,
so Diggy GroundFG LAYER + ERASE child never engaged CacheRenderer.
HONOR_NATIVE_BLENDS (default true) lets Flash-native blends through
while non-native still need USE_UNSAFE_BLENDS. Kill-switch: false.

This branch has not been deployed

No deployments
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