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

Commit 1d4e6a09 authored by John Reck's avatar John Reck
Browse files

Fix bpp mismatch

Bug: 26980851

GL_RGBA16F was being incorrectly calculated
as 4 bpp instead of 16 in Texture's objectSize(),
leading to a mismatch in cache size tracking
in GradientCache

Change-Id: I533c52fcdf9910d7a7d14bbd80965b8cbef8e147
parent 186b5439
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -165,6 +165,10 @@ Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient,
    generateTexture(colors, positions, info.width, 2, texture);

    mSize += size;
    LOG_ALWAYS_FATAL_IF((int)size != texture->objectSize(),
            "size != texture->objectSize(), size %" PRIu32 ", objectSize %" PRIu32
            " width = %" PRIu32 " bytesPerPixel() = %" PRIu32,
            size, texture->objectSize(), info.width, bytesPerPixel());
    mCache.put(gradient, texture);

    return texture;
+4 −1
Original line number Diff line number Diff line
@@ -33,8 +33,11 @@ static int bytesPerPixel(GLint glFormat) {
    case GL_RGB:
        return 3;
    case GL_RGBA:
    default:
        return 4;
    case GL_RGBA16F:
        return 16;
    default:
        LOG_ALWAYS_FATAL("UNKNOWN FORMAT %d", glFormat);
    }
}