Loading graphics/java/android/renderscript/Allocation.java +15 −15 Original line number Diff line number Diff line Loading @@ -452,13 +452,9 @@ public class Allocation extends BaseObj { return new Allocation(id, rs, t, usage); } static public Allocation createFromBitmap(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips) { MipmapControl mc = MipmapControl.MIPMAP_NONE; if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } return createFromBitmap(rs, b, mc, USAGE_GRAPHICS_TEXTURE); static public Allocation createFromBitmap(RenderScript rs, Bitmap b) { return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, USAGE_GRAPHICS_TEXTURE); } static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b, Loading Loading @@ -500,14 +496,9 @@ public class Allocation extends BaseObj { } static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips, CubemapLayout layout) { MipmapControl mc = MipmapControl.MIPMAP_NONE; if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } return createCubemapFromBitmap(rs, b, mc, layout, USAGE_GRAPHICS_TEXTURE); return createCubemapFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, layout, USAGE_GRAPHICS_TEXTURE); } static public Allocation createFromBitmapResource(RenderScript rs, Loading @@ -523,6 +514,15 @@ public class Allocation extends BaseObj { return alloc; } static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id) { return createFromBitmapResource(rs, res, id, MipmapControl.MIPMAP_NONE, USAGE_GRAPHICS_TEXTURE); } /* static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id, Loading @@ -534,7 +534,7 @@ public class Allocation extends BaseObj { } return createFromBitmapResource(rs, res, id, mc, USAGE_GRAPHICS_TEXTURE); } */ static public Allocation createFromString(RenderScript rs, String str, int usage) { Loading libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java +3 −3 Original line number Diff line number Diff line Loading @@ -128,9 +128,9 @@ public class SceneGraphRS { } private void loadImage() { mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Element.RGB_565(mRS), true); mGridImage.uploadToTexture(0); mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); mScript.set_gTGrid(mGridImage); } Loading libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java +3 −3 Original line number Diff line number Diff line Loading @@ -124,9 +124,9 @@ public class SimpleModelRS { } private void loadImage() { mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Element.RGB_565(mRS), true); mGridImage.uploadToTexture(0); mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); mScript.set_gTGrid(mGridImage); } Loading libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java +8 −9 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.renderscript.*; import android.renderscript.Allocation.CubemapLayout; import android.renderscript.Allocation.MipmapControl; import android.renderscript.Program.TextureType; import android.renderscript.ProgramStore.DepthFunc; import android.renderscript.Sampler.Value; Loading Loading @@ -284,17 +285,16 @@ public class RsBenchRS { } private Allocation loadTextureRGB(int id) { final Allocation allocation = Allocation.createFromBitmapResource(mRS, mRes, id, Element.RGB_565(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmapResource(mRS, mRes, id, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private Allocation loadTextureARGB(int id) { Bitmap b = BitmapFactory.decodeResource(mRes, id, mOptionsARGB); final Allocation allocation = Allocation.createFromBitmap(mRS, b, Element.RGBA_8888(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmap(mRS, b, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private void loadImages() { Loading @@ -303,9 +303,8 @@ public class RsBenchRS { mTexTransparent = loadTextureARGB(R.drawable.leaf); mTexChecker = loadTextureRGB(R.drawable.checker); Bitmap b = BitmapFactory.decodeResource(mRes, R.drawable.cubemap_test); mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Element.RGB_565(mRS), false, mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Allocation.CubemapLayout.VERTICAL_FACE_LIST); mTexCube.uploadToTexture(0); mScript.set_gTexTorus(mTexTorus); mScript.set_gTexOpaque(mTexOpaque); Loading libs/rs/java/Samples/src/com/android/samples/RsRenderStatesRS.java +7 −9 Original line number Diff line number Diff line Loading @@ -274,17 +274,16 @@ public class RsRenderStatesRS { } private Allocation loadTextureRGB(int id) { final Allocation allocation = Allocation.createFromBitmapResource(mRS, mRes, id, Element.RGB_565(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmapResource(mRS, mRes, id, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private Allocation loadTextureARGB(int id) { Bitmap b = BitmapFactory.decodeResource(mRes, id, mOptionsARGB); final Allocation allocation = Allocation.createFromBitmap(mRS, b, Element.RGBA_8888(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmap(mRS, b, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private void loadImages() { Loading @@ -293,9 +292,8 @@ public class RsRenderStatesRS { mTexTransparent = loadTextureARGB(R.drawable.leaf); mTexChecker = loadTextureRGB(R.drawable.checker); Bitmap b = BitmapFactory.decodeResource(mRes, R.drawable.cubemap_test); mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Element.RGB_565(mRS), false, mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Allocation.CubemapLayout.VERTICAL_FACE_LIST); mTexCube.uploadToTexture(0); mScript.set_gTexTorus(mTexTorus); mScript.set_gTexOpaque(mTexOpaque); Loading Loading
graphics/java/android/renderscript/Allocation.java +15 −15 Original line number Diff line number Diff line Loading @@ -452,13 +452,9 @@ public class Allocation extends BaseObj { return new Allocation(id, rs, t, usage); } static public Allocation createFromBitmap(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips) { MipmapControl mc = MipmapControl.MIPMAP_NONE; if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } return createFromBitmap(rs, b, mc, USAGE_GRAPHICS_TEXTURE); static public Allocation createFromBitmap(RenderScript rs, Bitmap b) { return createFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, USAGE_GRAPHICS_TEXTURE); } static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b, Loading Loading @@ -500,14 +496,9 @@ public class Allocation extends BaseObj { } static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips, CubemapLayout layout) { MipmapControl mc = MipmapControl.MIPMAP_NONE; if (genMips) { mc = MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE; } return createCubemapFromBitmap(rs, b, mc, layout, USAGE_GRAPHICS_TEXTURE); return createCubemapFromBitmap(rs, b, MipmapControl.MIPMAP_NONE, layout, USAGE_GRAPHICS_TEXTURE); } static public Allocation createFromBitmapResource(RenderScript rs, Loading @@ -523,6 +514,15 @@ public class Allocation extends BaseObj { return alloc; } static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id) { return createFromBitmapResource(rs, res, id, MipmapControl.MIPMAP_NONE, USAGE_GRAPHICS_TEXTURE); } /* static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id, Loading @@ -534,7 +534,7 @@ public class Allocation extends BaseObj { } return createFromBitmapResource(rs, res, id, mc, USAGE_GRAPHICS_TEXTURE); } */ static public Allocation createFromString(RenderScript rs, String str, int usage) { Loading
libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java +3 −3 Original line number Diff line number Diff line Loading @@ -128,9 +128,9 @@ public class SceneGraphRS { } private void loadImage() { mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Element.RGB_565(mRS), true); mGridImage.uploadToTexture(0); mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); mScript.set_gTGrid(mGridImage); } Loading
libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java +3 −3 Original line number Diff line number Diff line Loading @@ -124,9 +124,9 @@ public class SimpleModelRS { } private void loadImage() { mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Element.RGB_565(mRS), true); mGridImage.uploadToTexture(0); mGridImage = Allocation.createFromBitmapResource(mRS, mRes, R.drawable.robot, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); mScript.set_gTGrid(mGridImage); } Loading
libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java +8 −9 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.renderscript.*; import android.renderscript.Allocation.CubemapLayout; import android.renderscript.Allocation.MipmapControl; import android.renderscript.Program.TextureType; import android.renderscript.ProgramStore.DepthFunc; import android.renderscript.Sampler.Value; Loading Loading @@ -284,17 +285,16 @@ public class RsBenchRS { } private Allocation loadTextureRGB(int id) { final Allocation allocation = Allocation.createFromBitmapResource(mRS, mRes, id, Element.RGB_565(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmapResource(mRS, mRes, id, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private Allocation loadTextureARGB(int id) { Bitmap b = BitmapFactory.decodeResource(mRes, id, mOptionsARGB); final Allocation allocation = Allocation.createFromBitmap(mRS, b, Element.RGBA_8888(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmap(mRS, b, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private void loadImages() { Loading @@ -303,9 +303,8 @@ public class RsBenchRS { mTexTransparent = loadTextureARGB(R.drawable.leaf); mTexChecker = loadTextureRGB(R.drawable.checker); Bitmap b = BitmapFactory.decodeResource(mRes, R.drawable.cubemap_test); mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Element.RGB_565(mRS), false, mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Allocation.CubemapLayout.VERTICAL_FACE_LIST); mTexCube.uploadToTexture(0); mScript.set_gTexTorus(mTexTorus); mScript.set_gTexOpaque(mTexOpaque); Loading
libs/rs/java/Samples/src/com/android/samples/RsRenderStatesRS.java +7 −9 Original line number Diff line number Diff line Loading @@ -274,17 +274,16 @@ public class RsRenderStatesRS { } private Allocation loadTextureRGB(int id) { final Allocation allocation = Allocation.createFromBitmapResource(mRS, mRes, id, Element.RGB_565(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmapResource(mRS, mRes, id, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private Allocation loadTextureARGB(int id) { Bitmap b = BitmapFactory.decodeResource(mRes, id, mOptionsARGB); final Allocation allocation = Allocation.createFromBitmap(mRS, b, Element.RGBA_8888(mRS), true); allocation.uploadToTexture(0); return allocation; return Allocation.createFromBitmap(mRS, b, Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE, Allocation.USAGE_GRAPHICS_TEXTURE); } private void loadImages() { Loading @@ -293,9 +292,8 @@ public class RsRenderStatesRS { mTexTransparent = loadTextureARGB(R.drawable.leaf); mTexChecker = loadTextureRGB(R.drawable.checker); Bitmap b = BitmapFactory.decodeResource(mRes, R.drawable.cubemap_test); mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Element.RGB_565(mRS), false, mTexCube = Allocation.createCubemapFromBitmap(mRS, b, Allocation.CubemapLayout.VERTICAL_FACE_LIST); mTexCube.uploadToTexture(0); mScript.set_gTexTorus(mTexTorus); mScript.set_gTexOpaque(mTexOpaque); Loading