Additional loading methods for fonts and a3d files.

Cleaned up error messages.

Change-Id: Id33b7149671df23c37cc11375d844a7837dac750

Change-Id: I6663ce54f7b9bbaf285935ca658d93ba417f8179
This commit is contained in:
Alex Sakhartchouk
2011-01-07 11:12:08 -08:00
parent 60525c824c
commit b0253ea696
10 changed files with 287 additions and 111 deletions

View File

@ -19,6 +19,7 @@ package android.renderscript;
import java.lang.reflect.Field;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Config;
@ -284,6 +285,14 @@ public class RenderScript {
synchronized int nFileA3DCreateFromAssetStream(int assetStream) {
return rsnFileA3DCreateFromAssetStream(mContext, assetStream);
}
native int rsnFileA3DCreateFromFile(int con, String path);
synchronized int nFileA3DCreateFromFile(String path) {
return rsnFileA3DCreateFromFile(mContext, path);
}
native int rsnFileA3DCreateFromAsset(int con, AssetManager mgr, String path);
synchronized int nFileA3DCreateFromAsset(AssetManager mgr, String path) {
return rsnFileA3DCreateFromAsset(mContext, mgr, path);
}
native int rsnFileA3DGetNumIndexEntries(int con, int fileA3D);
synchronized int nFileA3DGetNumIndexEntries(int fileA3D) {
return rsnFileA3DGetNumIndexEntries(mContext, fileA3D);
@ -301,6 +310,14 @@ public class RenderScript {
synchronized int nFontCreateFromFile(String fileName, float size, int dpi) {
return rsnFontCreateFromFile(mContext, fileName, size, dpi);
}
native int rsnFontCreateFromAssetStream(int con, String name, float size, int dpi, int assetStream);
synchronized int nFontCreateFromAssetStream(String name, float size, int dpi, int assetStream) {
return rsnFontCreateFromAssetStream(mContext, name, size, dpi, assetStream);
}
native int rsnFontCreateFromAsset(int con, AssetManager mgr, String path, float size, int dpi);
synchronized int nFontCreateFromAsset(AssetManager mgr, String path, float size, int dpi) {
return rsnFontCreateFromAsset(mContext, mgr, path, size, dpi);
}
native void rsnScriptBindAllocation(int con, int script, int alloc, int slot);