Merge "Fix bpp mismatch" into nyc-dev

This commit is contained in:
John Reck
2016-02-11 22:05:14 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 1 deletions

View File

@@ -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;

View File

@@ -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);
}
}