diff options
Diffstat (limited to 'support')
50 files changed, 247 insertions, 27 deletions
diff --git a/support/Android.bp b/support/Android.bp index 3e23269f..6e500f0c 100644 --- a/support/Android.bp +++ b/support/Android.bp @@ -1,3 +1,7 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + subdirs = [ "jni", ] diff --git a/support/java/src/androidx/renderscript/Allocation.java b/support/java/src/androidx/renderscript/Allocation.java index b6588c00..a37eff63 100644 --- a/support/java/src/androidx/renderscript/Allocation.java +++ b/support/java/src/androidx/renderscript/Allocation.java @@ -54,7 +54,12 @@ import android.view.Surface; * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> * developer guide.</p> * </div> + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Allocation extends BaseObj { Type mType; Bitmap mBitmap; @@ -225,7 +230,7 @@ public class Allocation extends BaseObj { } /** - * Getter & Setter for the dummy allocation for Inc Support Lib. + * Getter & Setter for the placeholder allocation for Inc Support Lib. * */ public long getIncAllocID() { diff --git a/support/java/src/androidx/renderscript/BaseObj.java b/support/java/src/androidx/renderscript/BaseObj.java index eda00665..b7f9d9ea 100644 --- a/support/java/src/androidx/renderscript/BaseObj.java +++ b/support/java/src/androidx/renderscript/BaseObj.java @@ -24,7 +24,11 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; * It is responsible for lifetime management and resource tracking. This class * should not be used by a user application. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class BaseObj { BaseObj(long id, RenderScript rs) { rs.validate(); diff --git a/support/java/src/androidx/renderscript/Byte2.java b/support/java/src/androidx/renderscript/Byte2.java index cf738f48..b2f029e0 100644 --- a/support/java/src/androidx/renderscript/Byte2.java +++ b/support/java/src/androidx/renderscript/Byte2.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript byte2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Byte2 { public Byte2() { } diff --git a/support/java/src/androidx/renderscript/Byte3.java b/support/java/src/androidx/renderscript/Byte3.java index 559e34a7..1e12dec4 100644 --- a/support/java/src/androidx/renderscript/Byte3.java +++ b/support/java/src/androidx/renderscript/Byte3.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript byte3 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Byte3 { public Byte3() { } diff --git a/support/java/src/androidx/renderscript/Byte4.java b/support/java/src/androidx/renderscript/Byte4.java index 0a71e639..1ad22c74 100644 --- a/support/java/src/androidx/renderscript/Byte4.java +++ b/support/java/src/androidx/renderscript/Byte4.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript byte4 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Byte4 { public Byte4() { } diff --git a/support/java/src/androidx/renderscript/Double2.java b/support/java/src/androidx/renderscript/Double2.java index 9abcd01c..66d54ae3 100644 --- a/support/java/src/androidx/renderscript/Double2.java +++ b/support/java/src/androidx/renderscript/Double2.java @@ -24,7 +24,11 @@ import android.util.Log; * Class for exposing the native RenderScript double2 type back * to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Double2 { public Double2() { } diff --git a/support/java/src/androidx/renderscript/Double3.java b/support/java/src/androidx/renderscript/Double3.java index 0d07a501..98cf8c6e 100644 --- a/support/java/src/androidx/renderscript/Double3.java +++ b/support/java/src/androidx/renderscript/Double3.java @@ -24,7 +24,11 @@ import android.util.Log; * Class for exposing the native RenderScript double3 type back * to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Double3 { public Double3() { } diff --git a/support/java/src/androidx/renderscript/Double4.java b/support/java/src/androidx/renderscript/Double4.java index 3350abf5..b10ed05e 100644 --- a/support/java/src/androidx/renderscript/Double4.java +++ b/support/java/src/androidx/renderscript/Double4.java @@ -24,7 +24,11 @@ import android.util.Log; * Class for exposing the native RenderScript double4 type back * to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Double4 { public Double4() { } diff --git a/support/java/src/androidx/renderscript/Element.java b/support/java/src/androidx/renderscript/Element.java index 44dbc616..63766811 100644 --- a/support/java/src/androidx/renderscript/Element.java +++ b/support/java/src/androidx/renderscript/Element.java @@ -57,7 +57,12 @@ import android.util.Log; * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> * developer guide.</p> * </div> + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Element extends BaseObj { int mSize; Element[] mElements; @@ -755,7 +760,7 @@ public class Element extends BaseObj { } /* - * Get an identical dummy Element for Compat Context + * Get an identical placeholder Element for Compat Context * */ public long getDummyElement(RenderScript mRS) { diff --git a/support/java/src/androidx/renderscript/FieldPacker.java b/support/java/src/androidx/renderscript/FieldPacker.java index 34e9ae64..f3d1a44d 100644 --- a/support/java/src/androidx/renderscript/FieldPacker.java +++ b/support/java/src/androidx/renderscript/FieldPacker.java @@ -27,7 +27,11 @@ import java.util.BitSet; * reflected code generated by the RS tool chain. It should not * be called directly. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class FieldPacker { public FieldPacker(int len) { mPos = 0; diff --git a/support/java/src/androidx/renderscript/Float2.java b/support/java/src/androidx/renderscript/Float2.java index 01a166b6..b743beb4 100644 --- a/support/java/src/androidx/renderscript/Float2.java +++ b/support/java/src/androidx/renderscript/Float2.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript float2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Float2 { public Float2() { } diff --git a/support/java/src/androidx/renderscript/Float3.java b/support/java/src/androidx/renderscript/Float3.java index bb7932ab..63c5c89e 100644 --- a/support/java/src/androidx/renderscript/Float3.java +++ b/support/java/src/androidx/renderscript/Float3.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript float2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Float3 { public Float3() { } diff --git a/support/java/src/androidx/renderscript/Float4.java b/support/java/src/androidx/renderscript/Float4.java index 8336d9e1..d65a1ab4 100644 --- a/support/java/src/androidx/renderscript/Float4.java +++ b/support/java/src/androidx/renderscript/Float4.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript float2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Float4 { public Float4() { } diff --git a/support/java/src/androidx/renderscript/Int2.java b/support/java/src/androidx/renderscript/Int2.java index fe86fe33..b841f8be 100644 --- a/support/java/src/androidx/renderscript/Int2.java +++ b/support/java/src/androidx/renderscript/Int2.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript int2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Int2 { public Int2() { } diff --git a/support/java/src/androidx/renderscript/Int3.java b/support/java/src/androidx/renderscript/Int3.java index bd6fbc74..8ff4dcec 100644 --- a/support/java/src/androidx/renderscript/Int3.java +++ b/support/java/src/androidx/renderscript/Int3.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript int3 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Int3 { public Int3() { } diff --git a/support/java/src/androidx/renderscript/Int4.java b/support/java/src/androidx/renderscript/Int4.java index 91e0b9f9..449e9961 100644 --- a/support/java/src/androidx/renderscript/Int4.java +++ b/support/java/src/androidx/renderscript/Int4.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript int4 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Int4 { public Int4() { } diff --git a/support/java/src/androidx/renderscript/Long2.java b/support/java/src/androidx/renderscript/Long2.java index 08717063..76419b5e 100644 --- a/support/java/src/androidx/renderscript/Long2.java +++ b/support/java/src/androidx/renderscript/Long2.java @@ -22,7 +22,12 @@ import android.util.Log; /** * Class for exposing the native RenderScript long2 type back to the Android system. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Long2 { public Long2() { } diff --git a/support/java/src/androidx/renderscript/Long3.java b/support/java/src/androidx/renderscript/Long3.java index 250b50f1..cee3f555 100644 --- a/support/java/src/androidx/renderscript/Long3.java +++ b/support/java/src/androidx/renderscript/Long3.java @@ -22,7 +22,12 @@ import android.util.Log; /** * Class for exposing the native RenderScript long3 type back to the Android system. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Long3 { public Long3() { } diff --git a/support/java/src/androidx/renderscript/Long4.java b/support/java/src/androidx/renderscript/Long4.java index 438d34e6..2f5e5b92 100644 --- a/support/java/src/androidx/renderscript/Long4.java +++ b/support/java/src/androidx/renderscript/Long4.java @@ -22,7 +22,12 @@ import android.util.Log; /** * Class for exposing the native RenderScript long4 type back to the Android system. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Long4 { public Long4() { } diff --git a/support/java/src/androidx/renderscript/Matrix2f.java b/support/java/src/androidx/renderscript/Matrix2f.java index b5c5a089..d2733c4f 100644 --- a/support/java/src/androidx/renderscript/Matrix2f.java +++ b/support/java/src/androidx/renderscript/Matrix2f.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript rs_matrix2x2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Matrix2f { /** diff --git a/support/java/src/androidx/renderscript/Matrix3f.java b/support/java/src/androidx/renderscript/Matrix3f.java index 699c42b7..83435d49 100644 --- a/support/java/src/androidx/renderscript/Matrix3f.java +++ b/support/java/src/androidx/renderscript/Matrix3f.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript rs_matrix3x3 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Matrix3f { /** diff --git a/support/java/src/androidx/renderscript/Matrix4f.java b/support/java/src/androidx/renderscript/Matrix4f.java index 6a38af8b..0addfa00 100644 --- a/support/java/src/androidx/renderscript/Matrix4f.java +++ b/support/java/src/androidx/renderscript/Matrix4f.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript rs_matrix4x4 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Matrix4f { /** diff --git a/support/java/src/androidx/renderscript/RSDriverException.java b/support/java/src/androidx/renderscript/RSDriverException.java index 11b5be28..514bee04 100644 --- a/support/java/src/androidx/renderscript/RSDriverException.java +++ b/support/java/src/androidx/renderscript/RSDriverException.java @@ -20,7 +20,12 @@ package androidx.renderscript; /** * Base class for all exceptions thrown by the Android * RenderScript + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. */ +@Deprecated public class RSDriverException extends RSRuntimeException { public RSDriverException(String string) { super(string); diff --git a/support/java/src/androidx/renderscript/RSIllegalArgumentException.java b/support/java/src/androidx/renderscript/RSIllegalArgumentException.java index 6e7c0e94..13d212d5 100644 --- a/support/java/src/androidx/renderscript/RSIllegalArgumentException.java +++ b/support/java/src/androidx/renderscript/RSIllegalArgumentException.java @@ -20,7 +20,12 @@ package androidx.renderscript; /** * Base class for all exceptions thrown by the Android * RenderScript + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. */ +@Deprecated public class RSIllegalArgumentException extends RSRuntimeException { public RSIllegalArgumentException(String string) { super(string); diff --git a/support/java/src/androidx/renderscript/RSInvalidStateException.java b/support/java/src/androidx/renderscript/RSInvalidStateException.java index 82cc7c9c..f75d63de 100644 --- a/support/java/src/androidx/renderscript/RSInvalidStateException.java +++ b/support/java/src/androidx/renderscript/RSInvalidStateException.java @@ -20,7 +20,12 @@ package androidx.renderscript; /** * Base class for all exceptions thrown by the Android * RenderScript + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. */ +@Deprecated public class RSInvalidStateException extends RSRuntimeException { public RSInvalidStateException(String string) { super(string); diff --git a/support/java/src/androidx/renderscript/RSRuntimeException.java b/support/java/src/androidx/renderscript/RSRuntimeException.java index 886cd14d..12a3b0ff 100644 --- a/support/java/src/androidx/renderscript/RSRuntimeException.java +++ b/support/java/src/androidx/renderscript/RSRuntimeException.java @@ -20,7 +20,12 @@ package androidx.renderscript; /** * Base class for all exceptions thrown by the Android * RenderScript + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. */ +@Deprecated public class RSRuntimeException extends java.lang.RuntimeException { public RSRuntimeException(String string) { diff --git a/support/java/src/androidx/renderscript/RenderScript.java b/support/java/src/androidx/renderscript/RenderScript.java index cf803420..b789f2c8 100644 --- a/support/java/src/androidx/renderscript/RenderScript.java +++ b/support/java/src/androidx/renderscript/RenderScript.java @@ -43,7 +43,12 @@ import android.view.Surface; * <p>For more information about creating an application that uses RenderScript, read the * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p> * </div> + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class RenderScript { static final String LOG_TAG = "RenderScript_jni"; static final boolean DEBUG = false; @@ -63,20 +68,20 @@ public class RenderScript { private Context mApplicationContext; private String mNativeLibDir; - static private String mBlackList = ""; + static private String mDenyList = ""; /** - * Sets the blackList of Models to only use support lib runtime. + * Sets the denylist of Models to only use support lib runtime. * Should be used before context create. * - * @param blackList User provided black list string. + * @param denylist User provided denylist string. * * Format: "(MANUFACTURER1:PRODUCT1:MODEL1), (MANUFACTURER2:PRODUCT2:MODEL2)..." - * e.g. : To Blacklist Nexus 7(2013) and Nexus 5. - * mBlackList = "(asus:razor:Nexus 7), (LGE:hammerhead:Nexus 5)"; + * e.g. : To Denylist Nexus 7(2013) and Nexus 5. + * mDenyList = "(asus:razor:Nexus 7), (LGE:hammerhead:Nexus 5)"; */ - static public void setBlackList(String blackList) { - if (blackList != null) { - mBlackList = blackList; + static public void setDenyList(String denyList) { + if (denyList != null) { + mDenyList = denyList; } } /** @@ -224,8 +229,8 @@ public class RenderScript { } if (sNative == 1) { - // check against the blacklist - if (mBlackList.length() > 0) { + // check against the denylist + if (mDenyList.length() > 0) { String deviceInfo = '(' + android.os.Build.MANUFACTURER + ':' + @@ -233,7 +238,7 @@ public class RenderScript { ':' + android.os.Build.MODEL + ')'; - if (mBlackList.contains(deviceInfo)) { + if (mDenyList.contains(deviceInfo)) { sNative = 0; return false; } @@ -797,7 +802,7 @@ public class RenderScript { mIncLoaded = true; } if (mIncCon == 0) { - //Create a dummy compat context (synchronous). + //Create a placeholder compat context (synchronous). long device = nIncDeviceCreate(); mIncCon = nIncContextCreate(device, 0, 0, 0); } @@ -1044,7 +1049,7 @@ public class RenderScript { long mContext; private boolean mDestroyed = false; - //Dummy device & context for Inc Support Lib + //Placeholder device & context for Inc Support Lib long mIncCon; //indicator of whether inc support lib has been loaded or not. boolean mIncLoaded; diff --git a/support/java/src/androidx/renderscript/Sampler.java b/support/java/src/androidx/renderscript/Sampler.java index 57b94d53..2e5ae152 100644 --- a/support/java/src/androidx/renderscript/Sampler.java +++ b/support/java/src/androidx/renderscript/Sampler.java @@ -38,7 +38,12 @@ import android.graphics.BitmapFactory; * created with * {@link androidx.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} is * undefined. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Sampler extends BaseObj { public enum Value { NEAREST (0), diff --git a/support/java/src/androidx/renderscript/Script.java b/support/java/src/androidx/renderscript/Script.java index 49c0039f..3d4ba015 100644 --- a/support/java/src/androidx/renderscript/Script.java +++ b/support/java/src/androidx/renderscript/Script.java @@ -21,7 +21,12 @@ import android.util.SparseArray; /** * The parent class for all executable scripts. This should not be used by * applications. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Script extends BaseObj { /** * Determine if Incremental Intrinsic Support is needed @@ -42,17 +47,17 @@ public class Script extends BaseObj { long getDummyAlloc(Allocation ain) { long dInElement = 0; long dInType = 0; - long dummyAlloc = 0; + long placeholderAlloc = 0; if (ain != null) { Type inType = ain.getType(); dInElement = inType.getElement().getDummyElement(mRS); dInType = inType.getDummyType(mRS, dInElement); int xBytesSize = inType.getX() * inType.getElement().getBytesSize(); - dummyAlloc = mRS.nIncAllocationCreateTyped(ain.getID(mRS), dInType, xBytesSize); - ain.setIncAllocID(dummyAlloc); + placeholderAlloc = mRS.nIncAllocationCreateTyped(ain.getID(mRS), dInType, xBytesSize); + ain.setIncAllocID(placeholderAlloc); } - return dummyAlloc; + return placeholderAlloc; } /** * KernelID is an identifier for a Script + root function pair. It is used @@ -305,7 +310,7 @@ public class Script extends BaseObj { if (mUseIncSupp) { long ainInc = getDummyAlloc(ain); long aoutInc = getDummyAlloc(aout); - mRS.nScriptForEachClipped(getID(mRS), slot, ainInc, aoutInc, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend, mUseIncSupp); + mRS.nScriptForEachClipped(getID(mRS), slot, ainInc, aoutInc, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend, mUseIncSupp); } else { mRS.nScriptForEachClipped(getID(mRS), slot, in_id, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend, mUseIncSupp); } @@ -481,7 +486,7 @@ public class Script extends BaseObj { public void setVar(int index, BaseObj o) { if (mUseIncSupp) { long oInc = getDummyAlloc((Allocation)o); - mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : oInc, mUseIncSupp); + mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : oInc, mUseIncSupp); } else { mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS), mUseIncSupp); } diff --git a/support/java/src/androidx/renderscript/ScriptC.java b/support/java/src/androidx/renderscript/ScriptC.java index 31201b1a..4fd626e6 100644 --- a/support/java/src/androidx/renderscript/ScriptC.java +++ b/support/java/src/androidx/renderscript/ScriptC.java @@ -32,7 +32,12 @@ import java.lang.reflect.Modifier; /** * The superclass for all user-defined scripts. This is only * intended to be used by the generated derived classes. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptC extends Script { private static final String TAG = "ScriptC"; diff --git a/support/java/src/androidx/renderscript/ScriptGroup.java b/support/java/src/androidx/renderscript/ScriptGroup.java index ba8cf4b0..f5096e55 100644 --- a/support/java/src/androidx/renderscript/ScriptGroup.java +++ b/support/java/src/androidx/renderscript/ScriptGroup.java @@ -40,7 +40,12 @@ import java.util.Map; * Grouping kernels together allows for more efficient execution. For example, * runtime and compiler optimization can be applied to reduce computation and * communication overhead, and to make better use of the CPU and the GPU. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public final class ScriptGroup extends BaseObj { //FIXME: Change 23 to the codename when that is decided. private static final int MIN_API_VERSION = 23; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsic.java b/support/java/src/androidx/renderscript/ScriptIntrinsic.java index cf7b72e6..c9a616d4 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsic.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsic.java @@ -23,7 +23,12 @@ package androidx.renderscript; * operations. * * Not intended for direct use. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public abstract class ScriptIntrinsic extends Script { ScriptIntrinsic(long id, RenderScript rs) { super(id, rs); diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java b/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java index e7b6a079..5d5bc4cc 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java @@ -25,7 +25,11 @@ import android.util.Log; * allocation. The 8 nearest values are sampled and linearly interpolated. The * result is placed in the output. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsic3DLUT extends ScriptIntrinsic { private Allocation mLUT; private Element mElement; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java b/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java index 7d8e668a..d6acc270 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java @@ -29,7 +29,11 @@ import java.lang.annotation.RetentionPolicy; * * For detailed description of BLAS, please refer to http://www.netlib.org/blas/ * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public final class ScriptIntrinsicBLAS extends ScriptIntrinsic { private Allocation mLUT; private static final int INTRINSIC_API_LEVEL = 23; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java b/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java index c7e174de..534de8ad 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java @@ -20,7 +20,12 @@ package androidx.renderscript; /** * Intrinsic kernels for blending two * {@link androidx.renderscript.Allocation} objects. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicBlend extends ScriptIntrinsic { // API level for the intrinsic private static final int INTRINSIC_API_LEVEL = 19; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java b/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java index 4024416c..09114cd3 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java @@ -24,8 +24,11 @@ import android.util.Log; * Intrinsic Gausian blur filter. Applies a gaussian blur of the * specified radius to all elements of an allocation. * - * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicBlur extends ScriptIntrinsic { private final float[] mValues = new float[9]; private Allocation mInput; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java b/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java index a0a247d5..cb17244c 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java @@ -26,7 +26,12 @@ import android.util.Log; * result by the 4x4 color matrix as performed by * rsMatrixMultiply() and writing it to the output after * conversion back to {@link Element#U8_4}. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicColorMatrix extends ScriptIntrinsic { private final Matrix4f mMatrix = new Matrix4f(); private final Float4 mAdd = new Float4(); diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java index d4e57b01..87149b30 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java @@ -21,7 +21,11 @@ import android.util.Log; /** * Intrinsic for applying a 3x3 convolve to an allocation. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { private final float[] mValues = new float[9]; private Allocation mInput; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java index 298596e7..71058477 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java @@ -21,7 +21,11 @@ import android.util.Log; /** * Intrinsic for applying a 5x5 convolve to an allocation. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { private final float[] mValues = new float[25]; private Allocation mInput; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java b/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java index 3437f2c2..821a1de6 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java @@ -21,8 +21,11 @@ import android.util.Log; /** * Intrinsic Histogram filter. * - * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicHistogram extends ScriptIntrinsic { private Allocation mOut; // API level for the intrinsic diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java b/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java index 64349036..04183346 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java @@ -23,7 +23,12 @@ import android.util.Log; * channel of the input has an independant lookup table. The * tables are 256 entries in size and can cover the full value * range of {@link Element#U8_4}. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class ScriptIntrinsicLUT extends ScriptIntrinsic { private final Matrix4f mMatrix = new Matrix4f(); private Allocation mTables; diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java b/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java index c3450f1e..6ef32a15 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java @@ -20,7 +20,12 @@ import android.util.Log; /** * Intrinsic for performing a resize of a 2D allocation. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. */ +@Deprecated public class ScriptIntrinsicResize extends ScriptIntrinsic { private Allocation mInput; // API level for the intrinsic diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java b/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java index 87493982..0a090743 100644 --- a/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java +++ b/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java @@ -23,7 +23,12 @@ package androidx.renderscript; * The input allocation is supplied in NV21 format as a U8 * element type. The output is RGBA, the alpha channel will be * set to 255. + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. */ +@Deprecated public class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic { private Allocation mInput; // API level for the intrinsic diff --git a/support/java/src/androidx/renderscript/Short2.java b/support/java/src/androidx/renderscript/Short2.java index f06d7461..679ea8ac 100644 --- a/support/java/src/androidx/renderscript/Short2.java +++ b/support/java/src/androidx/renderscript/Short2.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript Short2 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Short2 { public Short2() { } diff --git a/support/java/src/androidx/renderscript/Short3.java b/support/java/src/androidx/renderscript/Short3.java index fbf9a890..e6e76c21 100644 --- a/support/java/src/androidx/renderscript/Short3.java +++ b/support/java/src/androidx/renderscript/Short3.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript short3 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Short3 { public Short3() { } diff --git a/support/java/src/androidx/renderscript/Short4.java b/support/java/src/androidx/renderscript/Short4.java index 1e479d2c..0826e5fd 100644 --- a/support/java/src/androidx/renderscript/Short4.java +++ b/support/java/src/androidx/renderscript/Short4.java @@ -23,7 +23,11 @@ import android.util.Log; /** * Class for exposing the native RenderScript short4 type back to the Android system. * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Short4 { public Short4() { } diff --git a/support/java/src/androidx/renderscript/Type.java b/support/java/src/androidx/renderscript/Type.java index cec834cb..a0c225d5 100644 --- a/support/java/src/androidx/renderscript/Type.java +++ b/support/java/src/androidx/renderscript/Type.java @@ -50,7 +50,12 @@ import android.util.Log; * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> * developer guide.</p> * </div> + * + * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a + * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration + * guide</a> for the proposed alternatives. **/ +@Deprecated public class Type extends BaseObj { int mDimX; int mDimY; @@ -190,7 +195,7 @@ public class Type extends BaseObj { } /* - * Get an identical dummy Type for Compat Context + * Get an identical placeholder Type for Compat Context * */ public long getDummyType(RenderScript mRS, long eid) { diff --git a/support/jni/Android.bp b/support/jni/Android.bp index 4f4fef80..5a86d46e 100644 --- a/support/jni/Android.bp +++ b/support/jni/Android.bp @@ -1,3 +1,7 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + cc_library_shared { name: "libRSSupportIO", defaults: ["rs_support_defaults"], @@ -23,6 +27,8 @@ cc_library_shared { "-DRS_COMPATIBILITY_LIB", ], + header_libs: ["jni_headers"], + shared_libs: [ "libandroid", "libdl", @@ -43,6 +49,9 @@ cc_library_shared { srcs: ["android_renderscript_RenderScript.cpp"], + header_libs: ["jni_headers"], + export_header_lib_headers: ["jni_headers"], + shared_libs: [ "libdl", "libjnigraphics", diff --git a/support/jni/android_renderscript_RenderScript.cpp b/support/jni/android_renderscript_RenderScript.cpp index b65243c2..c2911be2 100644 --- a/support/jni/android_renderscript_RenderScript.cpp +++ b/support/jni/android_renderscript_RenderScript.cpp @@ -2129,7 +2129,7 @@ static jboolean nIncLoadSO(JNIEnv *_env, jobject _this, jint deviceApi, jstring } // ----------------------------------- -// To create/destroy a dummy context +// To create/destroy a placeholder context static void nIncObjDestroy(JNIEnv *_env, jobject _this, jlong con, jlong obj) { @@ -2177,7 +2177,7 @@ nIncContextDestroy(JNIEnv *_env, jobject _this, jlong con) } // ----------------------------------- -// Create dummy Element +// Create placeholder Element static jlong nIncElementCreate(JNIEnv *_env, jobject _this, jlong con, jlong type, jint kind, jboolean norm, jint size) { @@ -2187,7 +2187,7 @@ nIncElementCreate(JNIEnv *_env, jobject _this, jlong con, jlong type, jint kind, (RsDataKind)kind, norm, size); } // ----------------------------------- -// Create dummy Type +// Create placeholder Type static jlong nIncTypeCreate(JNIEnv *_env, jobject _this, jlong con, jlong eid, jint dimx, jint dimy, jint dimz, jboolean mips, jboolean faces, jint yuv) |