commit | 46926698996d3857a650ed535024a88dbeaff1e1 | [log] [tgz] |
---|---|---|
author | Romain Guy <romainguy@google.com> | Mon Mar 12 14:54:01 2012 -0700 |
committer | Romain Guy <romainguy@google.com> | Mon Mar 12 14:54:01 2012 -0700 |
tree | f70ca404271242cce1e672d8a6aeff9a3b959091 | |
parent | 3fe4eb9c60d39acaadd9f807b1a21c239d1270ef [diff] |
Don't allocate new typefaces when not needed. The Typeface.create(Typeface, int) API can be used to create a new typeface derived from an existing typeface. The implementation would however create a new Typeface instance on every call, creating unnecessary garbage in text-heavy applications. This changelist adds a small cache of derived typefaces to avoid allocations whenever possible. Change-Id: Ib7290b3183e372aae12cf66033690e15cd4d0691