summaryrefslogtreecommitdiff
path: root/libs/hwui/GradientCache.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-02-05 21:40:14 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-02-05 21:40:16 +0000
commit0b69467d424dcc4e1dcf29bcd96b239a13393591 (patch)
tree2467840c7ebdee293ad995442bc7e467c70eae16 /libs/hwui/GradientCache.cpp
parent469a828ac78366e0c8e15331ea950e40af48e59e (diff)
parent83c9b5bf638d75a3395f57c2c57c31c959632f9d (diff)
Merge "Add a debug assert to track down infinite loop"
Diffstat (limited to 'libs/hwui/GradientCache.cpp')
-rw-r--r--libs/hwui/GradientCache.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index e899ac71ff36..eec9ed16939e 100644
--- a/libs/hwui/GradientCache.cpp
+++ b/libs/hwui/GradientCache.cpp
@@ -168,10 +168,13 @@ Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient,
texture->blend = info.hasAlpha;
texture->generation = 1;
- // Asume the cache is always big enough
+ // Assume the cache is always big enough
const uint32_t size = info.width * 2 * bytesPerPixel();
while (getSize() + size > mMaxSize) {
- mCache.removeOldest();
+ LOG_ALWAYS_FATAL_IF(!mCache.removeOldest(),
+ "Ran out of things to remove from the cache? getSize() = %" PRIu32
+ ", size = %" PRIu32 ", mMaxSize = %" PRIu32 ", width = %" PRIu32,
+ getSize(), size, mMaxSize, info.width);
}
generateTexture(colors, positions, info.width, 2, texture);