Loading libs/hwui/DisplayListRenderer.cpp +0 −17 Original line number Original line Diff line number Diff line Loading @@ -95,10 +95,6 @@ void DisplayList::clearResources() { delete mPaths.itemAt(i); delete mPaths.itemAt(i); } } mPaths.clear(); mPaths.clear(); for (size_t i = 0; i < mOriginalPaths.size(); i++) { caches.resourceCache.decrementRefcount(mOriginalPaths.itemAt(i)); } mOriginalPaths.clear(); for (size_t i = 0; i < mMatrices.size(); i++) { for (size_t i = 0; i < mMatrices.size(); i++) { delete mMatrices.itemAt(i); delete mMatrices.itemAt(i); Loading Loading @@ -150,13 +146,6 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde mPaths.add(paths.itemAt(i)); mPaths.add(paths.itemAt(i)); } } const Vector<SkPath*> &originalPaths = recorder.getOriginalPaths(); for (size_t i = 0; i < originalPaths.size(); i++) { SkPath* path = originalPaths.itemAt(i); mOriginalPaths.add(path); caches.resourceCache.incrementRefcount(path); } const Vector<SkMatrix*> &matrices = recorder.getMatrices(); const Vector<SkMatrix*> &matrices = recorder.getMatrices(); for (size_t i = 0; i < matrices.size(); i++) { for (size_t i = 0; i < matrices.size(); i++) { mMatrices.add(matrices.itemAt(i)); mMatrices.add(matrices.itemAt(i)); Loading Loading @@ -533,12 +522,6 @@ void DisplayListRenderer::reset() { } } mBitmapResources.clear(); mBitmapResources.clear(); for (size_t i = 0; i < mOriginalPaths.size(); i++) { SkPath* resource = mOriginalPaths.itemAt(i); caches.resourceCache.decrementRefcount(resource); } mOriginalPaths.clear(); for (size_t i = 0; i < mShaders.size(); i++) { for (size_t i = 0; i < mShaders.size(); i++) { caches.resourceCache.decrementRefcount(mShaders.itemAt(i)); caches.resourceCache.decrementRefcount(mShaders.itemAt(i)); } } Loading libs/hwui/DisplayListRenderer.h +2 −15 Original line number Original line Diff line number Diff line Loading @@ -193,7 +193,6 @@ private: Vector<SkPaint*> mPaints; Vector<SkPaint*> mPaints; Vector<SkPath*> mPaths; Vector<SkPath*> mPaths; Vector<SkPath*> mOriginalPaths; Vector<SkMatrix*> mMatrices; Vector<SkMatrix*> mMatrices; Vector<SkiaShader*> mShaders; Vector<SkiaShader*> mShaders; Loading Loading @@ -298,10 +297,6 @@ public: return mPaths; return mPaths; } } const Vector<SkPath*>& getOriginalPaths() const { return mOriginalPaths; } const Vector<SkMatrix*>& getMatrices() const { const Vector<SkMatrix*>& getMatrices() const { return mMatrices; return mMatrices; } } Loading Loading @@ -383,16 +378,9 @@ private: SkPath* pathCopy = mPathMap.valueFor(path); SkPath* pathCopy = mPathMap.valueFor(path); if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) { if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) { if (pathCopy == NULL) { pathCopy = path; mOriginalPaths.add(path); Caches& caches = Caches::getInstance(); caches.resourceCache.incrementRefcount(path); } else { pathCopy = new SkPath(*path); pathCopy = new SkPath(*path); mPaths.add(pathCopy); } mPathMap.add(path, pathCopy); mPathMap.add(path, pathCopy); mPaths.add(pathCopy); } } addInt((int) pathCopy); addInt((int) pathCopy); Loading Loading @@ -469,7 +457,6 @@ private: Vector<SkPaint*> mPaints; Vector<SkPaint*> mPaints; DefaultKeyedVector<SkPaint*, SkPaint*> mPaintMap; DefaultKeyedVector<SkPaint*, SkPaint*> mPaintMap; Vector<SkPath*> mOriginalPaths; Vector<SkPath*> mPaths; Vector<SkPath*> mPaths; DefaultKeyedVector<SkPath*, SkPath*> mPathMap; DefaultKeyedVector<SkPath*, SkPath*> mPathMap; Loading libs/hwui/PathCache.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -41,8 +41,7 @@ struct PathCacheEntry: public ShapeCacheEntry { path = NULL; path = NULL; } } PathCacheEntry(const PathCacheEntry& entry): PathCacheEntry(const PathCacheEntry& entry): ShapeCacheEntry(entry) { ShapeCacheEntry(entry) { path = entry.path; path = entry.path; } } Loading @@ -55,6 +54,7 @@ struct PathCacheEntry: public ShapeCacheEntry { } } SkPath* path; SkPath* path; }; // PathCacheEntry }; // PathCacheEntry /** /** Loading libs/hwui/ShapeCache.h +6 −3 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ struct ShapeCacheEntry { ShapeCacheEntry(const ShapeCacheEntry& entry): ShapeCacheEntry(const ShapeCacheEntry& entry): shapeType(entry.shapeType), join(entry.join), cap(entry.cap), shapeType(entry.shapeType), join(entry.join), cap(entry.cap), style(entry.style), miter(entry.miter), style(entry.style), miter(entry.miter), strokeWidth(entry.strokeWidth) { strokeWidth(entry.strokeWidth), pathEffect(entry.pathEffect) { } } ShapeCacheEntry(ShapeType type, SkPaint* paint) { ShapeCacheEntry(ShapeType type, SkPaint* paint) { Loading @@ -108,18 +108,19 @@ struct ShapeCacheEntry { v = paint->getStrokeWidth(); v = paint->getStrokeWidth(); strokeWidth = *(uint32_t*) &v; strokeWidth = *(uint32_t*) &v; style = paint->getStyle(); style = paint->getStyle(); pathEffect = paint->getPathEffect(); } } virtual ~ShapeCacheEntry() { virtual ~ShapeCacheEntry() { } } // shapeType must be checked in subclasses operator< ShapeType shapeType; ShapeType shapeType; SkPaint::Join join; SkPaint::Join join; SkPaint::Cap cap; SkPaint::Cap cap; SkPaint::Style style; SkPaint::Style style; uint32_t miter; uint32_t miter; uint32_t strokeWidth; uint32_t strokeWidth; SkPathEffect* pathEffect; bool operator<(const ShapeCacheEntry& rhs) const { bool operator<(const ShapeCacheEntry& rhs) const { LTE_INT(shapeType) { LTE_INT(shapeType) { Loading @@ -128,6 +129,7 @@ struct ShapeCacheEntry { LTE_INT(style) { LTE_INT(style) { LTE_INT(miter) { LTE_INT(miter) { LTE_INT(strokeWidth) { LTE_INT(strokeWidth) { LTE_INT(pathEffect) { return lessThan(rhs); return lessThan(rhs); } } } } Loading @@ -135,6 +137,7 @@ struct ShapeCacheEntry { } } } } } } } return false; return false; } } Loading Loading
libs/hwui/DisplayListRenderer.cpp +0 −17 Original line number Original line Diff line number Diff line Loading @@ -95,10 +95,6 @@ void DisplayList::clearResources() { delete mPaths.itemAt(i); delete mPaths.itemAt(i); } } mPaths.clear(); mPaths.clear(); for (size_t i = 0; i < mOriginalPaths.size(); i++) { caches.resourceCache.decrementRefcount(mOriginalPaths.itemAt(i)); } mOriginalPaths.clear(); for (size_t i = 0; i < mMatrices.size(); i++) { for (size_t i = 0; i < mMatrices.size(); i++) { delete mMatrices.itemAt(i); delete mMatrices.itemAt(i); Loading Loading @@ -150,13 +146,6 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde mPaths.add(paths.itemAt(i)); mPaths.add(paths.itemAt(i)); } } const Vector<SkPath*> &originalPaths = recorder.getOriginalPaths(); for (size_t i = 0; i < originalPaths.size(); i++) { SkPath* path = originalPaths.itemAt(i); mOriginalPaths.add(path); caches.resourceCache.incrementRefcount(path); } const Vector<SkMatrix*> &matrices = recorder.getMatrices(); const Vector<SkMatrix*> &matrices = recorder.getMatrices(); for (size_t i = 0; i < matrices.size(); i++) { for (size_t i = 0; i < matrices.size(); i++) { mMatrices.add(matrices.itemAt(i)); mMatrices.add(matrices.itemAt(i)); Loading Loading @@ -533,12 +522,6 @@ void DisplayListRenderer::reset() { } } mBitmapResources.clear(); mBitmapResources.clear(); for (size_t i = 0; i < mOriginalPaths.size(); i++) { SkPath* resource = mOriginalPaths.itemAt(i); caches.resourceCache.decrementRefcount(resource); } mOriginalPaths.clear(); for (size_t i = 0; i < mShaders.size(); i++) { for (size_t i = 0; i < mShaders.size(); i++) { caches.resourceCache.decrementRefcount(mShaders.itemAt(i)); caches.resourceCache.decrementRefcount(mShaders.itemAt(i)); } } Loading
libs/hwui/DisplayListRenderer.h +2 −15 Original line number Original line Diff line number Diff line Loading @@ -193,7 +193,6 @@ private: Vector<SkPaint*> mPaints; Vector<SkPaint*> mPaints; Vector<SkPath*> mPaths; Vector<SkPath*> mPaths; Vector<SkPath*> mOriginalPaths; Vector<SkMatrix*> mMatrices; Vector<SkMatrix*> mMatrices; Vector<SkiaShader*> mShaders; Vector<SkiaShader*> mShaders; Loading Loading @@ -298,10 +297,6 @@ public: return mPaths; return mPaths; } } const Vector<SkPath*>& getOriginalPaths() const { return mOriginalPaths; } const Vector<SkMatrix*>& getMatrices() const { const Vector<SkMatrix*>& getMatrices() const { return mMatrices; return mMatrices; } } Loading Loading @@ -383,16 +378,9 @@ private: SkPath* pathCopy = mPathMap.valueFor(path); SkPath* pathCopy = mPathMap.valueFor(path); if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) { if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) { if (pathCopy == NULL) { pathCopy = path; mOriginalPaths.add(path); Caches& caches = Caches::getInstance(); caches.resourceCache.incrementRefcount(path); } else { pathCopy = new SkPath(*path); pathCopy = new SkPath(*path); mPaths.add(pathCopy); } mPathMap.add(path, pathCopy); mPathMap.add(path, pathCopy); mPaths.add(pathCopy); } } addInt((int) pathCopy); addInt((int) pathCopy); Loading Loading @@ -469,7 +457,6 @@ private: Vector<SkPaint*> mPaints; Vector<SkPaint*> mPaints; DefaultKeyedVector<SkPaint*, SkPaint*> mPaintMap; DefaultKeyedVector<SkPaint*, SkPaint*> mPaintMap; Vector<SkPath*> mOriginalPaths; Vector<SkPath*> mPaths; Vector<SkPath*> mPaths; DefaultKeyedVector<SkPath*, SkPath*> mPathMap; DefaultKeyedVector<SkPath*, SkPath*> mPathMap; Loading
libs/hwui/PathCache.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -41,8 +41,7 @@ struct PathCacheEntry: public ShapeCacheEntry { path = NULL; path = NULL; } } PathCacheEntry(const PathCacheEntry& entry): PathCacheEntry(const PathCacheEntry& entry): ShapeCacheEntry(entry) { ShapeCacheEntry(entry) { path = entry.path; path = entry.path; } } Loading @@ -55,6 +54,7 @@ struct PathCacheEntry: public ShapeCacheEntry { } } SkPath* path; SkPath* path; }; // PathCacheEntry }; // PathCacheEntry /** /** Loading
libs/hwui/ShapeCache.h +6 −3 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ struct ShapeCacheEntry { ShapeCacheEntry(const ShapeCacheEntry& entry): ShapeCacheEntry(const ShapeCacheEntry& entry): shapeType(entry.shapeType), join(entry.join), cap(entry.cap), shapeType(entry.shapeType), join(entry.join), cap(entry.cap), style(entry.style), miter(entry.miter), style(entry.style), miter(entry.miter), strokeWidth(entry.strokeWidth) { strokeWidth(entry.strokeWidth), pathEffect(entry.pathEffect) { } } ShapeCacheEntry(ShapeType type, SkPaint* paint) { ShapeCacheEntry(ShapeType type, SkPaint* paint) { Loading @@ -108,18 +108,19 @@ struct ShapeCacheEntry { v = paint->getStrokeWidth(); v = paint->getStrokeWidth(); strokeWidth = *(uint32_t*) &v; strokeWidth = *(uint32_t*) &v; style = paint->getStyle(); style = paint->getStyle(); pathEffect = paint->getPathEffect(); } } virtual ~ShapeCacheEntry() { virtual ~ShapeCacheEntry() { } } // shapeType must be checked in subclasses operator< ShapeType shapeType; ShapeType shapeType; SkPaint::Join join; SkPaint::Join join; SkPaint::Cap cap; SkPaint::Cap cap; SkPaint::Style style; SkPaint::Style style; uint32_t miter; uint32_t miter; uint32_t strokeWidth; uint32_t strokeWidth; SkPathEffect* pathEffect; bool operator<(const ShapeCacheEntry& rhs) const { bool operator<(const ShapeCacheEntry& rhs) const { LTE_INT(shapeType) { LTE_INT(shapeType) { Loading @@ -128,6 +129,7 @@ struct ShapeCacheEntry { LTE_INT(style) { LTE_INT(style) { LTE_INT(miter) { LTE_INT(miter) { LTE_INT(strokeWidth) { LTE_INT(strokeWidth) { LTE_INT(pathEffect) { return lessThan(rhs); return lessThan(rhs); } } } } Loading @@ -135,6 +137,7 @@ struct ShapeCacheEntry { } } } } } } } return false; return false; } } Loading