diff options
author | Chris Craik <ccraik@google.com> | 2014-07-29 12:50:14 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-07-30 17:15:50 +0000 |
commit | af4d04cab6d48ae0d6a5e79bd30f679af87abaad (patch) | |
tree | b1fe9d83f5ccc32b1e0db8f002d2d3035368dfac /libs/hwui/RevealClip.h | |
parent | 3d1856f4449f02a9a3bda06738c3eb83df96f88b (diff) |
Use RoundRect clipping for circle reveal animation
bug:16630975
Also, remove inverse clipping feature from reveal animator.
Change-Id: I770a4eb48cd123b0ca0f39d16a0f3eefd1be3653
Diffstat (limited to 'libs/hwui/RevealClip.h')
-rw-r--r-- | libs/hwui/RevealClip.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/libs/hwui/RevealClip.h b/libs/hwui/RevealClip.h index 07404cbffa50..a9600f18f9bf 100644 --- a/libs/hwui/RevealClip.h +++ b/libs/hwui/RevealClip.h @@ -27,14 +27,12 @@ class RevealClip { public: RevealClip() : mShouldClip(false) - , mInverseClip(false) , mX(0) , mY(0) , mRadius(0) {} - void set(bool shouldClip, bool inverseClip, float x, float y, float radius) { + void set(bool shouldClip, float x, float y, float radius) { mShouldClip = shouldClip; - mInverseClip = inverseClip; mX = x; mY = y; mRadius = radius; @@ -45,21 +43,15 @@ public: } } - bool hasConvexClip() const { - return mShouldClip && !mInverseClip; - } - - bool isInverseClip() const { - return mInverseClip; - } - bool willClip() const { return mShouldClip; } - float radius() const { - return mRadius; + void getBounds(Rect* outBounds) const { + outBounds->set(mX - mRadius, mY - mRadius, + mX + mRadius, mY + mRadius); } + float getRadius() const { return mRadius; } const SkPath* getPath() const { if (!mShouldClip) return NULL; @@ -69,7 +61,6 @@ public: private: bool mShouldClip; - bool mInverseClip; float mX; float mY; float mRadius; |