diff options
author | Chet Haase <chet@google.com> | 2011-07-19 10:36:05 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2011-07-19 10:53:36 -0700 |
commit | a3db866056adb01820bbd6389d20fc550be87eb3 (patch) | |
tree | a653ecccafc525b0dd7f3b46f3e8a3a538f6feb9 | |
parent | 49840e255beed794c1240b230b4d824520933fa1 (diff) | |
download | frameworks_base-a3db866056adb01820bbd6389d20fc550be87eb3.zip frameworks_base-a3db866056adb01820bbd6389d20fc550be87eb3.tar.gz frameworks_base-a3db866056adb01820bbd6389d20fc550be87eb3.tar.bz2 |
Don't constrain invalidation rect when not clipping children
View.setClipChidlren(false) allows children to draw outside of their containers.
But logic in ViewGroup.invalidateChildInParent() constrains the invalidation
rectangle to the bounds of the parent, making the flag useless in some situations.
Avoid intersecting the dirty rect with the parent bounds when the parent
is set to not clip its children.
Change-Id: Icc485b539758c96da0bd62ef57974a1bcb94f866
-rw-r--r-- | core/java/android/view/ViewGroup.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index cb3e9c6..c333c0a 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3960,7 +3960,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final int left = mLeft; final int top = mTop; - if (dirty.intersect(0, 0, mRight - left, mBottom - top) || + if ((mGroupFlags & FLAG_CLIP_CHILDREN) != FLAG_CLIP_CHILDREN || + dirty.intersect(0, 0, mRight - left, mBottom - top) || (mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) { mPrivateFlags &= ~DRAWING_CACHE_VALID; @@ -3978,8 +3979,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager location[CHILD_LEFT_INDEX] = mLeft; location[CHILD_TOP_INDEX] = mTop; - - dirty.set(0, 0, mRight - mLeft, mBottom - mTop); + if ((mGroupFlags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) { + dirty.set(0, 0, mRight - mLeft, mBottom - mTop); + } else { + // in case the dirty rect extends outside the bounds of this container + dirty.union(0, 0, mRight - mLeft, mBottom - mTop); + } if (mLayerType != LAYER_TYPE_NONE) { mLocalDirtyRect.union(dirty); |