summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListRenderer.h
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2010-10-22 16:17:12 -0700
committerChet Haase <chet@google.com>2010-10-26 12:52:03 -0700
commitad93c2bb63dfc813b2eefa1043aa63afbddce655 (patch)
treeb1a5a9cd667ed0dca718405390d76081a8241d54 /libs/hwui/DisplayListRenderer.h
parent78098341f86b4c71256017ca2b33674d6bcab046 (diff)
downloadframeworks_base-ad93c2bb63dfc813b2eefa1043aa63afbddce655.zip
frameworks_base-ad93c2bb63dfc813b2eefa1043aa63afbddce655.tar.gz
frameworks_base-ad93c2bb63dfc813b2eefa1043aa63afbddce655.tar.bz2
Optimizing ColorFilter in display lists
Change-Id: Ie4d5e5b0bc45e0ce47bba144049303c270762e54
Diffstat (limited to 'libs/hwui/DisplayListRenderer.h')
-rw-r--r--libs/hwui/DisplayListRenderer.h17
1 files changed, 17 insertions, 0 deletions
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<SkBitmap*> mBitmapResources;
Vector<SkiaShader*> mShaderResources;
+ Vector<SkiaColorFilter*> mFilterResources;
Vector<SkPaint*> mPaints;
Vector<SkMatrix*> mMatrices;
@@ -276,6 +281,10 @@ public:
return mMatrices;
}
+ const Vector<SkiaColorFilter*>& 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<SkBitmap*> mBitmapResources;
Vector<SkiaShader*> mShaderResources;
+ Vector<SkiaColorFilter*> mFilterResources;
Vector<SkPaint*> mPaints;
DefaultKeyedVector<SkPaint *, SkPaint *> mPaintMap;