diff options
author | 2023-08-17 17:37:05 +0000 | |
---|---|---|
committer | 2023-08-17 17:37:05 +0000 | |
commit | 2484bfca4a01731b01f7f7e3f8c0a75f8f25d2cf (patch) | |
tree | f1743e3d211b52d324157e9af21ca5e40bb618ce /cmds/bootanimation/BootAnimation.cpp | |
parent | 0c4a758d200e6a5ebe29759ceed1575ec9d32dd5 (diff) | |
parent | 13399aefd2e89322eca95d7cfb4658e0eb422719 (diff) |
Merge "bootanimation: do not create texture for parts with count=1" into main am: 13399aefd2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2646620
Change-Id: I38b8285d3c356a165caf6e187be7935045778c5c
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 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. |