summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2013-04-22 11:11:39 -0700
committerChet Haase <chet@google.com>2013-04-22 11:11:39 -0700
commita4f14ebe29b9c1286badeb47da19af4df88250dd (patch)
tree03ba49f51c7b1292f94f9783e9f66cd45f241f5b
parent339ac85483145972da010ad34cbcb29ed70cb822 (diff)
downloadframeworks_base-a4f14ebe29b9c1286badeb47da19af4df88250dd.zip
frameworks_base-a4f14ebe29b9c1286badeb47da19af4df88250dd.tar.gz
frameworks_base-a4f14ebe29b9c1286badeb47da19af4df88250dd.tar.bz2
Expand invalidation rectangle when clipChildren == false
The current invalidation logic does not take into account the clipChildren flag. When this flag is set to false on a container (an uncommon but possible case), it is possible for views in the child hierarchy of the container to be draw outside of the container's bounds. But invalidations on that view hiearrchy can be clipped to the container's bounds, causing us to not redraw views outside of those bounds. Fix is to expand the dirty rect of an invalidation to encompass the complete bounds of any container with clipChildren==false. Issue #680037 Some transform combinations can leave old pixel values on the screen Change-Id: I426beee15d04145fac2f6b4203748ae309e392b4
-rw-r--r--core/java/android/view/ViewGroup.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 39bff68..c7ce999 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4279,6 +4279,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
FLAG_OPTIMIZE_INVALIDATE) {
dirty.offset(location[CHILD_LEFT_INDEX] - mScrollX,
location[CHILD_TOP_INDEX] - mScrollY);
+ if ((mGroupFlags & FLAG_CLIP_CHILDREN) == 0) {
+ dirty.union(0, 0, mRight - mLeft, mBottom - mTop);
+ }
final int left = mLeft;
final int top = mTop;
@@ -4378,6 +4381,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if ((mPrivateFlags & PFLAG_DRAWN) == PFLAG_DRAWN ||
(mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID) {
dirty.offset(left - mScrollX, top - mScrollY);
+ if ((mGroupFlags & FLAG_CLIP_CHILDREN) == 0) {
+ dirty.union(0, 0, mRight - mLeft, mBottom - mTop);
+ }
if ((mGroupFlags & FLAG_CLIP_CHILDREN) == 0 ||
dirty.intersect(0, 0, mRight - mLeft, mBottom - mTop)) {