diff options
author | 2023-08-17 19:19:26 +0000 | |
---|---|---|
committer | 2023-08-17 19:19:26 +0000 | |
commit | 9e36d0d52d6b6d86adc6f89e448a249fde08f594 (patch) | |
tree | 9bd9ec75a68d3a161389fc5240517a537275f27b /cmds/bootanimation/BootAnimation.cpp | |
parent | 15635a6ce1bf9f70735143bbe4c46325b81e16c7 (diff) | |
parent | dd3654755fba9bd6b33240d827c7463af5aa713f (diff) |
Merge "bootanimation: do not create texture for parts with count=1" into main am: 13399aefd2 am: 2484bfca4a am: f9ec8533b9 am: c89dff9533 am: dd3654755f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2646620
Change-Id: I65fdd6fb0af99cb3536ea7e1ae11927c612d0e53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 10ce3b8d8161..774ba7460c6b 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -1565,6 +1565,7 @@ bool BootAnimation::playAnimation(const Animation& animation) { for (size_t i=0 ; i<pcount ; i++) { const Animation::Part& part(animation.parts[i]); const size_t fcount = part.frames.size(); + glBindTexture(GL_TEXTURE_2D, 0); // Handle animation package if (part.animation != nullptr) { @@ -1641,8 +1642,10 @@ bool BootAnimation::playAnimation(const Animation& animation) { if (r > 0) { glBindTexture(GL_TEXTURE_2D, frame.tid); } else { - glGenTextures(1, &frame.tid); - glBindTexture(GL_TEXTURE_2D, frame.tid); + if (part.count != 1) { + glGenTextures(1, &frame.tid); + glBindTexture(GL_TEXTURE_2D, frame.tid); + } int w, h; // Set decoding option to alpha unpremultiplied so that the R, G, B channels // of transparent pixels are preserved. |