I am getting a crash while running my app which uses renderscript. Unfortunately, the logcat does not give any specific details.
b = Bitmap.createBitmap(ib.getWidth(), ib.getHeight(),ib.getConfig());
Allocation mInAllocation = Allocation.createFromBitmap(mRS, inBitmap,
Allocation.MipmapControl.MIPMAP_NONE,Allocation.USAGE_SHARED);
Allocation mOutAllocation2 = Allocation.createFromBitmap(mRS,
outBitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SHARED);
...execute an algorithm from .rs file and later do the below
mOutAllocation2.copyTo(outBitmap)`;
The same code sequence runs perfectly fine, when I used USAGE_SCRIPT flag instead of USAGE_SHARED for mOutAllocation2.
Any help on why this could happen?
I read in android docs that if the allocation is of the type USAGE_SHARED, then the copy operation from allocation to the bitmap (see above) is faster.
Currently, I am seeing copies from allocation to bitmaps running into secs for decently large images (8MP and above)
I am using Nexus 10 (Android 4.3) currently.