Private API to turn off anti-aliasing for VectorDrawable

Bug: 69322344
Test: visual inspection on VectorDrawableTest with AA off. Jagged edges
      that are otherwise smooth were spotted.

Change-Id: Ib2dfbd3a941be0b4ff92b8458346f8c8f5015a4b
This commit is contained in:
Doris Liu
2017-12-04 16:31:07 -08:00
parent aad6c9841c
commit 6b184d7a43
4 changed files with 30 additions and 2 deletions

View File

@@ -896,6 +896,13 @@ public class VectorDrawable extends Drawable {
return mVectorState.getNativeRenderer();
}
/**
* @hide
*/
public void setAntiAlias(boolean aa) {
nSetAntiAlias(mVectorState.mNativeTree.get(), aa);
}
static class VectorDrawableState extends ConstantState {
// Variables below need to be copied (deep copy if applicable) for mutation.
int[] mThemeAttrs;
@@ -2269,6 +2276,8 @@ public class VectorDrawable extends Drawable {
@FastNative
private static native float nGetRootAlpha(long rendererPtr);
@FastNative
private static native void nSetAntiAlias(long rendererPtr, boolean aa);
@FastNative
private static native void nSetAllowCaching(long rendererPtr, boolean allowCaching);
@FastNative