Loading graphics/java/android/renderscript/Allocation.java +13 −4 Original line number Diff line number Diff line Loading @@ -370,11 +370,20 @@ public class Allocation extends BaseObj { */ public void syncAll(int srcLocation) { switch (srcLocation) { case USAGE_GRAPHICS_TEXTURE: case USAGE_SCRIPT: if ((mUsage & USAGE_SHARED) != 0) { copyFrom(mBitmap); } break; case USAGE_GRAPHICS_CONSTANTS: case USAGE_GRAPHICS_TEXTURE: case USAGE_GRAPHICS_VERTEX: break; case USAGE_SHARED: if ((mUsage & USAGE_SHARED) != 0) { copyTo(mBitmap); } break; default: throw new RSIllegalArgumentException("Source must be exactly one usage type."); } Loading Loading @@ -1383,7 +1392,7 @@ public class Allocation extends BaseObj { // enable optimized bitmap path only with no mipmap and script-only usage if (mips == MipmapControl.MIPMAP_NONE && t.getElement().isCompatible(Element.RGBA_8888(rs)) && usage == (USAGE_SHARED | USAGE_SCRIPT)) { usage == (USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE)) { int id = rs.nAllocationCreateBitmapBackedAllocation(t.getID(rs), mips.mID, b, usage); if (id == 0) { throw new RSRuntimeException("Load failed."); Loading Loading @@ -1454,7 +1463,7 @@ public class Allocation extends BaseObj { static public Allocation createFromBitmap(RenderScript rs, Bitmap b) { if (rs.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) { return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, USAGE_SHARED | USAGE_SCRIPT); USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE); } return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, USAGE_GRAPHICS_TEXTURE); Loading Loading @@ -1672,7 +1681,7 @@ public class Allocation extends BaseObj { if (rs.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) { return createFromBitmapResource(rs, res, id, MipmapControl.MIPMAP_NONE, USAGE_SHARED | USAGE_SCRIPT); USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE); } return createFromBitmapResource(rs, res, id, MipmapControl.MIPMAP_NONE, Loading Loading
graphics/java/android/renderscript/Allocation.java +13 −4 Original line number Diff line number Diff line Loading @@ -370,11 +370,20 @@ public class Allocation extends BaseObj { */ public void syncAll(int srcLocation) { switch (srcLocation) { case USAGE_GRAPHICS_TEXTURE: case USAGE_SCRIPT: if ((mUsage & USAGE_SHARED) != 0) { copyFrom(mBitmap); } break; case USAGE_GRAPHICS_CONSTANTS: case USAGE_GRAPHICS_TEXTURE: case USAGE_GRAPHICS_VERTEX: break; case USAGE_SHARED: if ((mUsage & USAGE_SHARED) != 0) { copyTo(mBitmap); } break; default: throw new RSIllegalArgumentException("Source must be exactly one usage type."); } Loading Loading @@ -1383,7 +1392,7 @@ public class Allocation extends BaseObj { // enable optimized bitmap path only with no mipmap and script-only usage if (mips == MipmapControl.MIPMAP_NONE && t.getElement().isCompatible(Element.RGBA_8888(rs)) && usage == (USAGE_SHARED | USAGE_SCRIPT)) { usage == (USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE)) { int id = rs.nAllocationCreateBitmapBackedAllocation(t.getID(rs), mips.mID, b, usage); if (id == 0) { throw new RSRuntimeException("Load failed."); Loading Loading @@ -1454,7 +1463,7 @@ public class Allocation extends BaseObj { static public Allocation createFromBitmap(RenderScript rs, Bitmap b) { if (rs.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) { return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, USAGE_SHARED | USAGE_SCRIPT); USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE); } return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, USAGE_GRAPHICS_TEXTURE); Loading Loading @@ -1672,7 +1681,7 @@ public class Allocation extends BaseObj { if (rs.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) { return createFromBitmapResource(rs, res, id, MipmapControl.MIPMAP_NONE, USAGE_SHARED | USAGE_SCRIPT); USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE); } return createFromBitmapResource(rs, res, id, MipmapControl.MIPMAP_NONE, Loading