Loading libs/hwui/PathCache.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,22 @@ void PathCache::operator()(PathDescription& entry, PathTexture*& texture) { void PathCache::removeTexture(PathTexture* texture) { if (texture) { const uint32_t size = texture->width * texture->height; // If there is a pending task we must wait for it to return // before attempting our cleanup const sp<Task<SkBitmap*> >& task = texture->task(); if (task != NULL) { SkBitmap* bitmap = task->getResult(); texture->clearTask(); } else { // If there is a pending task, the path was not added // to the cache and the size wasn't increased if (size > mSize) { ALOGE("Removing path texture of size %d will leave " "the cache in an inconsistent state", size); } mSize -= size; } PATH_LOGD("PathCache::delete name, size, mSize = %d, %d, %d", texture->id, size, mSize); Loading tests/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java +7 −2 Original line number Diff line number Diff line Loading @@ -89,8 +89,6 @@ public class PathsCacheActivity extends Activity { protected void onDraw(Canvas canvas) { super.onDraw(canvas); Log.d("OpenGLRenderer", "Start frame"); canvas.drawARGB(255, 255, 255, 255); canvas.save(); Loading @@ -104,6 +102,13 @@ public class PathsCacheActivity extends Activity { canvas.drawPath(mPath, mMediumPaint); canvas.drawPath(mPath, mMediumPaint); mPath.reset(); buildPath(mPath); canvas.translate(30.0f, 30.0f); canvas.drawPath(mPath, mMediumPaint); canvas.drawPath(mPath, mMediumPaint); canvas.restore(); for (int i = 0; i < mRandom.nextInt(20); i++) { Loading Loading
libs/hwui/PathCache.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,22 @@ void PathCache::operator()(PathDescription& entry, PathTexture*& texture) { void PathCache::removeTexture(PathTexture* texture) { if (texture) { const uint32_t size = texture->width * texture->height; // If there is a pending task we must wait for it to return // before attempting our cleanup const sp<Task<SkBitmap*> >& task = texture->task(); if (task != NULL) { SkBitmap* bitmap = task->getResult(); texture->clearTask(); } else { // If there is a pending task, the path was not added // to the cache and the size wasn't increased if (size > mSize) { ALOGE("Removing path texture of size %d will leave " "the cache in an inconsistent state", size); } mSize -= size; } PATH_LOGD("PathCache::delete name, size, mSize = %d, %d, %d", texture->id, size, mSize); Loading
tests/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java +7 −2 Original line number Diff line number Diff line Loading @@ -89,8 +89,6 @@ public class PathsCacheActivity extends Activity { protected void onDraw(Canvas canvas) { super.onDraw(canvas); Log.d("OpenGLRenderer", "Start frame"); canvas.drawARGB(255, 255, 255, 255); canvas.save(); Loading @@ -104,6 +102,13 @@ public class PathsCacheActivity extends Activity { canvas.drawPath(mPath, mMediumPaint); canvas.drawPath(mPath, mMediumPaint); mPath.reset(); buildPath(mPath); canvas.translate(30.0f, 30.0f); canvas.drawPath(mPath, mMediumPaint); canvas.drawPath(mPath, mMediumPaint); canvas.restore(); for (int i = 0; i < mRandom.nextInt(20); i++) { Loading