Loading graphics/java/android/renderscript/Element.java +14 −17 Original line number Diff line number Diff line Loading @@ -72,12 +72,6 @@ public class Element extends BaseObj { public enum DataKind { USER (0), COLOR (1), POSITION (2), TEXTURE (3), NORMAL (4), INDEX (5), POINT_SIZE(6), PIXEL_L (7), PIXEL_A (8), Loading Loading @@ -105,6 +99,20 @@ public class Element extends BaseObj { return rs.mElement_I8; } public static Element U16(RenderScript rs) { if(rs.mElement_U16 == null) { rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16); } return rs.mElement_U16; } public static Element I16(RenderScript rs) { if(rs.mElement_I16 == null) { rs.mElement_I16 = createUser(rs, DataType.SIGNED_16); } return rs.mElement_I16; } public static Element U32(RenderScript rs) { if(rs.mElement_U32 == null) { rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32); Loading Loading @@ -239,13 +247,6 @@ public class Element extends BaseObj { return rs.mElement_RGBA_8888; } public static Element INDEX_16(RenderScript rs) { if(rs.mElement_INDEX_16 == null) { rs.mElement_INDEX_16 = createIndex(rs); } return rs.mElement_INDEX_16; } public static Element F32_2(RenderScript rs) { if(rs.mElement_FLOAT_2 == null) { rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2); Loading Loading @@ -314,10 +315,6 @@ public class Element extends BaseObj { return new Element(rs, dt, DataKind.USER, false, size); } public static Element createIndex(RenderScript rs) { return new Element(rs, DataType.UNSIGNED_16, DataKind.INDEX, false, 1); } public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) { if (!(dk == DataKind.PIXEL_L || dk == DataKind.PIXEL_A || Loading graphics/java/android/renderscript/RenderScript.java +0 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,6 @@ public class RenderScript { Element mElement_RGBA_4444; Element mElement_RGBA_8888; Element mElement_INDEX_16; Element mElement_FLOAT_2; Element mElement_FLOAT_3; Element mElement_FLOAT_4; Loading graphics/java/android/renderscript/SimpleMesh.java +1 −1 Original line number Diff line number Diff line Loading @@ -332,7 +332,7 @@ public class SimpleMesh extends BaseObj { Builder smb = new Builder(mRS); smb.addVertexType(mElement, mVtxCount / floatCount); smb.setIndexType(Element.createIndex(mRS), mIndexCount); smb.setIndexType(Element.U16(mRS), mIndexCount); smb.setPrimitive(Primitive.TRIANGLE); SimpleMesh sm = smb.create(); Loading libs/rs/RenderScript.h +2 −9 Original line number Diff line number Diff line Loading @@ -103,19 +103,12 @@ enum RsDataType { enum RsDataKind { RS_KIND_USER, RS_KIND_COLOR, RS_KIND_POSITION, RS_KIND_TEXTURE, RS_KIND_NORMAL, RS_KIND_INDEX, RS_KIND_POINT_SIZE, RS_KIND_PIXEL_L, RS_KIND_PIXEL_L = 7, RS_KIND_PIXEL_A, RS_KIND_PIXEL_LA, RS_KIND_PIXEL_RGB, RS_KIND_PIXEL_RGBA, }; enum RsSamplerParam { Loading libs/rs/java/Fountain/res/raw/fountain.rs +2 −15 Original line number Diff line number Diff line Loading @@ -40,17 +40,7 @@ int root() { return 1; } // Putting the overloadable attribute on this function breaks rendering // appears to be a bug. static uchar4 /*__attribute__((overloadable))*/ pack(float r, float g, float b) { uchar4 c; c.x = (uchar)(r * 255.f); c.y = (uchar)(g * 255.f); c.z = (uchar)(b * 255.f); c.w = 255; return c; } #pragma rs export_func(addParticles) void addParticles(int rate, int x, int y) { Loading @@ -63,10 +53,7 @@ void addParticles(int rate, int x, int y) float rMax = ((float)rate) * 0.005f; int size = rsAllocationGetDimX(rsGetAllocation(point)); //uchar4 c = rsPackColorTo8888(partColor.x, partColor.y, partColor.z); uchar4 c = pack(partColor.x, partColor.y, partColor.z); c.x = 255; c.w = 255; uchar4 c = rsPackColorTo8888(partColor.x, partColor.y, partColor.z); //rsDebug("color ", ((int *)&c)[0]); Point_t * np = &point[newPart]; Loading Loading
graphics/java/android/renderscript/Element.java +14 −17 Original line number Diff line number Diff line Loading @@ -72,12 +72,6 @@ public class Element extends BaseObj { public enum DataKind { USER (0), COLOR (1), POSITION (2), TEXTURE (3), NORMAL (4), INDEX (5), POINT_SIZE(6), PIXEL_L (7), PIXEL_A (8), Loading Loading @@ -105,6 +99,20 @@ public class Element extends BaseObj { return rs.mElement_I8; } public static Element U16(RenderScript rs) { if(rs.mElement_U16 == null) { rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16); } return rs.mElement_U16; } public static Element I16(RenderScript rs) { if(rs.mElement_I16 == null) { rs.mElement_I16 = createUser(rs, DataType.SIGNED_16); } return rs.mElement_I16; } public static Element U32(RenderScript rs) { if(rs.mElement_U32 == null) { rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32); Loading Loading @@ -239,13 +247,6 @@ public class Element extends BaseObj { return rs.mElement_RGBA_8888; } public static Element INDEX_16(RenderScript rs) { if(rs.mElement_INDEX_16 == null) { rs.mElement_INDEX_16 = createIndex(rs); } return rs.mElement_INDEX_16; } public static Element F32_2(RenderScript rs) { if(rs.mElement_FLOAT_2 == null) { rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2); Loading Loading @@ -314,10 +315,6 @@ public class Element extends BaseObj { return new Element(rs, dt, DataKind.USER, false, size); } public static Element createIndex(RenderScript rs) { return new Element(rs, DataType.UNSIGNED_16, DataKind.INDEX, false, 1); } public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) { if (!(dk == DataKind.PIXEL_L || dk == DataKind.PIXEL_A || Loading
graphics/java/android/renderscript/RenderScript.java +0 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,6 @@ public class RenderScript { Element mElement_RGBA_4444; Element mElement_RGBA_8888; Element mElement_INDEX_16; Element mElement_FLOAT_2; Element mElement_FLOAT_3; Element mElement_FLOAT_4; Loading
graphics/java/android/renderscript/SimpleMesh.java +1 −1 Original line number Diff line number Diff line Loading @@ -332,7 +332,7 @@ public class SimpleMesh extends BaseObj { Builder smb = new Builder(mRS); smb.addVertexType(mElement, mVtxCount / floatCount); smb.setIndexType(Element.createIndex(mRS), mIndexCount); smb.setIndexType(Element.U16(mRS), mIndexCount); smb.setPrimitive(Primitive.TRIANGLE); SimpleMesh sm = smb.create(); Loading
libs/rs/RenderScript.h +2 −9 Original line number Diff line number Diff line Loading @@ -103,19 +103,12 @@ enum RsDataType { enum RsDataKind { RS_KIND_USER, RS_KIND_COLOR, RS_KIND_POSITION, RS_KIND_TEXTURE, RS_KIND_NORMAL, RS_KIND_INDEX, RS_KIND_POINT_SIZE, RS_KIND_PIXEL_L, RS_KIND_PIXEL_L = 7, RS_KIND_PIXEL_A, RS_KIND_PIXEL_LA, RS_KIND_PIXEL_RGB, RS_KIND_PIXEL_RGBA, }; enum RsSamplerParam { Loading
libs/rs/java/Fountain/res/raw/fountain.rs +2 −15 Original line number Diff line number Diff line Loading @@ -40,17 +40,7 @@ int root() { return 1; } // Putting the overloadable attribute on this function breaks rendering // appears to be a bug. static uchar4 /*__attribute__((overloadable))*/ pack(float r, float g, float b) { uchar4 c; c.x = (uchar)(r * 255.f); c.y = (uchar)(g * 255.f); c.z = (uchar)(b * 255.f); c.w = 255; return c; } #pragma rs export_func(addParticles) void addParticles(int rate, int x, int y) { Loading @@ -63,10 +53,7 @@ void addParticles(int rate, int x, int y) float rMax = ((float)rate) * 0.005f; int size = rsAllocationGetDimX(rsGetAllocation(point)); //uchar4 c = rsPackColorTo8888(partColor.x, partColor.y, partColor.z); uchar4 c = pack(partColor.x, partColor.y, partColor.z); c.x = 255; c.w = 255; uchar4 c = rsPackColorTo8888(partColor.x, partColor.y, partColor.z); //rsDebug("color ", ((int *)&c)[0]); Point_t * np = &point[newPart]; Loading