Less memory allocations for repeated calls to SubtitleView.draw()
The draw method checks if all inputs are the same as in the previous call. The options to strip the subtitle of its styles were applied each time, in order to check if the final CharSequence is still the same. This additional computation (and memory allocations) can be prevented by checking if the original CharSequence (including all styles) and the flags to remove those styles are the same. The actual style removal is now part of setupTextlayout(). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=153061064
Showing
with
24 additions
and
26 deletions
Please
register
or
sign in
to comment