Wait until end of BootAnimation to free looping textures

glDeleteTextures causes a noticeable framerate hitch when switching to
the outro.  By the time looping is finished, the system has finished
booting, so freeing the textures immediately is less beneficial.

Bug: 29878551
Bug: 30040263
Change-Id: I5a404a6e18cd2cf64d6c94343f82fa5db8dfbab3
This commit is contained in:
Geoffrey Pitsch
2016-07-06 16:16:20 -04:00
parent 3cc6935719
commit 2fb30fb68e

View File

@@ -839,9 +839,13 @@ bool BootAnimation::playAnimation(const Animation& animation)
break;
}
// free the textures for this part
}
// Free textures created for looping parts now that the animation is done.
for (const Animation::Part& part : animation.parts) {
if (part.count != 1) {
for (size_t j=0 ; j<fcount ; j++) {
const size_t fcount = part.frames.size();
for (size_t j = 0; j < fcount; j++) {
const Animation::Frame& frame(part.frames[j]);
glDeleteTextures(1, &frame.tid);
}