diff options
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/view/RenderNode.java | 10 | ||||
-rw-r--r-- | core/java/android/view/ViewOutlineProvider.java | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/core/java/android/view/RenderNode.java b/core/java/android/view/RenderNode.java index e9ec565..eee4973 100644 --- a/core/java/android/view/RenderNode.java +++ b/core/java/android/view/RenderNode.java @@ -355,9 +355,10 @@ public class RenderNode { return nSetOutlineEmpty(mNativeRenderNode); } else if (outline.mRect != null) { return nSetOutlineRoundRect(mNativeRenderNode, outline.mRect.left, outline.mRect.top, - outline.mRect.right, outline.mRect.bottom, outline.mRadius); + outline.mRect.right, outline.mRect.bottom, outline.mRadius, outline.mAlpha); } else if (outline.mPath != null) { - return nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath); + return nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath, + outline.mAlpha); } throw new IllegalArgumentException("Unrecognized outline?"); } @@ -849,8 +850,9 @@ public class RenderNode { private static native boolean nSetProjectBackwards(long renderNode, boolean shouldProject); private static native boolean nSetProjectionReceiver(long renderNode, boolean shouldRecieve); private static native boolean nSetOutlineRoundRect(long renderNode, int left, int top, - int right, int bottom, float radius); - private static native boolean nSetOutlineConvexPath(long renderNode, long nativePath); + int right, int bottom, float radius, float alpha); + private static native boolean nSetOutlineConvexPath(long renderNode, long nativePath, + float alpha); private static native boolean nSetOutlineEmpty(long renderNode); private static native boolean nSetOutlineNone(long renderNode); private static native boolean nSetClipToOutline(long renderNode, boolean clipToOutline); diff --git a/core/java/android/view/ViewOutlineProvider.java b/core/java/android/view/ViewOutlineProvider.java index 64624ae..4054031 100644 --- a/core/java/android/view/ViewOutlineProvider.java +++ b/core/java/android/view/ViewOutlineProvider.java @@ -25,7 +25,8 @@ import android.graphics.drawable.Drawable; public abstract class ViewOutlineProvider { /** * Default outline provider for Views, which queries the Outline from the View's background, - * or returns <code>false</code> if the View does not have a background. + * or generates a 0 alpha, rectangular Outline the size of the View if a background + * isn't present. * * @see Drawable#getOutline(Outline) */ @@ -35,6 +36,10 @@ public abstract class ViewOutlineProvider { Drawable background = view.getBackground(); if (background != null) { background.getOutline(outline); + } else { + + outline.setRect(0, 0, view.getWidth(), view.getHeight()); + outline.setAlpha(0.0f); } } }; |