Loading graphics/java/android/renderscript/Allocation.java +5 −1 Original line number Diff line number Diff line Loading @@ -194,11 +194,15 @@ public class Allocation extends BaseObj { mRS.nAllocationRead(mID, d); } public void resize(int dimX) { public synchronized void resize(int dimX) { if ((mType.getY() > 0)|| (mType.getZ() > 0) || mType.getFaces() || mType.getLOD()) { throw new IllegalStateException("Resize only support for 1D allocations at this time."); } mRS.nAllocationResize1D(mID, dimX); int typeID = mRS.nAllocationGetType(mID); mType = new Type(typeID, mRS); mType.updateFromNative(); } /* Loading graphics/java/android/renderscript/Script.java +1 −16 Original line number Diff line number Diff line Loading @@ -112,12 +112,10 @@ public class Script extends BaseObj { public static class FieldBase { protected Element mElement; protected Type mType; protected Allocation mAllocation; protected void init(RenderScript rs, int dimx) { mAllocation = Allocation.createSized(rs, mElement, dimx); mType = mAllocation.getType(); } protected FieldBase() { Loading @@ -128,7 +126,7 @@ public class Script extends BaseObj { } public Type getType() { return mType; return mAllocation.getType(); } public Allocation getAllocation() { Loading @@ -138,19 +136,6 @@ public class Script extends BaseObj { //@Override public void updateAllocation() { } // /* public class ScriptField_UserField extends android.renderscript.Script.FieldBase { protected } */ } } graphics/jni/android_renderscript_RenderScript.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ static jint nAllocationCreateTyped(JNIEnv *_env, jobject _this, RsContext con, jint e) { LOG_API("nAllocationCreateTyped, con(%p), e(%p)", con, (RsElement)e); return (jint) rsAllocationCreateTyped(con, (RsElement)e); return (jint) rsaAllocationCreateTyped(con, (RsElement)e); } static void Loading Loading @@ -428,7 +428,7 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint dst const int w = bitmap.width(); const int h = bitmap.height(); const void* ptr = bitmap.getPixels(); jint id = (jint)rsAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); bitmap.unlockPixels(); return id; } Loading Loading @@ -488,7 +488,7 @@ 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)rsAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); bitmap.unlockPixels(); return id; } Loading libs/rs/RenderScript.h +2 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,8 @@ typedef struct { // Async commands for returning new IDS RsType rsaTypeCreate(RsContext, RsElement, uint32_t dimCount, const RsDimension *dims, const uint32_t *vals); RsAllocation rsaAllocationCreateTyped(RsContext rsc, RsType vtype); RsAllocation rsaAllocationCreateFromBitmap(RsContext con, uint32_t w, uint32_t h, RsElement _dst, RsElement _src, bool genMips, const void *data); #ifndef NO_RS_FUNCS Loading libs/rs/rs.spec +0 −22 Original line number Diff line number Diff line Loading @@ -104,17 +104,6 @@ TypeGetNativeData { param uint32_t typeDataSize } AllocationCreateTyped { param RsType type ret RsAllocation } AllocationCreateSized { param RsElement e param size_t count ret RsAllocation } AllocationUpdateFromBitmap { param RsAllocation alloc param RsElement srcFmt Loading @@ -129,17 +118,6 @@ AllocationCreateBitmapRef { ret RsAllocation } AllocationCreateFromBitmap { param uint32_t width param uint32_t height param RsElement dstFmt param RsElement srcFmt param bool genMips param const void * data ret RsAllocation } AllocationUploadToTexture { param RsAllocation alloc param bool genMipMaps Loading Loading
graphics/java/android/renderscript/Allocation.java +5 −1 Original line number Diff line number Diff line Loading @@ -194,11 +194,15 @@ public class Allocation extends BaseObj { mRS.nAllocationRead(mID, d); } public void resize(int dimX) { public synchronized void resize(int dimX) { if ((mType.getY() > 0)|| (mType.getZ() > 0) || mType.getFaces() || mType.getLOD()) { throw new IllegalStateException("Resize only support for 1D allocations at this time."); } mRS.nAllocationResize1D(mID, dimX); int typeID = mRS.nAllocationGetType(mID); mType = new Type(typeID, mRS); mType.updateFromNative(); } /* Loading
graphics/java/android/renderscript/Script.java +1 −16 Original line number Diff line number Diff line Loading @@ -112,12 +112,10 @@ public class Script extends BaseObj { public static class FieldBase { protected Element mElement; protected Type mType; protected Allocation mAllocation; protected void init(RenderScript rs, int dimx) { mAllocation = Allocation.createSized(rs, mElement, dimx); mType = mAllocation.getType(); } protected FieldBase() { Loading @@ -128,7 +126,7 @@ public class Script extends BaseObj { } public Type getType() { return mType; return mAllocation.getType(); } public Allocation getAllocation() { Loading @@ -138,19 +136,6 @@ public class Script extends BaseObj { //@Override public void updateAllocation() { } // /* public class ScriptField_UserField extends android.renderscript.Script.FieldBase { protected } */ } }
graphics/jni/android_renderscript_RenderScript.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ static jint nAllocationCreateTyped(JNIEnv *_env, jobject _this, RsContext con, jint e) { LOG_API("nAllocationCreateTyped, con(%p), e(%p)", con, (RsElement)e); return (jint) rsAllocationCreateTyped(con, (RsElement)e); return (jint) rsaAllocationCreateTyped(con, (RsElement)e); } static void Loading Loading @@ -428,7 +428,7 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint dst const int w = bitmap.width(); const int h = bitmap.height(); const void* ptr = bitmap.getPixels(); jint id = (jint)rsAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); bitmap.unlockPixels(); return id; } Loading Loading @@ -488,7 +488,7 @@ 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)rsAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); jint id = (jint)rsaAllocationCreateFromBitmap(con, w, h, (RsElement)dstFmt, e, genMips, ptr); bitmap.unlockPixels(); return id; } Loading
libs/rs/RenderScript.h +2 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,8 @@ typedef struct { // Async commands for returning new IDS RsType rsaTypeCreate(RsContext, RsElement, uint32_t dimCount, const RsDimension *dims, const uint32_t *vals); RsAllocation rsaAllocationCreateTyped(RsContext rsc, RsType vtype); RsAllocation rsaAllocationCreateFromBitmap(RsContext con, uint32_t w, uint32_t h, RsElement _dst, RsElement _src, bool genMips, const void *data); #ifndef NO_RS_FUNCS Loading
libs/rs/rs.spec +0 −22 Original line number Diff line number Diff line Loading @@ -104,17 +104,6 @@ TypeGetNativeData { param uint32_t typeDataSize } AllocationCreateTyped { param RsType type ret RsAllocation } AllocationCreateSized { param RsElement e param size_t count ret RsAllocation } AllocationUpdateFromBitmap { param RsAllocation alloc param RsElement srcFmt Loading @@ -129,17 +118,6 @@ AllocationCreateBitmapRef { ret RsAllocation } AllocationCreateFromBitmap { param uint32_t width param uint32_t height param RsElement dstFmt param RsElement srcFmt param bool genMips param const void * data ret RsAllocation } AllocationUploadToTexture { param RsAllocation alloc param bool genMipMaps Loading