summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Outline.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-07-21 10:25:54 -0700
committerChris Craik <ccraik@google.com>2014-07-22 15:15:11 -0700
commit0645128b80621edee70f8cab4afb208fe0c26bec (patch)
tree8c12a055a0231303726cf2b6724b5b7264ca7357 /libs/hwui/Outline.h
parent94ca6cd7c932689b8018d1b118ddcd6b7a9eab27 (diff)
downloadframeworks_base-0645128b80621edee70f8cab4afb208fe0c26bec.zip
frameworks_base-0645128b80621edee70f8cab4afb208fe0c26bec.tar.gz
frameworks_base-0645128b80621edee70f8cab4afb208fe0c26bec.tar.bz2
Make setter methods on Outline call setEmpty() based on params
bug:16142564 Additionally, better define behavior around null outline providers: A view with an empty outline, and setClipToOutline=true will not be rendered, though one with a null outline provider (and thus no outline) will be. Change-Id: Ic9549841b107b2eb51b417c66058a0cd69dd89eb
Diffstat (limited to 'libs/hwui/Outline.h')
-rw-r--r--libs/hwui/Outline.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/hwui/Outline.h b/libs/hwui/Outline.h
index 024bdfd..83426e8 100644
--- a/libs/hwui/Outline.h
+++ b/libs/hwui/Outline.h
@@ -49,15 +49,20 @@ public:
mBounds.set(outline->getBounds());
}
- bool isEmpty() const {
- return mType == kOutlineType_None;
+ void setEmpty() {
+ mType = kOutlineType_Empty;
+ mPath.reset();
}
- void setEmpty() {
+ void setNone() {
mType = kOutlineType_None;
mPath.reset();
}
+ bool isEmpty() const {
+ return mType == kOutlineType_Empty;
+ }
+
void setShouldClip(bool clip) {
mShouldClip = clip;
}
@@ -81,7 +86,7 @@ public:
}
const SkPath* getPath() const {
- if (mType == kOutlineType_None) return NULL;
+ if (mType == kOutlineType_None || mType == kOutlineType_Empty) return NULL;
return &mPath;
}
@@ -89,8 +94,9 @@ public:
private:
enum OutlineType {
kOutlineType_None = 0,
- kOutlineType_ConvexPath = 1,
- kOutlineType_RoundRect = 2
+ kOutlineType_Empty = 1,
+ kOutlineType_ConvexPath = 2,
+ kOutlineType_RoundRect = 3
};
bool mShouldClip;