diff options
author | John Reck <jreck@google.com> | 2015-02-04 21:53:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-04 21:53:48 +0000 |
commit | 5ad36d4591e7b3b1b74f0a213d18384f53734ab2 (patch) | |
tree | b65334ee41c519e1a05aa9489b469b0592694728 /libs/hwui/TessellationCache.cpp | |
parent | fd2c1307e66573c398ff53eab25ee82735277091 (diff) | |
parent | c3c58e015fa30a0ad87d4af2b95b7071baa8ffe4 (diff) | |
download | frameworks_base-5ad36d4591e7b3b1b74f0a213d18384f53734ab2.zip frameworks_base-5ad36d4591e7b3b1b74f0a213d18384f53734ab2.tar.gz frameworks_base-5ad36d4591e7b3b1b74f0a213d18384f53734ab2.tar.bz2 |
Merge "Fix ANR caused by hwuiTask thread"
Diffstat (limited to 'libs/hwui/TessellationCache.cpp')
-rw-r--r-- | libs/hwui/TessellationCache.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp index 1e38f9e..bc956be 100644 --- a/libs/hwui/TessellationCache.cpp +++ b/libs/hwui/TessellationCache.cpp @@ -385,7 +385,9 @@ void TessellationCache::precacheShadows(const Matrix4* drawTransform, const Rect if (mShadowProcessor == NULL) { mShadowProcessor = new ShadowProcessor(Caches::getInstance()); } - mShadowProcessor->add(task); + if (!mShadowProcessor->add(task)) { + mShadowProcessor->process(task); + } task->incStrong(NULL); // not using sp<>s, so manually ref while in the cache mShadowCache.put(key, task.get()); @@ -421,7 +423,9 @@ TessellationCache::Buffer* TessellationCache::getOrCreateBuffer( if (mProcessor == NULL) { mProcessor = new TessellationProcessor(Caches::getInstance()); } - mProcessor->add(task); + if (!mProcessor->add(task)) { + mProcessor->process(task); + } mCache.put(entry, buffer); } return buffer; |