summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-04-15 16:18:08 -0700
committerChris Craik <ccraik@google.com>2014-04-23 16:15:11 -0700
commit3f085429fd47ebd32ac2463b3eae2a5a6c17be25 (patch)
tree2930b7ee50ce98092fde97546a3d546c817038f1 /graphics
parentfbb54b8363b66e0b22d519ee20d1a50e8b5340ee (diff)
downloadframeworks_base-3f085429fd47ebd32ac2463b3eae2a5a6c17be25.zip
frameworks_base-3f085429fd47ebd32ac2463b3eae2a5a6c17be25.tar.gz
frameworks_base-3f085429fd47ebd32ac2463b3eae2a5a6c17be25.tar.bz2
Clip TouchFeedbackDrawable effect to receiver Outline
Projected RenderNodes are now wrapped with a ClipRect or masked SaveLayer, so that they are clipped to the outline of the projection receiver surface. Change-Id: I1d4afc1bb5d638d650bc0b1dac51a498f216773e
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java b/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java
index 5f59467..792d62a 100644
--- a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java
+++ b/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java
@@ -362,8 +362,7 @@ public class TouchFeedbackDrawable extends LayerDrawable {
// first. This will merge SRC_OVER (directly) onto the canvas.
if (!projected && rippleRestoreCount < 0) {
rippleRestoreCount = canvas.saveLayer(bounds.left, bounds.top,
- bounds.right, bounds.bottom, null, 0);
- canvas.clipRect(bounds);
+ bounds.right, bounds.bottom, null);
}
drewRipples |= ripple.draw(canvas, getRipplePaint());
@@ -381,7 +380,7 @@ public class TouchFeedbackDrawable extends LayerDrawable {
if (drewRipples && !projected && rippleRestoreCount >= 0) {
final PorterDuffXfermode xfermode = mState.getTintXfermode();
canvas.saveLayer(bounds.left, bounds.top,
- bounds.right, bounds.bottom, getMaskingPaint(xfermode), 0);
+ bounds.right, bounds.bottom, getMaskingPaint(xfermode));
}
Drawable mask = null;
@@ -399,7 +398,7 @@ public class TouchFeedbackDrawable extends LayerDrawable {
if (mask != null && drewRipples) {
// TODO: This will also mask the lower layer, which is bad.
canvas.saveLayer(bounds.left, bounds.top, bounds.right,
- bounds.bottom, getMaskingPaint(DST_IN), 0);
+ bounds.bottom, getMaskingPaint(DST_IN));
mask.draw(canvas);
}