Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 329b4492 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[GLUtils] Add support for GL_SRGB8_ALPHA8."

parents 9c1c9c2a c2678ba9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -622,13 +622,17 @@ void util_multiplyMV(JNIEnv *env, jclass clazz,

// ---------------------------------------------------------------------------

// The internal format is no longer the same as pixel format, per Table 2 in
// https://www.khronos.org/registry/OpenGL-Refpages/es3.1/html/glTexImage2D.xhtml
static int checkInternalFormat(SkColorType colorType, int internalformat,
    int type)
{
    switch(colorType) {
        case kN32_SkColorType:
            return (type == GL_UNSIGNED_BYTE &&
                internalformat == GL_RGBA) ? 0 : -1;
                    internalformat == GL_RGBA) ||
                (type == GL_UNSIGNED_BYTE &&
                 internalformat == GL_SRGB8_ALPHA8) ? 0 : -1;
        case kAlpha_8_SkColorType:
            return (type == GL_UNSIGNED_BYTE &&
                internalformat == GL_ALPHA) ? 0 : -1;