Loading core/java/android/view/RenderNode.java +6 −4 Original line number Diff line number Diff line Loading @@ -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?"); } Loading Loading @@ -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); Loading core/java/android/view/ViewOutlineProvider.java +6 −1 Original line number Diff line number Diff line Loading @@ -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) */ Loading @@ -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); } } }; Loading core/java/com/android/internal/widget/ActionBarContainer.java +25 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,12 @@ package com.android.internal.widget; import android.annotation.NonNull; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Outline; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.ActionMode; Loading Loading @@ -324,17 +326,35 @@ public class ActionBarContainer extends FrameLayout { * projection surfaces. */ private class ActionBarBackgroundDrawable extends Drawable { @Override public void draw(Canvas canvas) { private Drawable getDrawable() { if (mIsSplit) { if (mSplitBackground != null) mSplitBackground.draw(canvas); if (mSplitBackground != null) { return mSplitBackground; } } else { if (mBackground != null) { mBackground.draw(canvas); return mBackground; } if (mStackedBackground != null && mIsStacked) { mStackedBackground.draw(canvas); return mStackedBackground; } } return null; } @Override public void draw(Canvas canvas) { final Drawable drawable = getDrawable(); if (drawable != null) { drawable.draw(canvas); } } @Override public void getOutline(@NonNull Outline outline) { final Drawable drawable = getDrawable(); if (drawable != null) { drawable.getOutline(outline); } } Loading core/jni/android/graphics/BitmapFactory.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -353,7 +353,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding ninePatchInsets = env->NewObject(gInsetStruct_class, gInsetStruct_constructorMethodID, peeker.mOpticalInsets[0], peeker.mOpticalInsets[1], peeker.mOpticalInsets[2], peeker.mOpticalInsets[3], peeker.mOutlineInsets[0], peeker.mOutlineInsets[1], peeker.mOutlineInsets[2], peeker.mOutlineInsets[3], peeker.mOutlineRadius, peeker.mOutlineFilled, scale); peeker.mOutlineRadius, peeker.mOutlineAlpha, scale); if (javaBitmap != NULL) { env->SetObjectField(javaBitmap, gBitmap_ninePatchInsetsFieldID, ninePatchInsets); } Loading Loading @@ -589,7 +589,7 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { "Landroid/graphics/NinePatch$InsetStruct;"); gInsetStruct_class = (jclass) env->NewGlobalRef(env->FindClass("android/graphics/NinePatch$InsetStruct")); gInsetStruct_constructorMethodID = env->GetMethodID(gInsetStruct_class, "<init>", "(IIIIIIIIFZF)V"); gInsetStruct_constructorMethodID = env->GetMethodID(gInsetStruct_class, "<init>", "(IIIIIIIIFIF)V"); int ret = AndroidRuntime::registerNativeMethods(env, "android/graphics/BitmapFactory$Options", Loading core/jni/android/graphics/NinePatchPeeker.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -48,11 +48,11 @@ bool NinePatchPeeker::peek(const char tag[], const void* data, size_t length) { } else if (!strcmp("npLb", tag) && length == sizeof(int32_t) * 4) { mHasInsets = true; memcpy(&mOpticalInsets, data, sizeof(int32_t) * 4); } else if (!strcmp("npOl", tag) && length == 24) { // 4 int32_ts, 1 float, 1 int32_t sized bool } else if (!strcmp("npOl", tag) && length == 24) { // 4 int32_ts, 1 float, 1 int32_t sized byte mHasInsets = true; memcpy(&mOutlineInsets, data, sizeof(int32_t) * 4); mOutlineRadius = ((const float*)data)[4]; mOutlineFilled = ((const int32_t*)data)[5] & 0x01; mOutlineAlpha = ((const int32_t*)data)[5] & 0xff; } return true; // keep on decoding } Loading
core/java/android/view/RenderNode.java +6 −4 Original line number Diff line number Diff line Loading @@ -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?"); } Loading Loading @@ -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); Loading
core/java/android/view/ViewOutlineProvider.java +6 −1 Original line number Diff line number Diff line Loading @@ -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) */ Loading @@ -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); } } }; Loading
core/java/com/android/internal/widget/ActionBarContainer.java +25 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,12 @@ package com.android.internal.widget; import android.annotation.NonNull; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Outline; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.ActionMode; Loading Loading @@ -324,17 +326,35 @@ public class ActionBarContainer extends FrameLayout { * projection surfaces. */ private class ActionBarBackgroundDrawable extends Drawable { @Override public void draw(Canvas canvas) { private Drawable getDrawable() { if (mIsSplit) { if (mSplitBackground != null) mSplitBackground.draw(canvas); if (mSplitBackground != null) { return mSplitBackground; } } else { if (mBackground != null) { mBackground.draw(canvas); return mBackground; } if (mStackedBackground != null && mIsStacked) { mStackedBackground.draw(canvas); return mStackedBackground; } } return null; } @Override public void draw(Canvas canvas) { final Drawable drawable = getDrawable(); if (drawable != null) { drawable.draw(canvas); } } @Override public void getOutline(@NonNull Outline outline) { final Drawable drawable = getDrawable(); if (drawable != null) { drawable.getOutline(outline); } } Loading
core/jni/android/graphics/BitmapFactory.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -353,7 +353,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding ninePatchInsets = env->NewObject(gInsetStruct_class, gInsetStruct_constructorMethodID, peeker.mOpticalInsets[0], peeker.mOpticalInsets[1], peeker.mOpticalInsets[2], peeker.mOpticalInsets[3], peeker.mOutlineInsets[0], peeker.mOutlineInsets[1], peeker.mOutlineInsets[2], peeker.mOutlineInsets[3], peeker.mOutlineRadius, peeker.mOutlineFilled, scale); peeker.mOutlineRadius, peeker.mOutlineAlpha, scale); if (javaBitmap != NULL) { env->SetObjectField(javaBitmap, gBitmap_ninePatchInsetsFieldID, ninePatchInsets); } Loading Loading @@ -589,7 +589,7 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { "Landroid/graphics/NinePatch$InsetStruct;"); gInsetStruct_class = (jclass) env->NewGlobalRef(env->FindClass("android/graphics/NinePatch$InsetStruct")); gInsetStruct_constructorMethodID = env->GetMethodID(gInsetStruct_class, "<init>", "(IIIIIIIIFZF)V"); gInsetStruct_constructorMethodID = env->GetMethodID(gInsetStruct_class, "<init>", "(IIIIIIIIFIF)V"); int ret = AndroidRuntime::registerNativeMethods(env, "android/graphics/BitmapFactory$Options", Loading
core/jni/android/graphics/NinePatchPeeker.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -48,11 +48,11 @@ bool NinePatchPeeker::peek(const char tag[], const void* data, size_t length) { } else if (!strcmp("npLb", tag) && length == sizeof(int32_t) * 4) { mHasInsets = true; memcpy(&mOpticalInsets, data, sizeof(int32_t) * 4); } else if (!strcmp("npOl", tag) && length == 24) { // 4 int32_ts, 1 float, 1 int32_t sized bool } else if (!strcmp("npOl", tag) && length == 24) { // 4 int32_ts, 1 float, 1 int32_t sized byte mHasInsets = true; memcpy(&mOutlineInsets, data, sizeof(int32_t) * 4); mOutlineRadius = ((const float*)data)[4]; mOutlineFilled = ((const int32_t*)data)[5] & 0x01; mOutlineAlpha = ((const int32_t*)data)[5] & 0xff; } return true; // keep on decoding }