2010-09-26 18:40:37 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2010-10-27 18:57:51 -07:00
|
|
|
#ifndef ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
|
|
|
|
#define ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2014-10-15 09:21:10 -04:00
|
|
|
#include <SkDrawFilter.h>
|
2010-09-26 18:40:37 -07:00
|
|
|
#include <SkMatrix.h>
|
|
|
|
#include <SkPaint.h>
|
|
|
|
#include <SkPath.h>
|
2014-10-15 15:46:42 -04:00
|
|
|
#include <SkRegion.h>
|
2014-10-15 09:21:10 -04:00
|
|
|
#include <SkTLazy.h>
|
2011-10-12 13:48:51 -07:00
|
|
|
#include <cutils/compiler.h>
|
|
|
|
|
2014-10-10 13:38:16 -04:00
|
|
|
#include "CanvasState.h"
|
2014-10-15 15:46:42 -04:00
|
|
|
#include "DisplayList.h"
|
2011-03-24 10:51:31 -07:00
|
|
|
#include "DisplayListLogBuffer.h"
|
2014-10-10 13:38:16 -04:00
|
|
|
#include "RenderNode.h"
|
|
|
|
#include "Renderer.h"
|
2010-09-26 18:40:37 -07:00
|
|
|
|
|
|
|
namespace android {
|
|
|
|
namespace uirenderer {
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Defines
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-01-13 17:21:49 -08:00
|
|
|
// Debug
|
|
|
|
#if DEBUG_DISPLAY_LIST
|
2011-12-20 16:23:08 +00:00
|
|
|
#define DISPLAY_LIST_LOGD(...) ALOGD(__VA_ARGS__)
|
2011-01-13 17:21:49 -08:00
|
|
|
#else
|
|
|
|
#define DISPLAY_LIST_LOGD(...)
|
|
|
|
#endif
|
|
|
|
|
2010-09-26 18:40:37 -07:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2010-09-28 19:09:36 -07:00
|
|
|
// Display list
|
2010-09-26 18:40:37 -07:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2013-02-04 16:16:33 -08:00
|
|
|
class DeferredDisplayList;
|
2012-11-26 18:30:17 -08:00
|
|
|
class DisplayListOp;
|
2014-10-15 15:46:42 -04:00
|
|
|
class DisplayListRenderer;
|
2012-11-26 18:30:17 -08:00
|
|
|
class DrawOp;
|
2014-10-15 15:46:42 -04:00
|
|
|
class RenderNode;
|
2012-11-26 18:30:17 -08:00
|
|
|
class StateOp;
|
|
|
|
|
2010-09-28 19:09:36 -07:00
|
|
|
/**
|
2014-01-01 14:45:21 -08:00
|
|
|
* Records drawing commands in a display list for later playback into an OpenGLRenderer.
|
2010-09-28 19:09:36 -07:00
|
|
|
*/
|
2014-10-10 13:38:16 -04:00
|
|
|
class ANDROID_API DisplayListRenderer: public Renderer, public CanvasStateClient {
|
2010-09-28 19:09:36 -07:00
|
|
|
public:
|
2014-06-23 13:13:08 -07:00
|
|
|
DisplayListRenderer();
|
2011-10-12 13:48:51 -07:00
|
|
|
virtual ~DisplayListRenderer();
|
2010-09-28 19:09:36 -07:00
|
|
|
|
2014-08-21 17:41:57 -07:00
|
|
|
void insertReorderBarrier(bool enableReorder);
|
|
|
|
|
2014-06-23 13:13:08 -07:00
|
|
|
DisplayListData* finishRecording();
|
2011-01-05 18:01:22 -08:00
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Frame state operations
|
|
|
|
// ----------------------------------------------------------------------------
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void prepareDirty(float left, float top, float right, float bottom, bool opaque);
|
2014-10-10 13:38:16 -04:00
|
|
|
virtual void prepare(bool opaque) {
|
|
|
|
prepareDirty(0.0f, 0.0f, mState.getWidth(), mState.getHeight(), opaque);
|
|
|
|
}
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual bool finish();
|
2011-10-12 13:48:51 -07:00
|
|
|
virtual void interrupt();
|
|
|
|
virtual void resume();
|
2011-01-10 14:10:36 -08:00
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Canvas state operations
|
|
|
|
// ----------------------------------------------------------------------------
|
2014-10-10 13:38:16 -04:00
|
|
|
virtual void setViewport(int width, int height) { mState.setViewport(width, height); }
|
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// Save (layer)
|
2014-10-10 13:38:16 -04:00
|
|
|
virtual int getSaveCount() const { return mState.getSaveCount(); }
|
2011-10-12 13:48:51 -07:00
|
|
|
virtual int save(int flags);
|
|
|
|
virtual void restore();
|
|
|
|
virtual void restoreToCount(int saveCount);
|
|
|
|
virtual int saveLayer(float left, float top, float right, float bottom,
|
2014-02-05 16:47:00 -05:00
|
|
|
const SkPaint* paint, int flags);
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// Matrix
|
2014-10-10 13:38:16 -04:00
|
|
|
virtual void getMatrix(SkMatrix* outMatrix) const { mState.getMatrix(outMatrix); }
|
|
|
|
|
2014-06-23 13:13:08 -07:00
|
|
|
virtual void translate(float dx, float dy, float dz = 0.0f);
|
2011-10-12 13:48:51 -07:00
|
|
|
virtual void rotate(float degrees);
|
|
|
|
virtual void scale(float sx, float sy);
|
|
|
|
virtual void skew(float sx, float sy);
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2013-12-10 12:28:58 -05:00
|
|
|
virtual void setMatrix(const SkMatrix& matrix);
|
|
|
|
virtual void concatMatrix(const SkMatrix& matrix);
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// Clip
|
2011-10-12 13:48:51 -07:00
|
|
|
virtual bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op);
|
2014-01-02 17:13:34 -08:00
|
|
|
virtual bool clipPath(const SkPath* path, SkRegion::Op op);
|
|
|
|
virtual bool clipRegion(const SkRegion* region, SkRegion::Op op);
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2014-10-15 09:21:10 -04:00
|
|
|
// Misc
|
|
|
|
virtual void setDrawFilter(SkDrawFilter* filter);
|
2014-10-10 13:38:16 -04:00
|
|
|
virtual const Rect& getLocalClipBounds() const { return mState.getLocalClipBounds(); }
|
|
|
|
const Rect& getRenderTargetClipBounds() const { return mState.getRenderTargetClipBounds(); }
|
|
|
|
virtual bool quickRejectConservative(float left, float top, float right, float bottom) const {
|
|
|
|
return mState.quickRejectConservative(left, top, right, bottom);
|
|
|
|
}
|
2013-12-30 15:32:54 -08:00
|
|
|
|
2014-06-23 13:13:08 -07:00
|
|
|
bool isCurrentTransformSimple() {
|
2014-10-10 13:38:16 -04:00
|
|
|
return mState.currentTransform()->isSimple();
|
2014-06-23 13:13:08 -07:00
|
|
|
}
|
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Canvas draw operations
|
|
|
|
// ----------------------------------------------------------------------------
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawColor(int color, SkXfermode::Mode mode);
|
2013-12-30 15:32:54 -08:00
|
|
|
|
|
|
|
// Bitmap-based
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawBitmap(const SkBitmap* bitmap, const SkPaint* paint);
|
|
|
|
virtual void drawBitmap(const SkBitmap* bitmap, float srcLeft, float srcTop,
|
2010-09-26 18:40:37 -07:00
|
|
|
float srcRight, float srcBottom, float dstLeft, float dstTop,
|
2014-01-02 17:13:34 -08:00
|
|
|
float dstRight, float dstBottom, const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawBitmapData(const SkBitmap* bitmap, const SkPaint* paint);
|
|
|
|
virtual void drawBitmapMesh(const SkBitmap* bitmap, int meshWidth, int meshHeight,
|
2014-01-02 17:13:34 -08:00
|
|
|
const float* vertices, const int* colors, const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawPatch(const SkBitmap* bitmap, const Res_png_9patch* patch,
|
2014-01-02 17:13:34 -08:00
|
|
|
float left, float top, float right, float bottom, const SkPaint* paint);
|
2013-12-30 15:32:54 -08:00
|
|
|
|
|
|
|
// Shapes
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawRect(float left, float top, float right, float bottom,
|
2014-01-02 17:13:34 -08:00
|
|
|
const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawRects(const float* rects, int count, const SkPaint* paint);
|
|
|
|
virtual void drawRoundRect(float left, float top, float right, float bottom,
|
2014-01-02 17:13:34 -08:00
|
|
|
float rx, float ry, const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawRoundRect(CanvasPropertyPrimitive* left, CanvasPropertyPrimitive* top,
|
2014-09-15 17:20:08 +02:00
|
|
|
CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom,
|
|
|
|
CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry,
|
|
|
|
CanvasPropertyPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawCircle(float x, float y, float radius, const SkPaint* paint);
|
|
|
|
virtual void drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y,
|
2014-05-01 21:27:37 -07:00
|
|
|
CanvasPropertyPrimitive* radius, CanvasPropertyPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawOval(float left, float top, float right, float bottom,
|
2014-01-02 17:13:34 -08:00
|
|
|
const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawArc(float left, float top, float right, float bottom,
|
2014-01-02 17:13:34 -08:00
|
|
|
float startAngle, float sweepAngle, bool useCenter, const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawPath(const SkPath* path, const SkPaint* paint);
|
|
|
|
virtual void drawLines(const float* points, int count, const SkPaint* paint);
|
|
|
|
virtual void drawPoints(const float* points, int count, const SkPaint* paint);
|
2013-12-30 15:32:54 -08:00
|
|
|
|
|
|
|
// Text
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawText(const char* text, int bytesCount, int count, float x, float y,
|
2014-01-02 17:13:34 -08:00
|
|
|
const float* positions, const SkPaint* paint, float totalAdvance, const Rect& bounds,
|
2013-12-30 15:32:54 -08:00
|
|
|
DrawOpMode drawOpMode = kDrawOpMode_Immediate);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawTextOnPath(const char* text, int bytesCount, int count, const SkPath* path,
|
2014-01-02 17:13:34 -08:00
|
|
|
float hOffset, float vOffset, const SkPaint* paint);
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawPosText(const char* text, int bytesCount, int count,
|
2014-01-02 17:13:34 -08:00
|
|
|
const float* positions, const SkPaint* paint);
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Canvas draw operations - special
|
|
|
|
// ----------------------------------------------------------------------------
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void drawLayer(Layer* layer, float x, float y);
|
|
|
|
virtual void drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t replayFlags);
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2013-12-30 15:32:54 -08:00
|
|
|
// TODO: rename for consistency
|
2014-09-08 11:26:26 -04:00
|
|
|
virtual void callDrawGLFunction(Functor* functor, Rect& dirty);
|
2012-01-23 17:09:05 -08:00
|
|
|
|
2014-07-16 15:12:15 -07:00
|
|
|
void setHighContrastText(bool highContrastText) {
|
|
|
|
mHighContrastText = highContrastText;
|
|
|
|
}
|
2014-10-10 13:38:16 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// CanvasState callbacks
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
virtual void onViewportInitialized() { }
|
|
|
|
virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored) { }
|
|
|
|
virtual GLuint onGetTargetFbo() const { return -1; }
|
|
|
|
|
2010-09-26 18:40:37 -07:00
|
|
|
private:
|
2014-10-10 13:38:16 -04:00
|
|
|
|
|
|
|
CanvasState mState;
|
|
|
|
|
2014-08-21 17:41:57 -07:00
|
|
|
enum DeferredBarrierType {
|
|
|
|
kBarrier_None,
|
|
|
|
kBarrier_InOrder,
|
|
|
|
kBarrier_OutOfOrder,
|
|
|
|
};
|
|
|
|
|
|
|
|
void flushRestoreToCount();
|
|
|
|
void flushTranslate();
|
|
|
|
void flushReorderBarrier();
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2012-11-26 18:30:17 -08:00
|
|
|
LinearAllocator& alloc() { return mDisplayListData->allocator; }
|
2014-08-08 18:42:51 -07:00
|
|
|
|
|
|
|
// Each method returns final index of op
|
2014-08-21 17:41:57 -07:00
|
|
|
size_t addOpAndUpdateChunk(DisplayListOp* op);
|
|
|
|
// flushes any deferred operations, and appends the op
|
|
|
|
size_t flushAndAddOp(DisplayListOp* op);
|
|
|
|
|
|
|
|
size_t addStateOp(StateOp* op);
|
|
|
|
size_t addDrawOp(DrawOp* op);
|
|
|
|
size_t addRenderNodeOp(DrawRenderNodeOp* op);
|
|
|
|
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2012-11-26 18:30:17 -08:00
|
|
|
template<class T>
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const T* refBuffer(const T* srcBuffer, int32_t count) {
|
|
|
|
if (!srcBuffer) return NULL;
|
|
|
|
|
2012-11-26 18:30:17 -08:00
|
|
|
T* dstBuffer = (T*) mDisplayListData->allocator.alloc(count * sizeof(T));
|
|
|
|
memcpy(dstBuffer, srcBuffer, count * sizeof(T));
|
|
|
|
return dstBuffer;
|
2010-09-26 18:40:37 -07:00
|
|
|
}
|
|
|
|
|
2012-11-26 18:30:17 -08:00
|
|
|
inline char* refText(const char* text, size_t byteLength) {
|
|
|
|
return (char*) refBuffer<uint8_t>((uint8_t*)text, byteLength);
|
2010-09-26 18:40:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const SkPath* refPath(const SkPath* path) {
|
2012-11-26 18:30:17 -08:00
|
|
|
if (!path) return NULL;
|
2011-02-03 15:06:05 -08:00
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
const SkPath* pathCopy = mPathMap.valueFor(path);
|
2011-02-03 15:06:05 -08:00
|
|
|
if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) {
|
2014-01-02 17:13:34 -08:00
|
|
|
SkPath* newPathCopy = new SkPath(*path);
|
|
|
|
newPathCopy->setSourcePath(path);
|
|
|
|
|
|
|
|
pathCopy = newPathCopy;
|
2012-02-21 18:32:32 -08:00
|
|
|
// replaceValueFor() performs an add if the entry doesn't exist
|
|
|
|
mPathMap.replaceValueFor(path, pathCopy);
|
2014-02-26 11:00:11 -08:00
|
|
|
mDisplayListData->paths.add(pathCopy);
|
2010-09-26 18:40:37 -07:00
|
|
|
}
|
2014-02-26 11:00:11 -08:00
|
|
|
if (mDisplayListData->sourcePaths.indexOf(path) < 0) {
|
2012-09-07 11:58:36 -07:00
|
|
|
mCaches.resourceCache.incrementRefcount(path);
|
2014-02-26 11:00:11 -08:00
|
|
|
mDisplayListData->sourcePaths.add(path);
|
2012-05-02 18:50:34 -07:00
|
|
|
}
|
2012-11-26 18:30:17 -08:00
|
|
|
return pathCopy;
|
2010-09-26 18:40:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const SkPaint* refPaint(const SkPaint* paint) {
|
2014-07-16 15:12:15 -07:00
|
|
|
if (!paint) return NULL;
|
2010-11-08 12:08:41 -08:00
|
|
|
|
2014-10-15 09:21:10 -04:00
|
|
|
// If there is a draw filter apply it here and store the modified paint
|
|
|
|
// so that we don't need to modify the paint every time we access it.
|
|
|
|
SkTLazy<SkPaint> filteredPaint;
|
|
|
|
if (mDrawFilter.get()) {
|
|
|
|
paint = filteredPaint.init();
|
|
|
|
mDrawFilter->filter(filteredPaint.get(), SkDrawFilter::kPaint_Type);
|
|
|
|
}
|
|
|
|
|
|
|
|
// compute the hash key for the paint and check the cache.
|
|
|
|
const uint32_t key = paint->getHash();
|
|
|
|
const SkPaint* cachedPaint = mPaintMap.valueFor(key);
|
|
|
|
// In the unlikely event that 2 unique paints have the same hash we do a
|
|
|
|
// object equality check to ensure we don't erroneously dedup them.
|
|
|
|
if (cachedPaint == NULL || *cachedPaint != *paint) {
|
|
|
|
cachedPaint = new SkPaint(*paint);
|
2012-02-21 18:32:32 -08:00
|
|
|
// replaceValueFor() performs an add if the entry doesn't exist
|
2014-10-15 09:21:10 -04:00
|
|
|
mPaintMap.replaceValueFor(key, cachedPaint);
|
|
|
|
mDisplayListData->paints.add(cachedPaint);
|
2010-10-25 15:47:32 -07:00
|
|
|
}
|
2010-11-08 12:08:41 -08:00
|
|
|
|
2014-10-15 09:21:10 -04:00
|
|
|
return cachedPaint;
|
2010-11-08 12:08:41 -08:00
|
|
|
}
|
|
|
|
|
2014-07-16 15:12:15 -07:00
|
|
|
inline SkPaint* copyPaint(const SkPaint* paint) {
|
|
|
|
if (!paint) return NULL;
|
|
|
|
SkPaint* paintCopy = new SkPaint(*paint);
|
|
|
|
mDisplayListData->paints.add(paintCopy);
|
|
|
|
|
|
|
|
return paintCopy;
|
|
|
|
}
|
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const SkRegion* refRegion(const SkRegion* region) {
|
2012-12-03 12:34:51 -08:00
|
|
|
if (!region) {
|
|
|
|
return region;
|
|
|
|
}
|
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
const SkRegion* regionCopy = mRegionMap.valueFor(region);
|
2012-12-03 12:34:51 -08:00
|
|
|
// TODO: Add generation ID to SkRegion
|
|
|
|
if (regionCopy == NULL) {
|
|
|
|
regionCopy = new SkRegion(*region);
|
|
|
|
// replaceValueFor() performs an add if the entry doesn't exist
|
|
|
|
mRegionMap.replaceValueFor(region, regionCopy);
|
2014-02-26 11:00:11 -08:00
|
|
|
mDisplayListData->regions.add(regionCopy);
|
2012-12-03 12:34:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
return regionCopy;
|
|
|
|
}
|
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const SkBitmap* refBitmap(const SkBitmap* bitmap) {
|
2010-10-25 15:47:32 -07:00
|
|
|
// Note that this assumes the bitmap is immutable. There are cases this won't handle
|
|
|
|
// correctly, such as creating the bitmap from scratch, drawing with it, changing its
|
|
|
|
// contents, and drawing again. The only fix would be to always copy it the first time,
|
|
|
|
// which doesn't seem worth the extra cycles for this unlikely case.
|
2014-02-26 11:00:11 -08:00
|
|
|
mDisplayListData->bitmapResources.add(bitmap);
|
2012-09-07 11:58:36 -07:00
|
|
|
mCaches.resourceCache.incrementRefcount(bitmap);
|
2012-11-26 18:30:17 -08:00
|
|
|
return bitmap;
|
2010-10-08 08:37:55 -07:00
|
|
|
}
|
2010-09-26 18:40:37 -07:00
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const SkBitmap* refBitmapData(const SkBitmap* bitmap) {
|
2014-02-26 11:00:11 -08:00
|
|
|
mDisplayListData->ownedBitmapResources.add(bitmap);
|
2012-09-07 11:58:36 -07:00
|
|
|
mCaches.resourceCache.incrementRefcount(bitmap);
|
2012-11-26 18:30:17 -08:00
|
|
|
return bitmap;
|
2012-05-15 11:10:01 -07:00
|
|
|
}
|
|
|
|
|
2014-01-02 17:13:34 -08:00
|
|
|
inline const Res_png_9patch* refPatch(const Res_png_9patch* patch) {
|
2014-02-26 11:00:11 -08:00
|
|
|
mDisplayListData->patchResources.add(patch);
|
2013-06-26 15:45:41 -07:00
|
|
|
mCaches.resourceCache.incrementRefcount(patch);
|
|
|
|
return patch;
|
|
|
|
}
|
|
|
|
|
2014-10-15 09:21:10 -04:00
|
|
|
DefaultKeyedVector<uint32_t, const SkPaint*> mPaintMap;
|
2014-01-02 17:13:34 -08:00
|
|
|
DefaultKeyedVector<const SkPath*, const SkPath*> mPathMap;
|
|
|
|
DefaultKeyedVector<const SkRegion*, const SkRegion*> mRegionMap;
|
2011-01-14 15:31:00 -08:00
|
|
|
|
2012-09-07 11:58:36 -07:00
|
|
|
Caches& mCaches;
|
2014-02-26 11:00:11 -08:00
|
|
|
DisplayListData* mDisplayListData;
|
2012-09-07 11:58:36 -07:00
|
|
|
|
2012-02-16 19:24:51 -08:00
|
|
|
float mTranslateX;
|
|
|
|
float mTranslateY;
|
2014-08-21 17:41:57 -07:00
|
|
|
bool mHasDeferredTranslate;
|
|
|
|
DeferredBarrierType mDeferredBarrierType;
|
2014-07-16 15:12:15 -07:00
|
|
|
bool mHighContrastText;
|
2012-09-27 17:55:46 -07:00
|
|
|
|
2014-03-05 16:37:35 -08:00
|
|
|
int mRestoreSaveCount;
|
|
|
|
|
2014-10-15 09:21:10 -04:00
|
|
|
SkAutoTUnref<SkDrawFilter> mDrawFilter;
|
|
|
|
|
2014-03-12 13:56:30 -07:00
|
|
|
friend class RenderNode;
|
2010-09-28 19:09:36 -07:00
|
|
|
|
2010-09-26 18:40:37 -07:00
|
|
|
}; // class DisplayListRenderer
|
|
|
|
|
|
|
|
}; // namespace uirenderer
|
|
|
|
}; // namespace android
|
|
|
|
|
2010-10-27 18:57:51 -07:00
|
|
|
#endif // ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
|