summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-08-16 14:44:38 -0700
committerRomain Guy <romainguy@google.com>2013-08-16 14:44:38 -0700
commitb0a41ed3dcc34a2b4026f6cc8336796f3523aa21 (patch)
treef3be3328e2c2ca0d70c95dd26d605a638c4a6cc4 /libs/hwui
parentb746371de7f21ae36a14953d9b253df06838efb1 (diff)
downloadframeworks_base-b0a41ed3dcc34a2b4026f6cc8336796f3523aa21.zip
frameworks_base-b0a41ed3dcc34a2b4026f6cc8336796f3523aa21.tar.gz
frameworks_base-b0a41ed3dcc34a2b4026f6cc8336796f3523aa21.tar.bz2
Prevent ANR in apps using drawPath()
Bug #10347089 If an app clears its path cache before stopping background tasks, it could get into an infinite loop in PathCache::trim(). Change-Id: Ieb865b762e7b00aebaba0c023769c2db286a94f5
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/Caches.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 641cbc8..f9cf9a2 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -331,6 +331,11 @@ void Caches::deleteDisplayListDeferred(DisplayList* displayList) {
void Caches::flush(FlushMode mode) {
FLUSH_LOGD("Flushing caches (mode %d)", mode);
+ // We must stop tasks before clearing caches
+ if (mode > kFlushMode_Layers) {
+ tasks.stop();
+ }
+
switch (mode) {
case kFlushMode_Full:
textureCache.clear();
@@ -345,7 +350,6 @@ void Caches::flush(FlushMode mode) {
fontRenderer->flush();
textureCache.flush();
pathCache.clear();
- tasks.stop();
// fall through
case kFlushMode_Layers:
layerCache.clear();