Loading libs/hwui/DisplayListRenderer.h +1 −0 Original line number Diff line number Diff line Loading @@ -462,6 +462,7 @@ private: SkPath* pathCopy = mPathMap.valueFor(path); if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) { pathCopy = new SkPath(*path); pathCopy->setSourcePath(path); // replaceValueFor() performs an add if the entry doesn't exist mPathMap.replaceValueFor(path, pathCopy); mPaths.add(pathCopy); Loading libs/hwui/PathCache.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ void PathCache::clearGarbage() { } PathTexture* PathCache::get(SkPath* path, SkPaint* paint) { const SkPath* sourcePath = path->getSourcePath(); if (sourcePath && sourcePath->getGenerationID() == path->getGenerationID()) { path = const_cast<SkPath*>(sourcePath); } PathCacheEntry entry(path, paint); PathTexture* texture = mCache.get(entry); Loading tests/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java +18 −13 Original line number Diff line number Diff line Loading @@ -92,19 +92,24 @@ public class PathsCacheActivity extends Activity { canvas.restore(); // Path path = makePath(); // int r = mRandom.nextInt(10); // if (r == 5 || r == 3) { // mPathList.add(path); // } else if (r == 9) { // mPathList.clear(); // } // // canvas.save(); // canvas.translate(550.0f + mRandom.nextInt(50), 60.0f + mRandom.nextInt(50)); // canvas.drawPath(path, mMediumPaint); // canvas.restore(); // for (int i = 0; i < mRandom.nextInt(20); i++) { Path path = makePath(); int r = mRandom.nextInt(10); if (r == 5 || r == 3) { mPathList.add(path); } canvas.save(); canvas.translate(450.0f + mRandom.nextInt(200), mRandom.nextInt(200)); canvas.drawPath(path, mMediumPaint); canvas.restore(); } int r = mRandom.nextInt(100); if (r == 50) { mPathList.clear(); } invalidate(); } } Loading Loading
libs/hwui/DisplayListRenderer.h +1 −0 Original line number Diff line number Diff line Loading @@ -462,6 +462,7 @@ private: SkPath* pathCopy = mPathMap.valueFor(path); if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) { pathCopy = new SkPath(*path); pathCopy->setSourcePath(path); // replaceValueFor() performs an add if the entry doesn't exist mPathMap.replaceValueFor(path, pathCopy); mPaths.add(pathCopy); Loading
libs/hwui/PathCache.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ void PathCache::clearGarbage() { } PathTexture* PathCache::get(SkPath* path, SkPaint* paint) { const SkPath* sourcePath = path->getSourcePath(); if (sourcePath && sourcePath->getGenerationID() == path->getGenerationID()) { path = const_cast<SkPath*>(sourcePath); } PathCacheEntry entry(path, paint); PathTexture* texture = mCache.get(entry); Loading
tests/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java +18 −13 Original line number Diff line number Diff line Loading @@ -92,19 +92,24 @@ public class PathsCacheActivity extends Activity { canvas.restore(); // Path path = makePath(); // int r = mRandom.nextInt(10); // if (r == 5 || r == 3) { // mPathList.add(path); // } else if (r == 9) { // mPathList.clear(); // } // // canvas.save(); // canvas.translate(550.0f + mRandom.nextInt(50), 60.0f + mRandom.nextInt(50)); // canvas.drawPath(path, mMediumPaint); // canvas.restore(); // for (int i = 0; i < mRandom.nextInt(20); i++) { Path path = makePath(); int r = mRandom.nextInt(10); if (r == 5 || r == 3) { mPathList.add(path); } canvas.save(); canvas.translate(450.0f + mRandom.nextInt(200), mRandom.nextInt(200)); canvas.drawPath(path, mMediumPaint); canvas.restore(); } int r = mRandom.nextInt(100); if (r == 50) { mPathList.clear(); } invalidate(); } } Loading