diff options
| author | Jason Sams <rjsams@android.com> | 2010-12-13 15:32:35 -0800 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2010-12-13 15:32:35 -0800 |
| commit | d4b23b54445b13dacaafad97d100999abb36ea6f (patch) | |
| tree | 265a246ae22c5b726690c422bc5c5518e6d445a0 /graphics/java/android | |
| parent | 666a5ed98142867bcd6658c97210b775c828dae5 (diff) | |
| download | frameworks_base-d4b23b54445b13dacaafad97d100999abb36ea6f.zip frameworks_base-d4b23b54445b13dacaafad97d100999abb36ea6f.tar.gz frameworks_base-d4b23b54445b13dacaafad97d100999abb36ea6f.tar.bz2 | |
More API updates.
Change-Id: I754dc645ac08fa25019eed8fd8b7b3c47f178ff2
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 16 | ||||
| -rw-r--r-- | graphics/java/android/renderscript/Mesh.java | 8 | ||||
| -rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 6 |
3 files changed, 13 insertions, 17 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index b937721..30475bd 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -378,12 +378,12 @@ public class Allocation extends BaseObj { mBitmapOptions.inScaled = false; } - static public Allocation createTyped(RenderScript rs, Type type, int usage) { + static public Allocation createTyped(RenderScript rs, Type type, MipmapControl mc, int usage) { rs.validate(); if (type.getID() == 0) { throw new RSInvalidStateException("Bad Type"); } - int id = rs.nAllocationCreateTyped(type.getID(), usage); + int id = rs.nAllocationCreateTyped(type.getID(), mc.mID, usage); if (id == 0) { throw new RSRuntimeException("Allocation creation failed."); } @@ -391,7 +391,7 @@ public class Allocation extends BaseObj { } static public Allocation createTyped(RenderScript rs, Type type) { - return createTyped(rs, type, USAGE_ALL); + return createTyped(rs, type, MipmapControl.MIPMAP_NONE, USAGE_SCRIPT); } static public Allocation createSized(RenderScript rs, Element e, @@ -401,7 +401,7 @@ public class Allocation extends BaseObj { b.setX(count); Type t = b.create(); - int id = rs.nAllocationCreateTyped(t.getID(), usage); + int id = rs.nAllocationCreateTyped(t.getID(), MipmapControl.MIPMAP_NONE.mID, usage); if (id == 0) { throw new RSRuntimeException("Allocation creation failed."); } @@ -409,7 +409,7 @@ public class Allocation extends BaseObj { } static public Allocation createSized(RenderScript rs, Element e, int count) { - return createSized(rs, e, count, USAGE_ALL); + return createSized(rs, e, count, USAGE_SCRIPT); } static private Element elementFromBitmap(RenderScript rs, Bitmap b) { @@ -458,7 +458,7 @@ public class Allocation extends BaseObj { if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } - return createFromBitmap(rs, b, mc, USAGE_ALL); + return createFromBitmap(rs, b, mc, USAGE_GRAPHICS_TEXTURE); } static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b, @@ -507,7 +507,7 @@ public class Allocation extends BaseObj { if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } - return createCubemapFromBitmap(rs, b, mc, layout, USAGE_ALL); + return createCubemapFromBitmap(rs, b, mc, layout, USAGE_GRAPHICS_TEXTURE); } static public Allocation createFromBitmapResource(RenderScript rs, @@ -532,7 +532,7 @@ public class Allocation extends BaseObj { if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } - return createFromBitmapResource(rs, res, id, mc, USAGE_ALL); + return createFromBitmapResource(rs, res, id, mc, USAGE_GRAPHICS_TEXTURE); } static public Allocation createFromString(RenderScript rs, diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java index 44faa32..b103af4 100644 --- a/graphics/java/android/renderscript/Mesh.java +++ b/graphics/java/android/renderscript/Mesh.java @@ -77,18 +77,14 @@ public class Mesh extends BaseObj { for(int i = 0; i < vtxCount; i ++) { if(vtxIDs[i] != 0) { - mVertexBuffers[i] = new Allocation(vtxIDs[i], mRS, null, - Allocation.USAGE_GRAPHICS_VERTEX | - Allocation.USAGE_SCRIPT); + mVertexBuffers[i] = new Allocation(vtxIDs[i], mRS, null, Allocation.USAGE_SCRIPT); mVertexBuffers[i].updateFromNative(); } } for(int i = 0; i < idxCount; i ++) { if(idxIDs[i] != 0) { - mIndexBuffers[i] = new Allocation(idxIDs[i], mRS, null, - Allocation.USAGE_GRAPHICS_VERTEX | - Allocation.USAGE_SCRIPT); + mIndexBuffers[i] = new Allocation(idxIDs[i], mRS, null, 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 3fa9965..c6dcff5 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -191,9 +191,9 @@ public class RenderScript { rsnTypeGetNativeData(mContext, id, typeData); } - native int rsnAllocationCreateTyped(int con, int type, int usage); - synchronized int nAllocationCreateTyped(int type, int usage) { - return rsnAllocationCreateTyped(mContext, type, usage); + native int rsnAllocationCreateTyped(int con, int type, int mip, int usage); + synchronized int nAllocationCreateTyped(int type, int mip, int usage) { + return rsnAllocationCreateTyped(mContext, type, mip, usage); } native int rsnAllocationCreateFromBitmap(int con, int type, int mip, Bitmap bmp, int usage); synchronized int nAllocationCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) { |
