From ad93c2bb63dfc813b2eefa1043aa63afbddce655 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Fri, 22 Oct 2010 16:17:12 -0700 Subject: Optimizing ColorFilter in display lists Change-Id: Ie4d5e5b0bc45e0ce47bba144049303c270762e54 --- libs/hwui/DisplayListRenderer.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libs/hwui/DisplayListRenderer.h') diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h index ce4cfc5..6636de6 100644 --- a/libs/hwui/DisplayListRenderer.h +++ b/libs/hwui/DisplayListRenderer.h @@ -135,6 +135,10 @@ private: return (SkiaShader*) getInt(); } + SkiaColorFilter* getColorFilter() { + return (SkiaColorFilter*) getInt(); + } + inline int getIndex() { return mReader.readInt(); } @@ -183,6 +187,7 @@ private: Vector mBitmapResources; Vector mShaderResources; + Vector mFilterResources; Vector mPaints; Vector mMatrices; @@ -276,6 +281,10 @@ public: return mMatrices; } + const Vector& getFilterResources() const { + return mFilterResources; + } + private: inline void addOp(DisplayList::Op drawOp) { mWriter.writeInt(drawOp); @@ -372,10 +381,18 @@ private: caches.resourceCache.incrementRefcount(shader); } + inline void addColorFilter(SkiaColorFilter* colorFilter) { + addInt((int)colorFilter); + mFilterResources.add(colorFilter); + Caches& caches = Caches::getInstance(); + caches.resourceCache.incrementRefcount(colorFilter); + } + SkChunkAlloc mHeap; Vector mBitmapResources; Vector mShaderResources; + Vector mFilterResources; Vector mPaints; DefaultKeyedVector mPaintMap; -- cgit v1.1