Merge "Import translations. DO NOT MERGE"
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 102b504..af5f474 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4036,21 +4036,23 @@
final int left = mLeft;
final int top = mTop;
- 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;
-
- location[CHILD_LEFT_INDEX] = left;
- location[CHILD_TOP_INDEX] = top;
-
- if (mLayerType != LAYER_TYPE_NONE) {
- mPrivateFlags |= INVALIDATED;
- mLocalDirtyRect.union(dirty);
+ if ((mGroupFlags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) {
+ if (!dirty.intersect(0, 0, mRight - left, mBottom - top)) {
+ dirty.setEmpty();
}
-
- return mParent;
}
+ mPrivateFlags &= ~DRAWING_CACHE_VALID;
+
+ location[CHILD_LEFT_INDEX] = left;
+ location[CHILD_TOP_INDEX] = top;
+
+ if (mLayerType != LAYER_TYPE_NONE) {
+ mPrivateFlags |= INVALIDATED;
+ mLocalDirtyRect.union(dirty);
+ }
+
+ return mParent;
+
} else {
mPrivateFlags &= ~DRAWN & ~DRAWING_CACHE_VALID;
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index e03c7d3..9798877 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -868,6 +868,8 @@
if (dirty == null) {
invalidate();
return null;
+ } else if (dirty.isEmpty()) {
+ return null;
}
if (mCurScrollY != 0 || mTranslator != null) {