Lines Matching refs:rs

179     Allocation(int id, RenderScript rs, Type t, int usage) {
180 super(id, rs);
868 static public Allocation createTyped(RenderScript rs, Type type, MipmapControl mips, int usage) {
869 rs.validate();
873 int id = rs.nAllocationCreateTyped(type.getID(), mips.mID, usage);
877 return new Allocation(id, rs, type, usage);
884 * @param rs Context to which the allocation will belong.
891 static public Allocation createTyped(RenderScript rs, Type type, int usage) {
892 return createTyped(rs, type, MipmapControl.MIPMAP_NONE, usage);
900 * @param rs Context to which the allocation will belong.
905 static public Allocation createTyped(RenderScript rs, Type type) {
906 return createTyped(rs, type, MipmapControl.MIPMAP_NONE, USAGE_SCRIPT);
913 * @param rs Context to which the allocation will belong.
921 static public Allocation createSized(RenderScript rs, Element e,
923 rs.validate();
924 Type.Builder b = new Type.Builder(rs, e);
928 int id = rs.nAllocationCreateTyped(t.getID(), MipmapControl.MIPMAP_NONE.mID, usage);
932 return new Allocation(id, rs, t, usage);
939 * @param rs Context to which the allocation will belong.
945 static public Allocation createSized(RenderScript rs, Element e, int count) {
946 return createSized(rs, e, count, USAGE_SCRIPT);
949 static Element elementFromBitmap(RenderScript rs, Bitmap b) {
952 return Element.A_8(rs);
955 return Element.RGBA_4444(rs);
958 return Element.RGBA_8888(rs);
961 return Element.RGB_565(rs);
966 static Type typeFromBitmap(RenderScript rs, Bitmap b,
968 Element e = elementFromBitmap(rs, b);
969 Type.Builder tb = new Type.Builder(rs, e);
979 * @param rs Context to which the allocation will belong.
989 static public Allocation createFromBitmap(RenderScript rs, Bitmap b,
992 rs.validate();
993 Type t = typeFromBitmap(rs, b, mips);
995 int id = rs.nAllocationCreateFromBitmap(t.getID(), mips.mID, b, usage);
999 return new Allocation(id, rs, t, usage);
1006 * @param rs Context to which the allocation will belong.
1012 static public Allocation createFromBitmap(RenderScript rs, Bitmap b) {
1013 return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE,
1022 * @param rs Context to which the allocation will belong.
1031 static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b,
1034 rs.validate();
1050 Element e = elementFromBitmap(rs, b);
1051 Type.Builder tb = new Type.Builder(rs, e);
1058 int id = rs.nAllocationCubeCreateFromBitmap(t.getID(), mips.mID, b, usage);
1062 return new Allocation(id, rs, t, usage);
1071 * @param rs Context to which the allocation will belong.
1078 static public Allocation createCubemapFromBitmap(RenderScript rs,
1080 return createCubemapFromBitmap(rs, b, MipmapControl.MIPMAP_NONE,
1089 * @param rs Context to which the allocation will belong.
1102 static public Allocation createCubemapFromCubeFaces(RenderScript rs,
1125 Element e = elementFromBitmap(rs, xpos);
1126 Type.Builder tb = new Type.Builder(rs, e);
1132 Allocation cubemap = Allocation.createTyped(rs, t, mips, usage);
1134 AllocationAdapter adapter = AllocationAdapter.create2D(rs, cubemap);
1157 * @param rs Context to which the allocation will belong.
1168 static public Allocation createCubemapFromCubeFaces(RenderScript rs,
1175 return createCubemapFromCubeFaces(rs, xpos, xneg, ypos, yneg,
1184 * @param rs Context to which the allocation will belong.
1195 static public Allocation createFromBitmapResource(RenderScript rs,
1201 rs.validate();
1203 Allocation alloc = createFromBitmap(rs, b, mips, usage);
1212 * @param rs Context to which the allocation will belong.
1219 static public Allocation createFromBitmapResource(RenderScript rs,
1222 return createFromBitmapResource(rs, res, id,
1231 * @param rs Context to which the allocation will belong.
1237 static public Allocation createFromString(RenderScript rs,
1240 rs.validate();
1244 Allocation alloc = Allocation.createSized(rs, Element.U8(rs), allocArray.length, usage);