diff options
| author | 2013-03-13 21:33:46 +0000 | |
|---|---|---|
| committer | 2013-03-13 21:33:47 +0000 | |
| commit | 8be3bc4a3d586903ca5e29c24bb81b3c781c2f81 (patch) | |
| tree | d1cfc0738eb5da9d108c815901a143997d3324e2 | |
| parent | dc50ba187ece96052bfc5e7ce39e466837a58b64 (diff) | |
| parent | 0f809f3b794174f044366bf421f8d0c72d9afc14 (diff) | |
Merge "Prevent infinite loop when trimming the path cache" into jb-mr2-dev
| -rw-r--r-- | libs/hwui/PathCache.cpp | 5 | ||||
| -rw-r--r-- | libs/hwui/ShapeCache.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp index afdc2c9cd4ed..fb687cd16ff5 100644 --- a/libs/hwui/PathCache.cpp +++ b/libs/hwui/PathCache.cpp @@ -55,6 +55,8 @@ void PathCache::PathProcessor::onProcess(const sp<Task<SkBitmap*> >& task) { PathCache::drawPath(t->path, t->paint, *bitmap, left, top, offset, width, height); t->setResult(bitmap); } else { + texture->width = 0; + texture->height = 0; t->setResult(NULL); } } @@ -136,8 +138,7 @@ PathTexture* PathCache::get(SkPath* path, SkPaint* paint) { addTexture(entry, bitmap, texture); texture->clearTask(); } else { - ALOGW("Path too large to be rendered into a texture (%dx%d)", - texture->width, texture->height); + ALOGW("Path too large to be rendered into a texture"); texture->clearTask(); texture = NULL; mCache.remove(entry); diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h index 58fea08aca76..92314b029520 100644 --- a/libs/hwui/ShapeCache.h +++ b/libs/hwui/ShapeCache.h @@ -717,7 +717,9 @@ void ShapeCache<Entry>::removeTexture(PathTexture* texture) { ALOGD("Shape %s deleted, size = %d", mName, size); } - glDeleteTextures(1, &texture->id); + if (texture->id) { + glDeleteTextures(1, &texture->id); + } delete texture; } } |