summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-02-24 21:22:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-02-24 21:22:24 +0000
commitbe85725e1ec0fc8a4e9dbcf5be222906b3861dc7 (patch)
treecb1259bfc3019bc0090d94613f04aaefb1c3af2b /core/java
parent0b1591c1e3823cef04218591b47210138f2856d1 (diff)
parentff641477a75b7318a936f048e2bd87a1ae114b98 (diff)
downloadframeworks_base-be85725e1ec0fc8a4e9dbcf5be222906b3861dc7.zip
frameworks_base-be85725e1ec0fc8a4e9dbcf5be222906b3861dc7.tar.gz
frameworks_base-be85725e1ec0fc8a4e9dbcf5be222906b3861dc7.tar.bz2
Merge "Damage IsolatedZVolume when shadows change"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/View.java35
1 files changed, 34 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 0665264..e9082c3 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -11554,6 +11554,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
receiver.damageInParent();
}
}
+
+ // Damage the entire IsolatedZVolume recieving this view's shadow.
+ if (getCastsShadow() && getTranslationZ() != 0) {
+ damageIsolatedZVolume();
+ }
}
}
@@ -11581,6 +11586,29 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
+ * Damage area of the screen covered by the current isolated Z volume
+ *
+ * This method will guarantee that any changes to shadows cast by a View
+ * are damaged on the screen for future redraw.
+ */
+ private void damageIsolatedZVolume() {
+ final AttachInfo ai = mAttachInfo;
+ if (ai != null) {
+ ViewParent p = getParent();
+ while (p != null) {
+ if (p instanceof ViewGroup) {
+ final ViewGroup vg = (ViewGroup) p;
+ if (vg.hasIsolatedZVolume()) {
+ vg.damageInParent();
+ return;
+ }
+ }
+ p = p.getParent();
+ }
+ }
+ }
+
+ /**
* Quick invalidation for View property changes (alpha, translationXY, etc.). We don't want to
* set any flags or handle all of the cases handled by the default invalidation methods.
* Instead, we just want to schedule a traversal in ViewRootImpl with the appropriate
@@ -11608,12 +11636,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
} else {
damageInParent();
}
+ if (invalidateParent && getCastsShadow() && getTranslationZ() != 0) {
+ damageIsolatedZVolume();
+ }
}
/**
* Tells the parent view to damage this view's bounds.
+ *
+ * @hide
*/
- private void damageInParent() {
+ protected void damageInParent() {
final AttachInfo ai = mAttachInfo;
final ViewParent p = mParent;
if (p != null && ai != null) {