diff options
| author | 2015-09-02 14:23:49 -0700 | |
|---|---|---|
| committer | 2015-09-02 15:15:56 -0700 | |
| commit | 64e445bf74bee2098781d608cedfd723d8cc88d3 (patch) | |
| tree | 2a2d3727a8feff2470bc648f02a72c3cd7ae665a /libs/hwui/CanvasState.h | |
| parent | 9557106c6f84640382a068997b1fc125099d6019 (diff) | |
CanvasState frame init refactor
bug:23760482
Change-Id: Idc0802b4b8a6a3cebd20797350f4eb01bcc3fe77
Diffstat (limited to 'libs/hwui/CanvasState.h')
| -rw-r--r-- | libs/hwui/CanvasState.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libs/hwui/CanvasState.h b/libs/hwui/CanvasState.h index b35db28eaf82..f0fb9ba8b324 100644 --- a/libs/hwui/CanvasState.h +++ b/libs/hwui/CanvasState.h @@ -71,20 +71,18 @@ public: * (getClip/Matrix), but so that quickRejection can also be used. */ -class ANDROID_API CanvasState { +class CanvasState { public: CanvasState(CanvasStateClient& renderer); - ~CanvasState(); /** * Initializes the first snapshot, computing the projection matrix, * and stores the dimensions of the render target. */ - void initializeSaveStack(float clipLeft, float clipTop, float clipRight, float clipBottom, + void initializeSaveStack(int viewportWidth, int viewportHeight, + float clipLeft, float clipTop, float clipRight, float clipBottom, const Vector3& lightCenter); - void setViewport(int width, int height); - bool hasRectToRectTransform() const { return CC_LIKELY(currentTransform()->rectToRect()); } @@ -159,16 +157,11 @@ public: int getHeight() const { return mHeight; } bool clipIsSimple() const { return currentSnapshot()->clipIsSimple(); } - inline const Snapshot* currentSnapshot() const { - return mSnapshot != nullptr ? mSnapshot.get() : mFirstSnapshot.get(); - } + inline const Snapshot* currentSnapshot() const { return mSnapshot.get(); } inline Snapshot* writableSnapshot() { return mSnapshot.get(); } inline const Snapshot* firstSnapshot() const { return mFirstSnapshot.get(); } private: - /// No default constructor - must supply a CanvasStateClient (mCanvas). - CanvasState(); - /// indicates that the clip has been changed since the last time it was consumed bool mDirtyClip; |