diff options
| author | Chris Craik <ccraik@google.com> | 2014-05-05 19:09:33 -0700 |
|---|---|---|
| committer | Chris Craik <ccraik@google.com> | 2014-05-15 16:36:12 -0700 |
| commit | deeda3d337aed1eee218b89a7aba5992ced371f0 (patch) | |
| tree | 15e13e84727baebce58b735e34ef5d198fd84389 /core/java/android | |
| parent | fe4c1e225d147fe9cb5d7c121b7d6d11a312844e (diff) | |
Round rect outline clipping
Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/RenderNode.java | 5 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/core/java/android/view/RenderNode.java b/core/java/android/view/RenderNode.java index 0cfde94f2413..b2839cbcee6c 100644 --- a/core/java/android/view/RenderNode.java +++ b/core/java/android/view/RenderNode.java @@ -387,6 +387,10 @@ public class RenderNode { nSetClipToOutline(mNativeRenderNode, clipToOutline); } + public boolean getClipToOutline() { + return nGetClipToOutline(mNativeRenderNode); + } + /** * Controls the RenderNode's circular reveal clip. */ @@ -919,6 +923,7 @@ public class RenderNode { private static native void nSetAnimationMatrix(long renderNode, long animationMatrix); private static native boolean nHasOverlappingRendering(long renderNode); + private static native boolean nGetClipToOutline(long renderNode); private static native float nGetAlpha(long renderNode); private static native float nGetLeft(long renderNode); private static native float nGetTop(long renderNode); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index e829141ad18e..83bb59781575 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -10696,9 +10696,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mRenderNode.setOutline(mOutline); } - // TODO: remove - public final boolean getClipToOutline() { return false; } - public void setClipToOutline(boolean clipToOutline) {} + public final boolean getClipToOutline() { + return mRenderNode.getClipToOutline(); + } + + public void setClipToOutline(boolean clipToOutline) { + // TODO: add a fast invalidation here + if (getClipToOutline() != clipToOutline) { + mRenderNode.setClipToOutline(clipToOutline); + } + } private void queryOutlineFromBackgroundIfUndefined() { if ((mPrivateFlags3 & PFLAG3_OUTLINE_DEFINED) == 0) { @@ -10707,7 +10714,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mOutline = new Outline(); } else { //invalidate outline, to ensure background calculates it - mOutline.set(null); + mOutline.reset(); } if (mBackground.getOutline(mOutline)) { if (!mOutline.isValid()) { |
