diff options
Diffstat (limited to 'libs/hwui/DisplayListRenderer.h')
-rw-r--r-- | libs/hwui/DisplayListRenderer.h | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h index dff4f6c..8ca9af1 100644 --- a/libs/hwui/DisplayListRenderer.h +++ b/libs/hwui/DisplayListRenderer.h @@ -23,7 +23,6 @@ #include <cutils/compiler.h> #include "DisplayListLogBuffer.h" -#include "OpenGLRenderer.h" #include "RenderNode.h" namespace android { @@ -53,12 +52,12 @@ class StateOp; /** * Records drawing commands in a display list for later playback into an OpenGLRenderer. */ -class DisplayListRenderer: public OpenGLRenderer { +class ANDROID_API DisplayListRenderer: public StatefulBaseRenderer { public: - ANDROID_API DisplayListRenderer(); + DisplayListRenderer(); virtual ~DisplayListRenderer(); - ANDROID_API DisplayListData* finishRecording(); + DisplayListData* finishRecording(); virtual bool isRecording() const { return true; } @@ -81,13 +80,13 @@ public: const SkPaint* paint, int flags); // Matrix - virtual void translate(float dx, float dy, float dz); + virtual void translate(float dx, float dy, float dz = 0.0f); virtual void rotate(float degrees); virtual void scale(float sx, float sy); virtual void skew(float sx, float sy); - virtual void setMatrix(const SkMatrix* matrix); - virtual void concatMatrix(const SkMatrix* matrix); + virtual void setMatrix(const SkMatrix& matrix); + virtual void concatMatrix(const SkMatrix& matrix); // Clip virtual bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op); @@ -98,6 +97,10 @@ public: virtual void resetPaintFilter(); virtual void setupPaintFilter(int clearBits, int setBits); + bool isCurrentTransformSimple() { + return currentTransform()->isSimple(); + } + // ---------------------------------------------------------------------------- // Canvas draw operations // ---------------------------------------------------------------------------- @@ -106,7 +109,7 @@ public: // Bitmap-based virtual status_t drawBitmap(const SkBitmap* bitmap, float left, float top, const SkPaint* paint); - virtual status_t drawBitmap(const SkBitmap* bitmap, const SkMatrix* matrix, + virtual status_t drawBitmap(const SkBitmap* bitmap, const SkMatrix& matrix, const SkPaint* paint); virtual status_t drawBitmap(const SkBitmap* bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, @@ -148,16 +151,10 @@ public: // Canvas draw operations - special // ---------------------------------------------------------------------------- virtual status_t drawLayer(Layer* layer, float x, float y); - virtual status_t drawDisplayList(RenderNode* displayList, Rect& dirty, - int32_t replayFlags); + virtual status_t drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t replayFlags); // TODO: rename for consistency virtual status_t callDrawGLFunction(Functor* functor, Rect& dirty); -protected: - // NOTE: must override these to avoid calling into super class, which calls GL. These may be - // removed once DisplayListRenderer no longer inherits from OpenGLRenderer - virtual void onViewportInitialized() {}; - virtual void onSnapshotRestored() {}; private: void insertRestoreToCount(); @@ -238,17 +235,6 @@ private: return regionCopy; } - inline const SkMatrix* refMatrix(const SkMatrix* matrix) { - if (matrix) { - // Copying the matrix is cheap and prevents against the user changing - // the original matrix before the operation that uses it - const SkMatrix* copy = new SkMatrix(*matrix); - mDisplayListData->matrices.add(copy); - return copy; - } - return matrix; - } - inline Layer* refLayer(Layer* layer) { mDisplayListData->layers.add(layer); mCaches.resourceCache.incrementRefcount(layer); |