summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-12-08 16:14:36 -0800
committerJason Sams <rjsams@android.com>2010-12-08 16:14:36 -0800
commit5476b450e50939940dcf3f15c92335cee2fc572d (patch)
tree2129f5a5abfdfa6d43ae3e884d759d4614604c41 /graphics
parentaf8962e48ecf0ff3833084f540ca7e2f05295560 (diff)
downloadframeworks_base-5476b450e50939940dcf3f15c92335cee2fc572d.zip
frameworks_base-5476b450e50939940dcf3f15c92335cee2fc572d.tar.gz
frameworks_base-5476b450e50939940dcf3f15c92335cee2fc572d.tar.bz2
Allocation API update.
Change-Id: I9b4a71f9e94c7d3978f06b7971051ab4f8472503
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/renderscript/Allocation.java173
-rw-r--r--graphics/java/android/renderscript/BaseObj.java3
-rw-r--r--graphics/java/android/renderscript/Mesh.java8
-rw-r--r--graphics/java/android/renderscript/RenderScript.java37
-rw-r--r--graphics/java/android/renderscript/Script.java6
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp69
6 files changed, 187 insertions, 109 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 074e423..97d513a 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -33,6 +33,15 @@ import android.util.TypedValue;
public class Allocation extends BaseObj {
Type mType;
Bitmap mBitmap;
+ int mUsage;
+
+ public static final int USAGE_SCRIPT = 0x0001;
+ public static final int USAGE_GRAPHICS_TEXTURE = 0x0002;
+ public static final int USAGE_GRAPHICS_VERTEX = 0x0004;
+ public static final int USAGE_GRAPHICS_CONSTANTS = 0x0008;
+
+ private static final int USAGE_ALL = 0x000F;
+
public enum CubemapLayout {
VERTICAL_FACE_LIST (0),
@@ -46,13 +55,23 @@ public class Allocation extends BaseObj {
}
}
- Allocation(int id, RenderScript rs, Type t) {
- super(id, rs);
- mType = t;
+ public enum MipmapGenerationControl {
+ MIPMAP_NONE(0),
+ MIPMAP_FULL(1),
+ MIPMAP_ON_SYNC_TO_TEXTURE(2);
+
+ int mID;
+ MipmapGenerationControl(int id) {
+ mID = id;
+ }
}
- Allocation(int id, RenderScript rs) {
+ Allocation(int id, RenderScript rs, Type t, int usage) {
super(id, rs);
+ if (usage > USAGE_ALL) {
+ throw new RSIllegalArgumentException("Unknown usage specified.");
+ }
+ mType = t;
}
@Override
@@ -69,6 +88,20 @@ public class Allocation extends BaseObj {
return mType;
}
+ public void syncAll(int srcLocation) {
+ switch (srcLocation) {
+ case USAGE_SCRIPT:
+ case USAGE_GRAPHICS_CONSTANTS:
+ case USAGE_GRAPHICS_TEXTURE:
+ case USAGE_GRAPHICS_VERTEX:
+ break;
+ default:
+ throw new RSIllegalArgumentException("Source must be exactly one usage type.");
+ }
+ mRS.validate();
+ mRS.nAllocationSyncAll(getID(), srcLocation);
+ }
+
public void uploadToTexture(int baseMipLevel) {
mRS.validate();
mRS.nAllocationUploadToTexture(getID(), false, baseMipLevel);
@@ -242,6 +275,7 @@ public class Allocation extends BaseObj {
}
*/
+ /*
public class Adapter1D extends BaseObj {
Adapter1D(int id, RenderScript rs) {
super(id, rs);
@@ -282,6 +316,7 @@ public class Allocation extends BaseObj {
mRS.nAdapter1DBindAllocation(id, getID());
return new Adapter1D(id, mRS);
}
+ */
public class Adapter2D extends BaseObj {
@@ -336,32 +371,38 @@ public class Allocation extends BaseObj {
mBitmapOptions.inScaled = false;
}
- static public Allocation createTyped(RenderScript rs, Type type) {
-
+ static public Allocation createTyped(RenderScript rs, Type type, int usage) {
rs.validate();
- if(type.getID() == 0) {
+ if (type.getID() == 0) {
throw new RSInvalidStateException("Bad Type");
}
- int id = rs.nAllocationCreateTyped(type.getID());
- if(id == 0) {
+ int id = rs.nAllocationCreateTyped(type.getID(), usage);
+ if (id == 0) {
throw new RSRuntimeException("Allocation creation failed.");
}
- return new Allocation(id, rs, type);
+ return new Allocation(id, rs, type, usage);
}
- static public Allocation createSized(RenderScript rs, Element e, int count)
- throws IllegalArgumentException {
+ static public Allocation createTyped(RenderScript rs, Type type) {
+ return createTyped(rs, type, USAGE_ALL);
+ }
+ static public Allocation createSized(RenderScript rs, Element e,
+ int count, int usage) {
rs.validate();
Type.Builder b = new Type.Builder(rs, e);
b.setX(count);
Type t = b.create();
- int id = rs.nAllocationCreateTyped(t.getID());
- if(id == 0) {
+ int id = rs.nAllocationCreateTyped(t.getID(), usage);
+ if (id == 0) {
throw new RSRuntimeException("Allocation creation failed.");
}
- return new Allocation(id, rs, t);
+ return new Allocation(id, rs, t, usage);
+ }
+
+ static public Allocation createSized(RenderScript rs, Element e, int count) {
+ return createSized(rs, e, count, USAGE_ALL);
}
static private Element elementFromBitmap(RenderScript rs, Bitmap b) {
@@ -381,32 +422,44 @@ public class Allocation extends BaseObj {
throw new RSInvalidStateException("Bad bitmap type: " + bc);
}
- static private Type typeFromBitmap(RenderScript rs, Bitmap b, boolean mip) {
+ static private Type typeFromBitmap(RenderScript rs, Bitmap b,
+ MipmapGenerationControl mip) {
Element e = elementFromBitmap(rs, b);
Type.Builder tb = new Type.Builder(rs, e);
tb.setX(b.getWidth());
tb.setY(b.getHeight());
- tb.setMipmaps(mip);
+ tb.setMipmaps(mip == MipmapGenerationControl.MIPMAP_FULL);
return tb.create();
}
static public Allocation createFromBitmap(RenderScript rs, Bitmap b,
- Element dstFmt, boolean genMips) {
+ MipmapGenerationControl mips,
+ int usage) {
rs.validate();
- Type t = typeFromBitmap(rs, b, genMips);
+ Type t = typeFromBitmap(rs, b, mips);
- int id = rs.nAllocationCreateFromBitmap(dstFmt.getID(), genMips, b);
- if(id == 0) {
+ int id = rs.nAllocationCreateFromBitmap(t.getID(), mips.mID, b, usage);
+ if (id == 0) {
throw new RSRuntimeException("Load failed.");
}
- return new Allocation(id, rs, t);
+ return new Allocation(id, rs, t, usage);
+ }
+
+ static public Allocation createFromBitmap(RenderScript rs, Bitmap b,
+ Element dstFmt, boolean genMips) {
+ MipmapGenerationControl mc = MipmapGenerationControl.MIPMAP_NONE;
+ if (genMips) {
+ mc = MipmapGenerationControl.MIPMAP_ON_SYNC_TO_TEXTURE;
+ }
+ return createFromBitmap(rs, b, mc, USAGE_ALL);
}
static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b,
- Element dstFmt,
- boolean genMips,
- CubemapLayout layout) {
+ MipmapGenerationControl mips,
+ CubemapLayout layout,
+ int usage) {
rs.validate();
+
int height = b.getHeight();
int width = b.getWidth();
@@ -429,64 +482,76 @@ public class Allocation extends BaseObj {
tb.setX(width);
tb.setY(width);
tb.setFaces(true);
- tb.setMipmaps(genMips);
+ tb.setMipmaps(mips == MipmapGenerationControl.MIPMAP_FULL);
Type t = tb.create();
- int id = rs.nAllocationCubeCreateFromBitmap(dstFmt.getID(), genMips, b);
+ int id = rs.nAllocationCubeCreateFromBitmap(t.getID(), mips.mID, b, usage);
if(id == 0) {
throw new RSRuntimeException("Load failed for bitmap " + b + " element " + e);
}
- return new Allocation(id, rs, t);
+ return new Allocation(id, rs, t, usage);
+ }
+
+ static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b,
+ Element dstFmt,
+ boolean genMips,
+ CubemapLayout layout) {
+ MipmapGenerationControl mc = MipmapGenerationControl.MIPMAP_NONE;
+ if (genMips) {
+ mc = MipmapGenerationControl.MIPMAP_ON_SYNC_TO_TEXTURE;
+ }
+ return createCubemapFromBitmap(rs, b, mc, layout, USAGE_ALL);
}
+
static public Allocation createBitmapRef(RenderScript rs, Bitmap b) {
rs.validate();
- Type t = typeFromBitmap(rs, b, false);
+ Type t = typeFromBitmap(rs, b, MipmapGenerationControl.MIPMAP_NONE);
int id = rs.nAllocationCreateBitmapRef(t.getID(), b);
if(id == 0) {
throw new RSRuntimeException("Load failed.");
}
- Allocation a = new Allocation(id, rs, t);
+ Allocation a = new Allocation(id, rs, t, USAGE_SCRIPT);
a.mBitmap = b;
return a;
}
- static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id, Element dstFmt, boolean genMips) {
+ static public Allocation createFromBitmapResource(RenderScript rs,
+ Resources res,
+ int id,
+ MipmapGenerationControl mips,
+ int usage) {
rs.validate();
- InputStream is = null;
- try {
- final TypedValue value = new TypedValue();
- is = res.openRawResource(id, value);
-
- int asset = ((AssetManager.AssetInputStream) is).getAssetInt();
- int aId = rs.nAllocationCreateFromAssetStream(dstFmt.getID(), genMips, asset);
+ Bitmap b = BitmapFactory.decodeResource(res, id);
+ Allocation alloc = createFromBitmap(rs, b, mips, usage);
+ b.recycle();
+ return alloc;
+ }
- if (aId == 0) {
- throw new RSRuntimeException("Load failed.");
- }
- Allocation alloc = new Allocation(aId, rs, null);
- alloc.updateFromNative();
- return alloc;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- // Ignore
- }
- }
+ static public Allocation createFromBitmapResource(RenderScript rs,
+ Resources res,
+ int id,
+ Element dstFmt,
+ boolean genMips) {
+ MipmapGenerationControl mc = MipmapGenerationControl.MIPMAP_NONE;
+ if (genMips) {
+ mc = MipmapGenerationControl.MIPMAP_ON_SYNC_TO_TEXTURE;
}
+ return createFromBitmapResource(rs, res, id, mc, USAGE_ALL);
}
- static public Allocation createFromString(RenderScript rs, String str) {
+ static public Allocation createFromString(RenderScript rs,
+ String str,
+ int usage) {
+ rs.validate();
byte[] allocArray = null;
try {
allocArray = str.getBytes("UTF-8");
- Allocation alloc = Allocation.createSized(rs, Element.U8(rs), allocArray.length);
+ Allocation alloc = Allocation.createSized(rs, Element.U8(rs), allocArray.length, usage);
alloc.copyFrom(allocArray);
return alloc;
}
diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java
index c02435f..05f1bec 100644
--- a/graphics/java/android/renderscript/BaseObj.java
+++ b/graphics/java/android/renderscript/BaseObj.java
@@ -52,6 +52,9 @@ class BaseObj {
if (mDestroyed) {
throw new RSInvalidStateException("using a destroyed object.");
}
+ if (mID == 0) {
+ throw new RSRuntimeException("Internal error: Object id 0.");
+ }
return mID;
}
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index 9176bc8..44faa32 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.java
@@ -77,14 +77,18 @@ public class Mesh extends BaseObj {
for(int i = 0; i < vtxCount; i ++) {
if(vtxIDs[i] != 0) {
- mVertexBuffers[i] = new Allocation(vtxIDs[i], mRS);
+ mVertexBuffers[i] = new Allocation(vtxIDs[i], mRS, null,
+ Allocation.USAGE_GRAPHICS_VERTEX |
+ Allocation.USAGE_SCRIPT);
mVertexBuffers[i].updateFromNative();
}
}
for(int i = 0; i < idxCount; i ++) {
if(idxIDs[i] != 0) {
- mIndexBuffers[i] = new Allocation(idxIDs[i], mRS);
+ mIndexBuffers[i] = new Allocation(idxIDs[i], mRS, null,
+ Allocation.USAGE_GRAPHICS_VERTEX |
+ Allocation.USAGE_SCRIPT);
mIndexBuffers[i].updateFromNative();
}
mPrimitives[i] = Primitive.values()[primitives[i]];
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 6ff894d..e3a9a67 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -192,29 +192,34 @@ public class RenderScript {
rsnTypeGetNativeData(mContext, id, typeData);
}
- native int rsnAllocationCreateTyped(int con, int type);
- synchronized int nAllocationCreateTyped(int type) {
- return rsnAllocationCreateTyped(mContext, type);
+ native int rsnAllocationCreateTyped(int con, int type, int usage);
+ synchronized int nAllocationCreateTyped(int type, int usage) {
+ return rsnAllocationCreateTyped(mContext, type, usage);
}
- native void rsnAllocationUpdateFromBitmap(int con, int alloc, Bitmap bmp);
- synchronized void nAllocationUpdateFromBitmap(int alloc, Bitmap bmp) {
- rsnAllocationUpdateFromBitmap(mContext, alloc, bmp);
+ native int rsnAllocationCreateFromBitmap(int con, int type, int mip, Bitmap bmp, int usage);
+ synchronized int nAllocationCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) {
+ return rsnAllocationCreateFromBitmap(mContext, type, mip, bmp, usage);
}
- native int rsnAllocationCreateFromBitmap(int con, int dstFmt, boolean genMips, Bitmap bmp);
- synchronized int nAllocationCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp) {
- return rsnAllocationCreateFromBitmap(mContext, dstFmt, genMips, bmp);
- }
- native int rsnAllocationCubeCreateFromBitmap(int con, int dstFmt, boolean genMips, Bitmap bmp);
- synchronized int nAllocationCubeCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp) {
- return rsnAllocationCubeCreateFromBitmap(mContext, dstFmt, genMips, bmp);
+ native int rsnAllocationCubeCreateFromBitmap(int con, int type, int mip, Bitmap bmp, int usage);
+ synchronized int nAllocationCubeCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) {
+ return rsnAllocationCubeCreateFromBitmap(mContext, type, mip, bmp, usage);
}
native int rsnAllocationCreateBitmapRef(int con, int type, Bitmap bmp);
synchronized int nAllocationCreateBitmapRef(int type, Bitmap bmp) {
return rsnAllocationCreateBitmapRef(mContext, type, bmp);
}
- native int rsnAllocationCreateFromAssetStream(int con, int dstFmt, boolean genMips, int assetStream);
- synchronized int nAllocationCreateFromAssetStream(int dstFmt, boolean genMips, int assetStream) {
- return rsnAllocationCreateFromAssetStream(mContext, dstFmt, genMips, assetStream);
+ native int rsnAllocationCreateFromAssetStream(int con, int mips, int assetStream, int usage);
+ synchronized int nAllocationCreateFromAssetStream(int mips, int assetStream, int usage) {
+ return rsnAllocationCreateFromAssetStream(mContext, mips, assetStream, usage);
+ }
+
+ native void rsnAllocationSyncAll(int con, int alloc, int src);
+ synchronized void nAllocationSyncAll(int alloc, int src) {
+ rsnAllocationSyncAll(mContext, alloc, src);
+ }
+ native void rsnAllocationUpdateFromBitmap(int con, int alloc, Bitmap bmp);
+ synchronized void nAllocationUpdateFromBitmap(int alloc, Bitmap bmp) {
+ rsnAllocationUpdateFromBitmap(mContext, alloc, bmp);
}
native void rsnAllocationUploadToTexture(int con, int alloc, boolean genMips, int baseMioLevel);
diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java
index ea616c6..aaf5475 100644
--- a/graphics/java/android/renderscript/Script.java
+++ b/graphics/java/android/renderscript/Script.java
@@ -119,7 +119,11 @@ public class Script extends BaseObj {
protected Allocation mAllocation;
protected void init(RenderScript rs, int dimx) {
- mAllocation = Allocation.createSized(rs, mElement, dimx);
+ mAllocation = Allocation.createSized(rs, mElement, dimx, Allocation.USAGE_SCRIPT);
+ }
+
+ protected void init(RenderScript rs, int dimx, int usages) {
+ mAllocation = Allocation.createSized(rs, mElement, dimx, Allocation.USAGE_SCRIPT | usages);
}
protected FieldBase() {
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index c4e0372..65acf93 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -388,10 +388,10 @@ nTypeGetNativeData(JNIEnv *_env, jobject _this, RsContext con, jint id, jintArra
// -----------------------------------
static jint
-nAllocationCreateTyped(JNIEnv *_env, jobject _this, RsContext con, jint e)
+nAllocationCreateTyped(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mips, jint usage)
{
- LOG_API("nAllocationCreateTyped, con(%p), e(%p)", con, (RsElement)e);
- return (jint) rsaAllocationCreateTyped(con, (RsElement)e);
+ LOG_API("nAllocationCreateTyped, con(%p), type(%p), mip(%i), usage(%i)", con, (RsElement)type, mip, usage);
+ return (jint) rsaAllocationCreateTyped(con, (RsType)type, (RsAllocationMipmapGenerationControl)mips, (uint32_t)usage);
}
static void
@@ -408,6 +408,13 @@ nAllocationUploadToBufferObject(JNIEnv *_env, jobject _this, RsContext con, jint
rsAllocationUploadToBufferObject(con, (RsAllocation)a);
}
+static void
+nAllocationSyncAll(JNIEnv *_env, jobject _this, RsContext con, jint a, jint bits)
+{
+ LOG_API("nAllocationSyncAll, con(%p), a(%p), bits(0x%08x)", con, (RsAllocation)a, bits);
+ rsAllocationSyncAll(con, (RsAllocation)a, (RsAllocationUsageType)bits);
+}
+
static RsElement SkBitmapToPredefined(SkBitmap::Config cfg)
{
switch (cfg) {
@@ -429,45 +436,31 @@ static RsElement SkBitmapToPredefined(SkBitmap::Config cfg)
}
static int
-nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint dstFmt, jboolean genMips, jobject jbitmap)
+nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
{
SkBitmap const * nativeBitmap =
(SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
- RsElement e = SkBitmapToPredefined(config);
- if (e) {
- bitmap.lockPixels();
- const int w = bitmap.width();
- const int h = bitmap.height();
- const void* ptr = bitmap.getPixels();
- jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr);
- bitmap.unlockPixels();
- return id;
- }
- return 0;
+ bitmap.lockPixels();
+ const void* ptr = bitmap.getPixels();
+ jint id = (jint)rsaAllocationCreateFromBitmap(con, (RsType)type, (RsAllocationMipmapGenerationControl)mip, ptr, usage);
+ bitmap.unlockPixels();
+ return id;
}
static int
-nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint dstFmt, jboolean genMips, jobject jbitmap)
+nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
{
SkBitmap const * nativeBitmap =
(SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
- RsElement e = SkBitmapToPredefined(config);
- if (e) {
- bitmap.lockPixels();
- const int w = bitmap.width();
- const int h = bitmap.height();
- const void* ptr = bitmap.getPixels();
- jint id = (jint)rsaAllocationCubeCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr);
- bitmap.unlockPixels();
- return id;
- }
- return 0;
+ bitmap.lockPixels();
+ const void* ptr = bitmap.getPixels();
+ jint id = (jint)rsaAllocationCubeCreateFromBitmap(con, (RsType)type, (RsAllocationMipmapGenerationControl)mip, ptr, usage);
+ bitmap.unlockPixels();
+ return id;
}
static void
@@ -507,8 +500,9 @@ nAllocationCreateBitmapRef(JNIEnv *_env, jobject _this, RsContext con, jint type
}
static int
-nAllocationCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con, jint dstFmt, jboolean genMips, jint native_asset)
+nAllocationCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con, jint dstFmt, jboolean genMips, jint native_asset, jint usage)
{
+ /*
Asset* asset = reinterpret_cast<Asset*>(native_asset);
SkBitmap bitmap;
SkImageDecoder::DecodeMemory(asset->getBuffer(false), asset->getLength(),
@@ -523,10 +517,11 @@ nAllocationCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con, jin
const int w = bitmap.width();
const int h = bitmap.height();
const void* ptr = bitmap.getPixels();
- jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr);
+ jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr, usage);
bitmap.unlockPixels();
return id;
}
+ */
return 0;
}
@@ -1313,14 +1308,16 @@ static JNINativeMethod methods[] = {
{"rsnTypeCreate", "(IIIIIZZ)I", (void*)nTypeCreate },
{"rsnTypeGetNativeData", "(II[I)V", (void*)nTypeGetNativeData },
-{"rsnAllocationCreateTyped", "(II)I", (void*)nAllocationCreateTyped },
-{"rsnAllocationUpdateFromBitmap", "(IILandroid/graphics/Bitmap;)V", (void*)nAllocationUpdateFromBitmap },
-{"rsnAllocationCreateFromBitmap", "(IIZLandroid/graphics/Bitmap;)I", (void*)nAllocationCreateFromBitmap },
-{"rsnAllocationCubeCreateFromBitmap","(IIZLandroid/graphics/Bitmap;)I", (void*)nAllocationCubeCreateFromBitmap },
+{"rsnAllocationCreateTyped", "(III)I", (void*)nAllocationCreateTyped },
+{"rsnAllocationCreateFromBitmap", "(IIILandroid/graphics/Bitmap;I)I", (void*)nAllocationCreateFromBitmap },
+{"rsnAllocationCubeCreateFromBitmap","(IIILandroid/graphics/Bitmap;I)I", (void*)nAllocationCubeCreateFromBitmap },
{"rsnAllocationCreateBitmapRef", "(IILandroid/graphics/Bitmap;)I", (void*)nAllocationCreateBitmapRef },
-{"rsnAllocationCreateFromAssetStream","(IIZI)I", (void*)nAllocationCreateFromAssetStream },
+{"rsnAllocationCreateFromAssetStream","(IIII)I", (void*)nAllocationCreateFromAssetStream },
+
+{"rsnAllocationUpdateFromBitmap", "(IILandroid/graphics/Bitmap;)V", (void*)nAllocationUpdateFromBitmap },
{"rsnAllocationUploadToTexture", "(IIZI)V", (void*)nAllocationUploadToTexture },
{"rsnAllocationUploadToBufferObject","(II)V", (void*)nAllocationUploadToBufferObject },
+{"rsnAllocationSyncAll", "(III)V", (void*)nAllocationSyncAll },
{"rsnAllocationSubData1D", "(IIII[II)V", (void*)nAllocationSubData1D_i },
{"rsnAllocationSubData1D", "(IIII[SI)V", (void*)nAllocationSubData1D_s },
{"rsnAllocationSubData1D", "(IIII[BI)V", (void*)nAllocationSubData1D_b },