summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-07-23 00:31:20 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-23 00:31:20 +0000
commit3a35c79230f052712b314d595ad0c57f86ad7f06 (patch)
tree9b1c1c4520ac6e37f5c0d1ec036e4753d3296cd8 /libs/hwui
parent355a14c2fa8273709b15b0ed9d6da13799fc21b2 (diff)
parentc403a3908940ff9c7436c0153f941bec693bb39d (diff)
downloadframeworks_base-3a35c79230f052712b314d595ad0c57f86ad7f06.zip
frameworks_base-3a35c79230f052712b314d595ad0c57f86ad7f06.tar.gz
frameworks_base-3a35c79230f052712b314d595ad0c57f86ad7f06.tar.bz2
am d93bb9e1: Merge "Make setter methods on Outline call setEmpty() based on params" into lmp-dev
* commit 'd93bb9e1ef18d6b91022adaa7e75d8846d64e8b4': Make setter methods on Outline call setEmpty() based on params
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/Outline.h18
-rw-r--r--libs/hwui/RenderNode.cpp19
2 files changed, 25 insertions, 12 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;
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index fe03806..3eb779f 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -581,7 +581,7 @@ void RenderNode::buildZSortedChildList(Vector<ZDrawRenderNodeOpPair>& zTranslate
template <class T>
void RenderNode::issueDrawShadowOperation(const Matrix4& transformFromParent, T& handler) {
- if (properties().getAlpha() <= 0.0f || properties().getOutline().isEmpty()) return;
+ if (properties().getAlpha() <= 0.0f || !properties().getOutline().getPath()) return;
mat4 shadowMatrixXY(transformFromParent);
applyViewPropertyTransforms(shadowMatrixXY);
@@ -776,16 +776,23 @@ void RenderNode::issueOperationsOfProjectedChildren(OpenGLRenderer& renderer, T&
*/
template <class T>
void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
+ const int level = handler.level();
+ if (mDisplayListData->isEmpty()) {
+ DISPLAY_LIST_LOGD("%*sEmpty display list (%p, %s)", level * 2, "", this, getName());
+ return;
+ }
+
const bool drawLayer = (mLayer && (&renderer != mLayer->renderer));
// If we are updating the contents of mLayer, we don't want to apply any of
// the RenderNode's properties to this issueOperations pass. Those will all
// be applied when the layer is drawn, aka when this is true.
const bool useViewProperties = (!mLayer || drawLayer);
-
- const int level = handler.level();
- if (mDisplayListData->isEmpty() || (useViewProperties && properties().getAlpha() <= 0)) {
- DISPLAY_LIST_LOGD("%*sEmpty display list (%p, %s)", level * 2, "", this, getName());
- return;
+ if (useViewProperties) {
+ const Outline& outline = properties().getOutline();
+ if (properties().getAlpha() <= 0 || (outline.getShouldClip() && outline.isEmpty())) {
+ DISPLAY_LIST_LOGD("%*sRejected display list (%p, %s)", level * 2, "", this, getName());
+ return;
+ }
}
handler.startMark(getName());