From 84bb8e4001337842fb602ddebb9713bbbf4ccbc5 Mon Sep 17 00:00:00 2001 From: Peiyong Lin Date: Wed, 31 Oct 2018 10:27:58 -0700 Subject: [PATCH] [GLUtils] Return the correct pixel format for GL_SRGB8_ALPHA8. The pixel format for GL_SRGB8_ALPHA8 should be GL_RGBA. Previously we added support for explicitly passing in GL_SRGB8_ALPHA8 as internal format, in this patch we make sure we pick the correct pixel format. BUG: 117886297 Test: Build, flash and boot, test with hacked app Change-Id: Ied6b7a649c9f64ba2afffd6627ebb0d14154d1f6 --- core/jni/android/opengl/util.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp index a45b4933a9006..d50e60c1a899d 100644 --- a/core/jni/android/opengl/util.cpp +++ b/core/jni/android/opengl/util.cpp @@ -657,6 +657,7 @@ static int getPixelFormatFromInternalFormat(uint32_t internalFormat) { switch (internalFormat) { // For sized internal format. case GL_RGBA16F: + case GL_SRGB8_ALPHA8: return GL_RGBA; // Base internal formats and pixel formats are still the same, see Table 1 in // https://www.khronos.org/registry/OpenGL-Refpages/es3.1/html/glTexImage2D.xhtml