summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2023-08-17 18:09:23 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-08-17 18:09:23 +0000
commitc89dff9533ecea9eded5ca9af3ce8a375b4a38b5 (patch)
treeba988fb5cebfe564cc6d32bef60b21aaf2c4de68 /cmds/bootanimation/BootAnimation.cpp
parent358a302811c83d79af78ad0a4b6fd9e6469478d3 (diff)
parentf9ec8533b96b7d9ecb4b2da2d904a9094b25322a (diff)
Merge "bootanimation: do not create texture for parts with count=1" into main am: 13399aefd2 am: 2484bfca4a am: f9ec8533b9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2646620 Change-Id: I70ad3cee002751686e9d442ad7db5d2766bfa516 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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index a8b6c0b70804..782351c14399 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1523,6 +1523,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) {
@@ -1599,8 +1600,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.