diff options
| author | 2014-03-25 10:33:01 -0700 | |
|---|---|---|
| committer | 2014-03-25 16:03:48 -0700 | |
| commit | 8c271ca63b62061fd22cfee78fd6a574b44476fd (patch) | |
| tree | e4b6a9d863aec687273be89373d2fc432cf29c30 /libs/hwui/RenderProperties.h | |
| parent | 5e44cadfd69c210c11f80cfe599718617a0e6676 (diff) | |
Add private circular reveal API on View/RenderNode
Change-Id: I139c8e12b354083149a665f6768f3f6931a8dd15
Diffstat (limited to 'libs/hwui/RenderProperties.h')
| -rw-r--r-- | libs/hwui/RenderProperties.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h index 504196db6ff0..061e469abe3b 100644 --- a/libs/hwui/RenderProperties.h +++ b/libs/hwui/RenderProperties.h @@ -22,8 +22,10 @@ #include <SkCamera.h> #include <SkMatrix.h> +#include <SkRegion.h> #include "Rect.h" +#include "RevealClip.h" #include "Outline.h" #define TRANSLATION 0x0001 @@ -34,7 +36,6 @@ class SkBitmap; class SkPaint; -class SkRegion; namespace android { namespace uirenderer { @@ -415,6 +416,10 @@ public: return mPrimitiveFields.mOutline; } + const RevealClip& getRevealClip() const { + return mPrimitiveFields.mRevealClip; + } + bool getProjectBackwards() const { return mPrimitiveFields.mProjectBackwards; } @@ -423,10 +428,29 @@ public: ANDROID_API void updateMatrix(); + ANDROID_API void updateClipPath(); + + // signals that mComputedFields.mClipPath is up to date, and should be used for clipping + bool hasClippingPath() const { + return mPrimitiveFields.mOutline.willClip() || mPrimitiveFields.mRevealClip.willClip(); + } + + const SkPath* getClippingPath() const { + return hasClippingPath() ? mComputedFields.mClipPath : NULL; + } + + SkRegion::Op getClippingPathOp() const { + return mComputedFields.mClipPathOp; + } + Outline& mutableOutline() { return mPrimitiveFields.mOutline; } + RevealClip& mutableRevealClip() { + return mPrimitiveFields.mRevealClip; + } + private: void onTranslationUpdate() { mPrimitiveFields.mMatrixDirty = true; @@ -442,6 +466,7 @@ private: PrimitiveFields(); Outline mOutline; + RevealClip mRevealClip; bool mClipToBounds; bool mProjectBackwards; bool mProjectionReceiver; @@ -483,6 +508,8 @@ private: Matrix4* mTransformMatrix; Sk3DView* mTransformCamera; SkMatrix* mTransformMatrix3D; + SkPath* mClipPath; // TODO: remove this, create new ops for efficient/special case clipping + SkRegion::Op mClipPathOp; } mComputedFields; }; |