mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Previously, we were creating a new texture for every frame. Using tracing on a Nexus 5, that appears to cost about 6ms per frame on the GPU thread. After this CL, we keep a cache of recently used textures and only allocate a new one when either (1) we don't have one free or (2) our size requirements have changed. If our size requirements change, we dump the whole texture cache. In the future, we'll probably need something fancier if we ever need more than one size texture per frame. R=jamesr@chromium.org Review URL: https://codereview.chromium.org/845963006