Repository navigation
Conversation
同じ内容の表示オブジェクトは描画キャッシュを共有する。片方がステージから外れると 1 秒後にキャッシュが捨てられ、まだステージにあるもう片方は次の描画で全部作り直しに なっていた (画面を切り替えるたびに、両方の画面にある背景などが描き直される)。 表示オブジェクトは内側の Map を直接持ち、自分の ID の印があるかだけを見て使い続ける ため、CacheStore.get を通らず、削除の予約が取り消されなかった。削除を予約するときに 印を外し、まだ描かれているオブジェクトが次の描画で CacheStore.get を通るようにする。 描かれなければ、これまでどおり 1 秒後に捨てられる。毎フレームの処理は増えない。
createRootMovieClip は、レンダラーのワーカーの初期化 (描画コンテキストの作成、 シェーダーのコンパイルなど) が終わる前に root を返していた。初期化の間は何も 描けないので、その間に始めた演出は、最初の絵が出た時点で途中まで進んでいた (初期化に時間がかかる環境では、起動直後の演出の頭が欠ける)。 ワーカーが初期化の最後に送る renderFlowControl を合図にして、それを待ってから root を返す。既存の受け取り処理の中で解決するので、受け取りは増やしていない。
fix(cache): 共有しているキャッシュを、まだ描かれているオブジェクトがあるのに捨てない
feat(core): 描画側の準備が終わってから root を返す
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.
No description provided.