summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Outline.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Outline.h')
-rw-r--r--libs/hwui/Outline.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/hwui/Outline.h b/libs/hwui/Outline.h
index 83426e8..6dacd5e 100644
--- a/libs/hwui/Outline.h
+++ b/libs/hwui/Outline.h
@@ -28,18 +28,20 @@ public:
Outline()
: mShouldClip(false)
, mType(kOutlineType_None)
- , mRadius(0) {}
+ , mRadius(0)
+ , mAlpha(0.0f) {}
- void setRoundRect(int left, int top, int right, int bottom, float radius) {
+ void setRoundRect(int left, int top, int right, int bottom, float radius, float alpha) {
mType = kOutlineType_RoundRect;
mBounds.set(left, top, right, bottom);
mRadius = radius;
mPath.reset();
mPath.addRoundRect(SkRect::MakeLTRB(left, top, right, bottom),
radius, radius);
+ mAlpha = alpha;
}
- void setConvexPath(const SkPath* outline) {
+ void setConvexPath(const SkPath* outline, float alpha) {
if (!outline) {
setEmpty();
return;
@@ -47,22 +49,29 @@ public:
mType = kOutlineType_ConvexPath;
mPath = *outline;
mBounds.set(outline->getBounds());
+ mAlpha = alpha;
}
void setEmpty() {
mType = kOutlineType_Empty;
mPath.reset();
+ mAlpha = 0.0f;
}
void setNone() {
mType = kOutlineType_None;
mPath.reset();
+ mAlpha = 0.0f;
}
bool isEmpty() const {
return mType == kOutlineType_Empty;
}
+ float getAlpha() const {
+ return mAlpha;
+ }
+
void setShouldClip(bool clip) {
mShouldClip = clip;
}
@@ -103,6 +112,7 @@ private:
OutlineType mType;
Rect mBounds;
float mRadius;
+ float mAlpha;
SkPath mPath;
};