summaryrefslogtreecommitdiff
path: root/cmds
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2023-08-17 17:16:50 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-08-17 17:16:50 +0000
commit13399aefd2e89322eca95d7cfb4658e0eb422719 (patch)
tree2ca5e57d0eb99f3dfaf2c9da7774d4caab5fc748 /cmds
parentb4acf6d6d693ebb97bb25f4a2fab0b434a649af8 (diff)
parent6a4b84d2f4a84b5fd42cb439879f46407fcd51b2 (diff)
Merge "bootanimation: do not create texture for parts with count=1" into main
Diffstat (limited to 'cmds')
-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 27dadda40407..5b9d989bdfe6 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1525,6 +1525,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) {
@@ -1601,8 +1602,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.