blob: 6fc315c0c1d60af9760e3e804e48983d0082839f [file] [log] [blame]
Romain Guy4aa90572010-09-26 18:40:37 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Romain Guy5b3b3522010-10-27 18:57:51 -070017#ifndef ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
18#define ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
Romain Guy4aa90572010-09-26 18:40:37 -070019
20#include <SkChunkAlloc.h>
21#include <SkFlattenable.h>
22#include <SkMatrix.h>
23#include <SkPaint.h>
24#include <SkPath.h>
Romain Guy4aa90572010-09-26 18:40:37 -070025#include <SkRefCnt.h>
26#include <SkTDArray.h>
27#include <SkTSearch.h>
28
29#include "OpenGLRenderer.h"
Romain Guy7d7b5492011-01-24 16:33:45 -080030#include "utils/Functor.h"
Romain Guy4aa90572010-09-26 18:40:37 -070031
32namespace android {
33namespace uirenderer {
34
35///////////////////////////////////////////////////////////////////////////////
36// Defines
37///////////////////////////////////////////////////////////////////////////////
38
39#define MIN_WRITER_SIZE 16384
Romain Guy4aa90572010-09-26 18:40:37 -070040
Romain Guyffac7fc2011-01-13 17:21:49 -080041// Debug
42#if DEBUG_DISPLAY_LIST
43 #define DISPLAY_LIST_LOGD(...) LOGD(__VA_ARGS__)
44#else
45 #define DISPLAY_LIST_LOGD(...)
46#endif
47
Romain Guy4aa90572010-09-26 18:40:37 -070048///////////////////////////////////////////////////////////////////////////////
Romain Guyb051e892010-09-28 19:09:36 -070049// Display list
Romain Guy4aa90572010-09-26 18:40:37 -070050///////////////////////////////////////////////////////////////////////////////
51
Romain Guyb051e892010-09-28 19:09:36 -070052class DisplayListRenderer;
53
Romain Guy4aa90572010-09-26 18:40:37 -070054/**
Romain Guyb051e892010-09-28 19:09:36 -070055 * Replays recorded drawing commands.
Romain Guy4aa90572010-09-26 18:40:37 -070056 */
Romain Guyb051e892010-09-28 19:09:36 -070057class DisplayList {
Romain Guy4aa90572010-09-26 18:40:37 -070058public:
Romain Guyb051e892010-09-28 19:09:36 -070059 DisplayList(const DisplayListRenderer& recorder);
60 ~DisplayList();
Romain Guy4aa90572010-09-26 18:40:37 -070061
Romain Guyffac7fc2011-01-13 17:21:49 -080062 // IMPORTANT: Update the intialization of OP_NAMES in the .cpp file
63 // when modifying this file
Romain Guy4aa90572010-09-26 18:40:37 -070064 enum Op {
Romain Guy2b1847e2011-01-26 13:43:01 -080065 Save = 0,
Romain Guy4aa90572010-09-26 18:40:37 -070066 Restore,
67 RestoreToCount,
68 SaveLayer,
Romain Guy5b3b3522010-10-27 18:57:51 -070069 SaveLayerAlpha,
Romain Guy4aa90572010-09-26 18:40:37 -070070 Translate,
71 Rotate,
72 Scale,
Romain Guy807daf72011-01-18 11:19:19 -080073 Skew,
Romain Guy4aa90572010-09-26 18:40:37 -070074 SetMatrix,
75 ConcatMatrix,
76 ClipRect,
Romain Guy0fe478e2010-11-08 12:08:41 -080077 DrawDisplayList,
Romain Guy6c319ca2011-01-11 14:29:25 -080078 DrawLayer,
Romain Guy4aa90572010-09-26 18:40:37 -070079 DrawBitmap,
80 DrawBitmapMatrix,
81 DrawBitmapRect,
Romain Guy5a7b4662011-01-20 19:09:30 -080082 DrawBitmapMesh,
Romain Guy4aa90572010-09-26 18:40:37 -070083 DrawPatch,
84 DrawColor,
85 DrawRect,
Romain Guy01d58e42011-01-19 21:54:02 -080086 DrawRoundRect,
87 DrawCircle,
Romain Guyc1cd9ba32011-01-23 14:18:41 -080088 DrawOval,
Romain Guy8b2f5262011-01-23 16:15:02 -080089 DrawArc,
Romain Guy4aa90572010-09-26 18:40:37 -070090 DrawPath,
91 DrawLines,
92 DrawText,
93 ResetShader,
94 SetupShader,
95 ResetColorFilter,
96 SetupColorFilter,
97 ResetShadow,
Romain Guyffac7fc2011-01-13 17:21:49 -080098 SetupShadow,
Chet Haasedaf98e92011-01-10 14:10:36 -080099 DrawGLFunction,
Romain Guy4aa90572010-09-26 18:40:37 -0700100 };
101
Romain Guyffac7fc2011-01-13 17:21:49 -0800102 static const char* OP_NAMES[];
103
Chet Haased63cbd12011-02-03 16:32:46 -0800104 void initFromDisplayListRenderer(const DisplayListRenderer& recorder, bool reusing = false);
Chet Haase5977baa2011-01-05 18:01:22 -0800105
Romain Guycabfcc12011-03-07 18:06:46 -0800106 bool replay(OpenGLRenderer& renderer, Rect& dirty, uint32_t level = 0);
Romain Guyb051e892010-09-28 19:09:36 -0700107
108private:
109 void init();
110
Chet Haased63cbd12011-02-03 16:32:46 -0800111 void clearResources();
112
Romain Guyb051e892010-09-28 19:09:36 -0700113 class TextContainer {
114 public:
115 size_t length() const {
116 return mByteLength;
117 }
118
119 const char* text() const {
120 return (const char*) mText;
121 }
122
123 size_t mByteLength;
124 const char* mText;
125 };
126
127 SkBitmap* getBitmap() {
Chet Haase5c13d892010-10-08 08:37:55 -0700128 return (SkBitmap*) getInt();
129 }
130
131 SkiaShader* getShader() {
132 return (SkiaShader*) getInt();
Romain Guyb051e892010-09-28 19:09:36 -0700133 }
134
Chet Haasead93c2b2010-10-22 16:17:12 -0700135 SkiaColorFilter* getColorFilter() {
136 return (SkiaColorFilter*) getInt();
137 }
138
Romain Guyb051e892010-09-28 19:09:36 -0700139 inline int getIndex() {
140 return mReader.readInt();
141 }
142
143 inline int getInt() {
144 return mReader.readInt();
145 }
146
Romain Guy7b5b6ab2011-03-14 18:05:08 -0700147 inline uint32_t getUInt() {
148 return mReader.readU32();
149 }
150
Romain Guyb051e892010-09-28 19:09:36 -0700151 SkMatrix* getMatrix() {
Chet Haase5c13d892010-10-08 08:37:55 -0700152 return (SkMatrix*) getInt();
Romain Guyb051e892010-09-28 19:09:36 -0700153 }
154
155 SkPath* getPath() {
Romain Guy2fc941e2011-02-03 15:06:05 -0800156 return (SkPath*) getInt();
Romain Guyb051e892010-09-28 19:09:36 -0700157 }
158
159 SkPaint* getPaint() {
Chet Haase5c13d892010-10-08 08:37:55 -0700160 return (SkPaint*) getInt();
Romain Guyb051e892010-09-28 19:09:36 -0700161 }
162
Romain Guy0fe478e2010-11-08 12:08:41 -0800163 DisplayList* getDisplayList() {
164 return (DisplayList*) getInt();
165 }
166
Romain Guyb051e892010-09-28 19:09:36 -0700167 inline float getFloat() {
168 return mReader.readScalar();
169 }
170
171 int32_t* getInts(uint32_t& count) {
172 count = getInt();
173 return (int32_t*) mReader.skip(count * sizeof(int32_t));
174 }
175
Romain Guy4bb94202010-10-12 15:59:26 -0700176 uint32_t* getUInts(int8_t& count) {
177 count = getInt();
178 return (uint32_t*) mReader.skip(count * sizeof(uint32_t));
179 }
180
Romain Guyb051e892010-09-28 19:09:36 -0700181 float* getFloats(int& count) {
182 count = getInt();
183 return (float*) mReader.skip(count * sizeof(float));
184 }
185
186 void getText(TextContainer* text) {
187 size_t length = text->mByteLength = getInt();
188 text->mText = (const char*) mReader.skip(length);
189 }
190
Chet Haase5c13d892010-10-08 08:37:55 -0700191 Vector<SkBitmap*> mBitmapResources;
Chet Haasead93c2b2010-10-22 16:17:12 -0700192 Vector<SkiaColorFilter*> mFilterResources;
Romain Guyb051e892010-09-28 19:09:36 -0700193
Chet Haased98aa2d2010-10-25 15:47:32 -0700194 Vector<SkPaint*> mPaints;
Romain Guy2fc941e2011-02-03 15:06:05 -0800195 Vector<SkPath*> mPaths;
Chet Haase5a7e8282011-02-04 12:50:55 -0800196 Vector<SkPath*> mOriginalPaths;
Chet Haased98aa2d2010-10-25 15:47:32 -0700197 Vector<SkMatrix*> mMatrices;
Romain Guy24c00212011-01-14 15:31:00 -0800198 Vector<SkiaShader*> mShaders;
Chet Haased98aa2d2010-10-25 15:47:32 -0700199
Romain Guyb051e892010-09-28 19:09:36 -0700200 mutable SkFlattenableReadBuffer mReader;
Romain Guyb051e892010-09-28 19:09:36 -0700201};
202
203///////////////////////////////////////////////////////////////////////////////
204// Renderer
205///////////////////////////////////////////////////////////////////////////////
206
207/**
208 * Records drawing commands in a display list for latter playback.
209 */
210class DisplayListRenderer: public OpenGLRenderer {
211public:
212 DisplayListRenderer();
213 ~DisplayListRenderer();
214
Chet Haase5977baa2011-01-05 18:01:22 -0800215 DisplayList* getDisplayList();
216
Romain Guyb051e892010-09-28 19:09:36 -0700217 void setViewport(int width, int height);
Romain Guy7d7b5492011-01-24 16:33:45 -0800218 void prepareDirty(float left, float top, float right, float bottom, bool opaque);
Romain Guy27454a42011-01-23 12:01:41 -0800219 void finish();
Romain Guyb051e892010-09-28 19:09:36 -0700220
Romain Guycabfcc12011-03-07 18:06:46 -0800221 bool callDrawGLFunction(Functor *functor, Rect& dirty);
Romain Guy4aa90572010-09-26 18:40:37 -0700222
Chet Haasedaf98e92011-01-10 14:10:36 -0800223 void interrupt();
224 void resume();
225
Romain Guy4aa90572010-09-26 18:40:37 -0700226 int save(int flags);
227 void restore();
228 void restoreToCount(int saveCount);
229
230 int saveLayer(float left, float top, float right, float bottom,
Chet Haase5c13d892010-10-08 08:37:55 -0700231 SkPaint* p, int flags);
Romain Guy5b3b3522010-10-27 18:57:51 -0700232 int saveLayerAlpha(float left, float top, float right, float bottom,
233 int alpha, int flags);
Romain Guy4aa90572010-09-26 18:40:37 -0700234
235 void translate(float dx, float dy);
236 void rotate(float degrees);
237 void scale(float sx, float sy);
Romain Guy807daf72011-01-18 11:19:19 -0800238 void skew(float sx, float sy);
Romain Guy4aa90572010-09-26 18:40:37 -0700239
240 void setMatrix(SkMatrix* matrix);
241 void concatMatrix(SkMatrix* matrix);
242
243 bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op);
244
Romain Guy7b5b6ab2011-03-14 18:05:08 -0700245 bool drawDisplayList(DisplayList* displayList, uint32_t width, uint32_t height,
246 Rect& dirty, uint32_t level = 0);
Romain Guyada830f2011-01-13 12:13:20 -0800247 void drawLayer(Layer* layer, float x, float y, SkPaint* paint);
Chet Haase5c13d892010-10-08 08:37:55 -0700248 void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint);
249 void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint);
Romain Guy4aa90572010-09-26 18:40:37 -0700250 void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop,
251 float srcRight, float srcBottom, float dstLeft, float dstTop,
Chet Haase5c13d892010-10-08 08:37:55 -0700252 float dstRight, float dstBottom, SkPaint* paint);
Romain Guy5a7b4662011-01-20 19:09:30 -0800253 void drawBitmapMesh(SkBitmap* bitmap, int meshWidth, int meshHeight,
254 float* vertices, int* colors, SkPaint* paint);
Romain Guy4aa90572010-09-26 18:40:37 -0700255 void drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int32_t* yDivs,
Romain Guy4bb94202010-10-12 15:59:26 -0700256 const uint32_t* colors, uint32_t width, uint32_t height, int8_t numColors,
Chet Haase5c13d892010-10-08 08:37:55 -0700257 float left, float top, float right, float bottom, SkPaint* paint);
Romain Guy4aa90572010-09-26 18:40:37 -0700258 void drawColor(int color, SkXfermode::Mode mode);
Chet Haase5c13d892010-10-08 08:37:55 -0700259 void drawRect(float left, float top, float right, float bottom, SkPaint* paint);
Romain Guy01d58e42011-01-19 21:54:02 -0800260 void drawRoundRect(float left, float top, float right, float bottom,
261 float rx, float ry, SkPaint* paint);
262 void drawCircle(float x, float y, float radius, SkPaint* paint);
Romain Guyc1cd9ba32011-01-23 14:18:41 -0800263 void drawOval(float left, float top, float right, float bottom, SkPaint* paint);
Romain Guy8b2f5262011-01-23 16:15:02 -0800264 void drawArc(float left, float top, float right, float bottom,
265 float startAngle, float sweepAngle, bool useCenter, SkPaint* paint);
Romain Guy4aa90572010-09-26 18:40:37 -0700266 void drawPath(SkPath* path, SkPaint* paint);
Chet Haase5c13d892010-10-08 08:37:55 -0700267 void drawLines(float* points, int count, SkPaint* paint);
Romain Guy4aa90572010-09-26 18:40:37 -0700268 void drawText(const char* text, int bytesCount, int count, float x, float y, SkPaint* paint);
269
270 void resetShader();
271 void setupShader(SkiaShader* shader);
272
273 void resetColorFilter();
274 void setupColorFilter(SkiaColorFilter* filter);
275
276 void resetShadow();
277 void setupShadow(float radius, float dx, float dy, int color);
278
279 void reset();
280
Romain Guyb051e892010-09-28 19:09:36 -0700281 const SkWriter32& writeStream() const {
282 return mWriter;
283 }
284
Chet Haase5c13d892010-10-08 08:37:55 -0700285 const Vector<SkBitmap*>& getBitmapResources() const {
286 return mBitmapResources;
Romain Guyb051e892010-09-28 19:09:36 -0700287 }
288
Romain Guy24c00212011-01-14 15:31:00 -0800289 const Vector<SkiaShader*>& getShaders() const {
290 return mShaders;
Romain Guyb051e892010-09-28 19:09:36 -0700291 }
292
Chet Haased98aa2d2010-10-25 15:47:32 -0700293 const Vector<SkPaint*>& getPaints() const {
294 return mPaints;
295 }
296
Romain Guy2fc941e2011-02-03 15:06:05 -0800297 const Vector<SkPath*>& getPaths() const {
298 return mPaths;
299 }
300
Chet Haase5a7e8282011-02-04 12:50:55 -0800301 const Vector<SkPath*>& getOriginalPaths() const {
302 return mOriginalPaths;
303 }
304
Chet Haased98aa2d2010-10-25 15:47:32 -0700305 const Vector<SkMatrix*>& getMatrices() const {
306 return mMatrices;
307 }
308
Chet Haasead93c2b2010-10-22 16:17:12 -0700309 const Vector<SkiaColorFilter*>& getFilterResources() const {
310 return mFilterResources;
311 }
312
Romain Guy4aa90572010-09-26 18:40:37 -0700313private:
Romain Guy27454a42011-01-23 12:01:41 -0800314 void insertRestoreToCount() {
315 if (mRestoreSaveCount >= 0) {
316 mWriter.writeInt(DisplayList::RestoreToCount);
317 addInt(mRestoreSaveCount);
318 mRestoreSaveCount = -1;
319 }
320 }
321
Romain Guyb051e892010-09-28 19:09:36 -0700322 inline void addOp(DisplayList::Op drawOp) {
Romain Guy27454a42011-01-23 12:01:41 -0800323 insertRestoreToCount();
Romain Guy4aa90572010-09-26 18:40:37 -0700324 mWriter.writeInt(drawOp);
325 }
326
327 inline void addInt(int value) {
328 mWriter.writeInt(value);
329 }
330
Romain Guy7b5b6ab2011-03-14 18:05:08 -0700331 inline void addSize(uint32_t w, uint32_t h) {
332 mWriter.writeInt(w);
333 mWriter.writeInt(h);
334 }
335
Romain Guy4aa90572010-09-26 18:40:37 -0700336 void addInts(const int32_t* values, uint32_t count) {
Romain Guyb051e892010-09-28 19:09:36 -0700337 mWriter.writeInt(count);
Romain Guy4aa90572010-09-26 18:40:37 -0700338 for (uint32_t i = 0; i < count; i++) {
339 mWriter.writeInt(values[i]);
340 }
341 }
342
Romain Guy4bb94202010-10-12 15:59:26 -0700343 void addUInts(const uint32_t* values, int8_t count) {
344 mWriter.writeInt(count);
345 for (int8_t i = 0; i < count; i++) {
346 mWriter.writeInt(values[i]);
347 }
348 }
349
Romain Guy4aa90572010-09-26 18:40:37 -0700350 inline void addFloat(float value) {
351 mWriter.writeScalar(value);
352 }
353
354 void addFloats(const float* values, int count) {
Romain Guyb051e892010-09-28 19:09:36 -0700355 mWriter.writeInt(count);
Romain Guy4aa90572010-09-26 18:40:37 -0700356 for (int i = 0; i < count; i++) {
357 mWriter.writeScalar(values[i]);
358 }
359 }
360
361 inline void addPoint(float x, float y) {
362 mWriter.writeScalar(x);
363 mWriter.writeScalar(y);
364 }
365
366 inline void addBounds(float left, float top, float right, float bottom) {
367 mWriter.writeScalar(left);
368 mWriter.writeScalar(top);
369 mWriter.writeScalar(right);
370 mWriter.writeScalar(bottom);
371 }
372
373 inline void addText(const void* text, size_t byteLength) {
374 mWriter.writeInt(byteLength);
375 mWriter.writePad(text, byteLength);
376 }
377
Romain Guy2fc941e2011-02-03 15:06:05 -0800378 inline void addPath(SkPath* path) {
379 if (!path) {
380 addInt((int) NULL);
381 return;
Romain Guy4aa90572010-09-26 18:40:37 -0700382 }
Romain Guy2fc941e2011-02-03 15:06:05 -0800383
384 SkPath* pathCopy = mPathMap.valueFor(path);
385 if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) {
386 if (pathCopy == NULL) {
387 pathCopy = path;
Chet Haase5a7e8282011-02-04 12:50:55 -0800388 mOriginalPaths.add(path);
389 Caches& caches = Caches::getInstance();
390 caches.resourceCache.incrementRefcount(path);
Romain Guy2fc941e2011-02-03 15:06:05 -0800391 } else {
392 pathCopy = new SkPath(*path);
393 mPaths.add(pathCopy);
394 }
395 mPathMap.add(path, pathCopy);
396 }
397
398 addInt((int) pathCopy);
Romain Guy4aa90572010-09-26 18:40:37 -0700399 }
400
Chet Haase5c13d892010-10-08 08:37:55 -0700401 inline void addPaint(SkPaint* paint) {
Romain Guy24c00212011-01-14 15:31:00 -0800402 if (!paint) {
Romain Guy0fe478e2010-11-08 12:08:41 -0800403 addInt((int) NULL);
Chet Haased98aa2d2010-10-25 15:47:32 -0700404 return;
405 }
Romain Guy0fe478e2010-11-08 12:08:41 -0800406
Romain Guy24c00212011-01-14 15:31:00 -0800407 SkPaint* paintCopy = mPaintMap.valueFor(paint);
Chet Haased98aa2d2010-10-25 15:47:32 -0700408 if (paintCopy == NULL || paintCopy->getGenerationID() != paint->getGenerationID()) {
409 paintCopy = new SkPaint(*paint);
410 mPaintMap.add(paint, paintCopy);
411 mPaints.add(paintCopy);
412 }
Romain Guy0fe478e2010-11-08 12:08:41 -0800413
414 addInt((int) paintCopy);
415 }
416
417 inline void addDisplayList(DisplayList* displayList) {
418 // TODO: To be safe, the display list should be ref-counted in the
419 // resources cache, but we rely on the caller (UI toolkit) to
420 // do the right thing for now
421 addInt((int) displayList);
Romain Guy4aa90572010-09-26 18:40:37 -0700422 }
423
Chet Haase5c13d892010-10-08 08:37:55 -0700424 inline void addMatrix(SkMatrix* matrix) {
Chet Haased98aa2d2010-10-25 15:47:32 -0700425 // Copying the matrix is cheap and prevents against the user changing the original
426 // matrix before the operation that uses it
427 addInt((int) new SkMatrix(*matrix));
Romain Guy4aa90572010-09-26 18:40:37 -0700428 }
429
Chet Haase5c13d892010-10-08 08:37:55 -0700430 inline void addBitmap(SkBitmap* bitmap) {
Chet Haased98aa2d2010-10-25 15:47:32 -0700431 // Note that this assumes the bitmap is immutable. There are cases this won't handle
432 // correctly, such as creating the bitmap from scratch, drawing with it, changing its
433 // contents, and drawing again. The only fix would be to always copy it the first time,
434 // which doesn't seem worth the extra cycles for this unlikely case.
Romain Guy0fe478e2010-11-08 12:08:41 -0800435 addInt((int) bitmap);
Chet Haase5c13d892010-10-08 08:37:55 -0700436 mBitmapResources.add(bitmap);
437 Caches& caches = Caches::getInstance();
438 caches.resourceCache.incrementRefcount(bitmap);
439 }
Romain Guy4aa90572010-09-26 18:40:37 -0700440
Chet Haase5c13d892010-10-08 08:37:55 -0700441 inline void addShader(SkiaShader* shader) {
Romain Guy24c00212011-01-14 15:31:00 -0800442 if (!shader) {
443 addInt((int) NULL);
444 return;
445 }
446
447 SkiaShader* shaderCopy = mShaderMap.valueFor(shader);
448 // TODO: We also need to handle generation ID changes in compose shaders
Romain Guy1f1fcb72011-01-14 15:37:54 -0800449 if (shaderCopy == NULL || shaderCopy->getGenerationId() != shader->getGenerationId()) {
Romain Guy24c00212011-01-14 15:31:00 -0800450 shaderCopy = shader->copy();
451 mShaderMap.add(shader, shaderCopy);
Romain Guy1f1fcb72011-01-14 15:37:54 -0800452 mShaders.add(shaderCopy);
Romain Guy43ccf462011-01-14 18:51:01 -0800453 Caches::getInstance().resourceCache.incrementRefcount(shaderCopy);
Romain Guy24c00212011-01-14 15:31:00 -0800454 }
455
456 addInt((int) shaderCopy);
Romain Guy4aa90572010-09-26 18:40:37 -0700457 }
458
Chet Haasead93c2b2010-10-22 16:17:12 -0700459 inline void addColorFilter(SkiaColorFilter* colorFilter) {
Romain Guy0fe478e2010-11-08 12:08:41 -0800460 addInt((int) colorFilter);
Chet Haasead93c2b2010-10-22 16:17:12 -0700461 mFilterResources.add(colorFilter);
462 Caches& caches = Caches::getInstance();
463 caches.resourceCache.incrementRefcount(colorFilter);
464 }
465
Chet Haase5c13d892010-10-08 08:37:55 -0700466 Vector<SkBitmap*> mBitmapResources;
Chet Haasead93c2b2010-10-22 16:17:12 -0700467 Vector<SkiaColorFilter*> mFilterResources;
Romain Guy4aa90572010-09-26 18:40:37 -0700468
Chet Haased98aa2d2010-10-25 15:47:32 -0700469 Vector<SkPaint*> mPaints;
Romain Guy0fe478e2010-11-08 12:08:41 -0800470 DefaultKeyedVector<SkPaint*, SkPaint*> mPaintMap;
Romain Guy24c00212011-01-14 15:31:00 -0800471
Chet Haase5a7e8282011-02-04 12:50:55 -0800472 Vector<SkPath*> mOriginalPaths;
Romain Guy2fc941e2011-02-03 15:06:05 -0800473 Vector<SkPath*> mPaths;
474 DefaultKeyedVector<SkPath*, SkPath*> mPathMap;
475
Romain Guy24c00212011-01-14 15:31:00 -0800476 Vector<SkiaShader*> mShaders;
477 DefaultKeyedVector<SkiaShader*, SkiaShader*> mShaderMap;
478
Chet Haased98aa2d2010-10-25 15:47:32 -0700479 Vector<SkMatrix*> mMatrices;
480
Romain Guy4aa90572010-09-26 18:40:37 -0700481 SkWriter32 mWriter;
482
Chet Haase5977baa2011-01-05 18:01:22 -0800483 DisplayList *mDisplayList;
484
Romain Guy27454a42011-01-23 12:01:41 -0800485 int mRestoreSaveCount;
486
Romain Guyb051e892010-09-28 19:09:36 -0700487 friend class DisplayList;
488
Romain Guy4aa90572010-09-26 18:40:37 -0700489}; // class DisplayListRenderer
490
491}; // namespace uirenderer
492}; // namespace android
493
Romain Guy5b3b3522010-10-27 18:57:51 -0700494#endif // ANDROID_HWUI_DISPLAY_LIST_RENDERER_H