Skip to content

Commit 6bcfe89

Browse files
chethaaseAndroid Git Automerger
authored andcommitted
am 0f8e402: Force invalidates on non-visible views. DO NOT MERGE
* commit '0f8e402e954c6e37102fa70f81a1d8ec47156338': Force invalidates on non-visible views. DO NOT MERGE
2 parents a9becd0 + 0f8e402 commit 6bcfe89

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

core/java/android/view/ViewGroup.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,21 +4100,23 @@ public ViewParent invalidateChildInParent(final int[] location, final Rect dirty
41004100
final int left = mLeft;
41014101
final int top = mTop;
41024102

4103-
if ((mGroupFlags & FLAG_CLIP_CHILDREN) != FLAG_CLIP_CHILDREN ||
4104-
dirty.intersect(0, 0, mRight - left, mBottom - top) ||
4105-
(mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) {
4106-
mPrivateFlags &= ~DRAWING_CACHE_VALID;
4107-
4108-
location[CHILD_LEFT_INDEX] = left;
4109-
location[CHILD_TOP_INDEX] = top;
4110-
4111-
if (mLayerType != LAYER_TYPE_NONE) {
4112-
mPrivateFlags |= INVALIDATED;
4113-
mLocalDirtyRect.union(dirty);
4103+
if ((mGroupFlags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) {
4104+
if (!dirty.intersect(0, 0, mRight - left, mBottom - top)) {
4105+
dirty.setEmpty();
41144106
}
4107+
}
4108+
mPrivateFlags &= ~DRAWING_CACHE_VALID;
4109+
4110+
location[CHILD_LEFT_INDEX] = left;
4111+
location[CHILD_TOP_INDEX] = top;
41154112

4116-
return mParent;
4113+
if (mLayerType != LAYER_TYPE_NONE) {
4114+
mPrivateFlags |= INVALIDATED;
4115+
mLocalDirtyRect.union(dirty);
41174116
}
4117+
4118+
return mParent;
4119+
41184120
} else {
41194121
mPrivateFlags &= ~DRAWN & ~DRAWING_CACHE_VALID;
41204122

core/java/android/view/ViewRootImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,8 @@ public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
870870
if (dirty == null) {
871871
invalidate();
872872
return null;
873+
} else if (dirty.isEmpty()) {
874+
return null;
873875
}
874876

875877
if (mCurScrollY != 0 || mTranslator != null) {

0 commit comments

Comments
 (0)