summaryrefslogtreecommitdiff
path: root/libs/hwui/GradientCache.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-02-11 13:22:25 -0800
committer John Reck <jreck@google.com> 2016-02-11 13:22:25 -0800
commit1d4e6a0901e5d26f4319ed173b4aa7b907350d93 (patch)
treea2fdd7b8fa4f348911779fbcc047ef13910d4063 /libs/hwui/GradientCache.cpp
parent186b54397a1cdfbf4cd97f2ce997c9537f41d3ed (diff)
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
Diffstat (limited to 'libs/hwui/GradientCache.cpp')
-rw-r--r--libs/hwui/GradientCache.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index 11293d61211b..88ae02b5524d 100644
--- a/libs/hwui/GradientCache.cpp
+++ b/libs/hwui/GradientCache.cpp
@@ -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;