Merge "Made Element accessors thread-safe"

This commit is contained in:
Yang Ni
2016-04-20 18:14:08 +00:00
committed by Gerrit Code Review
3 changed files with 569 additions and 270 deletions

View File

@@ -311,8 +311,12 @@ public class Element extends BaseObj {
* @return Element * @return Element
*/ */
public static Element BOOLEAN(RenderScript rs) { public static Element BOOLEAN(RenderScript rs) {
if(rs.mElement_BOOLEAN == null) { if (rs.mElement_BOOLEAN == null) {
rs.mElement_BOOLEAN = createUser(rs, DataType.BOOLEAN); synchronized (rs) {
if (rs.mElement_BOOLEAN == null) {
rs.mElement_BOOLEAN = createUser(rs, DataType.BOOLEAN);
}
}
} }
return rs.mElement_BOOLEAN; return rs.mElement_BOOLEAN;
} }
@@ -325,8 +329,12 @@ public class Element extends BaseObj {
* @return Element * @return Element
*/ */
public static Element U8(RenderScript rs) { public static Element U8(RenderScript rs) {
if(rs.mElement_U8 == null) { if (rs.mElement_U8 == null) {
rs.mElement_U8 = createUser(rs, DataType.UNSIGNED_8); synchronized (rs) {
if (rs.mElement_U8 == null) {
rs.mElement_U8 = createUser(rs, DataType.UNSIGNED_8);
}
}
} }
return rs.mElement_U8; return rs.mElement_U8;
} }
@@ -339,436 +347,683 @@ public class Element extends BaseObj {
* @return Element * @return Element
*/ */
public static Element I8(RenderScript rs) { public static Element I8(RenderScript rs) {
if(rs.mElement_I8 == null) { if (rs.mElement_I8 == null) {
rs.mElement_I8 = createUser(rs, DataType.SIGNED_8); synchronized (rs) {
if (rs.mElement_I8 == null) {
rs.mElement_I8 = createUser(rs, DataType.SIGNED_8);
}
}
} }
return rs.mElement_I8; return rs.mElement_I8;
} }
public static Element U16(RenderScript rs) { public static Element U16(RenderScript rs) {
if(rs.mElement_U16 == null) { if (rs.mElement_U16 == null) {
rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16); synchronized (rs) {
if (rs.mElement_U16 == null) {
rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16);
}
}
} }
return rs.mElement_U16; return rs.mElement_U16;
} }
public static Element I16(RenderScript rs) { public static Element I16(RenderScript rs) {
if(rs.mElement_I16 == null) { if (rs.mElement_I16 == null) {
rs.mElement_I16 = createUser(rs, DataType.SIGNED_16); synchronized (rs) {
if (rs.mElement_I16 == null) {
rs.mElement_I16 = createUser(rs, DataType.SIGNED_16);
}
}
} }
return rs.mElement_I16; return rs.mElement_I16;
} }
public static Element U32(RenderScript rs) { public static Element U32(RenderScript rs) {
if(rs.mElement_U32 == null) { if (rs.mElement_U32 == null) {
rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32); synchronized (rs) {
if (rs.mElement_U32 == null) {
rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32);
}
}
} }
return rs.mElement_U32; return rs.mElement_U32;
} }
public static Element I32(RenderScript rs) { public static Element I32(RenderScript rs) {
if(rs.mElement_I32 == null) { if (rs.mElement_I32 == null) {
rs.mElement_I32 = createUser(rs, DataType.SIGNED_32); synchronized (rs) {
if (rs.mElement_I32 == null) {
rs.mElement_I32 = createUser(rs, DataType.SIGNED_32);
}
}
} }
return rs.mElement_I32; return rs.mElement_I32;
} }
public static Element U64(RenderScript rs) { public static Element U64(RenderScript rs) {
if(rs.mElement_U64 == null) { if (rs.mElement_U64 == null) {
rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64); synchronized (rs) {
if (rs.mElement_U64 == null) {
rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64);
}
}
} }
return rs.mElement_U64; return rs.mElement_U64;
} }
public static Element I64(RenderScript rs) { public static Element I64(RenderScript rs) {
if(rs.mElement_I64 == null) { if (rs.mElement_I64 == null) {
rs.mElement_I64 = createUser(rs, DataType.SIGNED_64); synchronized (rs) {
if (rs.mElement_I64 == null) {
rs.mElement_I64 = createUser(rs, DataType.SIGNED_64);
}
}
} }
return rs.mElement_I64; return rs.mElement_I64;
} }
public static Element F16(RenderScript rs) { public static Element F16(RenderScript rs) {
if(rs.mElement_F16 == null) { if (rs.mElement_F16 == null) {
rs.mElement_F16 = createUser(rs, DataType.FLOAT_16); synchronized (rs) {
if (rs.mElement_F16 == null) {
rs.mElement_F16 = createUser(rs, DataType.FLOAT_16);
}
}
} }
return rs.mElement_F16; return rs.mElement_F16;
} }
public static Element F32(RenderScript rs) { public static Element F32(RenderScript rs) {
if(rs.mElement_F32 == null) { if (rs.mElement_F32 == null) {
rs.mElement_F32 = createUser(rs, DataType.FLOAT_32); synchronized (rs) {
if (rs.mElement_F32 == null) {
rs.mElement_F32 = createUser(rs, DataType.FLOAT_32);
}
}
} }
return rs.mElement_F32; return rs.mElement_F32;
} }
public static Element F64(RenderScript rs) { public static Element F64(RenderScript rs) {
if(rs.mElement_F64 == null) { if (rs.mElement_F64 == null) {
rs.mElement_F64 = createUser(rs, DataType.FLOAT_64); synchronized (rs) {
if (rs.mElement_F64 == null) {
rs.mElement_F64 = createUser(rs, DataType.FLOAT_64);
}
}
} }
return rs.mElement_F64; return rs.mElement_F64;
} }
public static Element ELEMENT(RenderScript rs) { public static Element ELEMENT(RenderScript rs) {
if(rs.mElement_ELEMENT == null) { if (rs.mElement_ELEMENT == null) {
rs.mElement_ELEMENT = createUser(rs, DataType.RS_ELEMENT); synchronized (rs) {
if (rs.mElement_ELEMENT == null) {
rs.mElement_ELEMENT = createUser(rs, DataType.RS_ELEMENT);
}
}
} }
return rs.mElement_ELEMENT; return rs.mElement_ELEMENT;
} }
public static Element TYPE(RenderScript rs) { public static Element TYPE(RenderScript rs) {
if(rs.mElement_TYPE == null) { if (rs.mElement_TYPE == null) {
rs.mElement_TYPE = createUser(rs, DataType.RS_TYPE); synchronized (rs) {
if (rs.mElement_TYPE == null) {
rs.mElement_TYPE = createUser(rs, DataType.RS_TYPE);
}
}
} }
return rs.mElement_TYPE; return rs.mElement_TYPE;
} }
public static Element ALLOCATION(RenderScript rs) { public static Element ALLOCATION(RenderScript rs) {
if(rs.mElement_ALLOCATION == null) { if (rs.mElement_ALLOCATION == null) {
rs.mElement_ALLOCATION = createUser(rs, DataType.RS_ALLOCATION); synchronized (rs) {
if (rs.mElement_ALLOCATION == null) {
rs.mElement_ALLOCATION = createUser(rs, DataType.RS_ALLOCATION);
}
}
} }
return rs.mElement_ALLOCATION; return rs.mElement_ALLOCATION;
} }
public static Element SAMPLER(RenderScript rs) { public static Element SAMPLER(RenderScript rs) {
if(rs.mElement_SAMPLER == null) { if (rs.mElement_SAMPLER == null) {
rs.mElement_SAMPLER = createUser(rs, DataType.RS_SAMPLER); synchronized (rs) {
if (rs.mElement_SAMPLER == null) {
rs.mElement_SAMPLER = createUser(rs, DataType.RS_SAMPLER);
}
}
} }
return rs.mElement_SAMPLER; return rs.mElement_SAMPLER;
} }
public static Element SCRIPT(RenderScript rs) { public static Element SCRIPT(RenderScript rs) {
if(rs.mElement_SCRIPT == null) { if (rs.mElement_SCRIPT == null) {
rs.mElement_SCRIPT = createUser(rs, DataType.RS_SCRIPT); synchronized (rs) {
if (rs.mElement_SCRIPT == null) {
rs.mElement_SCRIPT = createUser(rs, DataType.RS_SCRIPT);
}
}
} }
return rs.mElement_SCRIPT; return rs.mElement_SCRIPT;
} }
public static Element MESH(RenderScript rs) { public static Element MESH(RenderScript rs) {
if(rs.mElement_MESH == null) { if (rs.mElement_MESH == null) {
rs.mElement_MESH = createUser(rs, DataType.RS_MESH); synchronized (rs) {
if (rs.mElement_MESH == null) {
rs.mElement_MESH = createUser(rs, DataType.RS_MESH);
}
}
} }
return rs.mElement_MESH; return rs.mElement_MESH;
} }
public static Element PROGRAM_FRAGMENT(RenderScript rs) { public static Element PROGRAM_FRAGMENT(RenderScript rs) {
if(rs.mElement_PROGRAM_FRAGMENT == null) { if (rs.mElement_PROGRAM_FRAGMENT == null) {
rs.mElement_PROGRAM_FRAGMENT = createUser(rs, DataType.RS_PROGRAM_FRAGMENT); synchronized (rs) {
if (rs.mElement_PROGRAM_FRAGMENT == null) {
rs.mElement_PROGRAM_FRAGMENT = createUser(rs, DataType.RS_PROGRAM_FRAGMENT);
}
}
} }
return rs.mElement_PROGRAM_FRAGMENT; return rs.mElement_PROGRAM_FRAGMENT;
} }
public static Element PROGRAM_VERTEX(RenderScript rs) { public static Element PROGRAM_VERTEX(RenderScript rs) {
if(rs.mElement_PROGRAM_VERTEX == null) { if (rs.mElement_PROGRAM_VERTEX == null) {
rs.mElement_PROGRAM_VERTEX = createUser(rs, DataType.RS_PROGRAM_VERTEX); synchronized (rs) {
if (rs.mElement_PROGRAM_VERTEX == null) {
rs.mElement_PROGRAM_VERTEX = createUser(rs, DataType.RS_PROGRAM_VERTEX);
}
}
} }
return rs.mElement_PROGRAM_VERTEX; return rs.mElement_PROGRAM_VERTEX;
} }
public static Element PROGRAM_RASTER(RenderScript rs) { public static Element PROGRAM_RASTER(RenderScript rs) {
if(rs.mElement_PROGRAM_RASTER == null) { if (rs.mElement_PROGRAM_RASTER == null) {
rs.mElement_PROGRAM_RASTER = createUser(rs, DataType.RS_PROGRAM_RASTER); synchronized (rs) {
if (rs.mElement_PROGRAM_RASTER == null) {
rs.mElement_PROGRAM_RASTER = createUser(rs, DataType.RS_PROGRAM_RASTER);
}
}
} }
return rs.mElement_PROGRAM_RASTER; return rs.mElement_PROGRAM_RASTER;
} }
public static Element PROGRAM_STORE(RenderScript rs) { public static Element PROGRAM_STORE(RenderScript rs) {
if(rs.mElement_PROGRAM_STORE == null) { if (rs.mElement_PROGRAM_STORE == null) {
rs.mElement_PROGRAM_STORE = createUser(rs, DataType.RS_PROGRAM_STORE); synchronized (rs) {
if (rs.mElement_PROGRAM_STORE == null) {
rs.mElement_PROGRAM_STORE = createUser(rs, DataType.RS_PROGRAM_STORE);
}
}
} }
return rs.mElement_PROGRAM_STORE; return rs.mElement_PROGRAM_STORE;
} }
public static Element FONT(RenderScript rs) { public static Element FONT(RenderScript rs) {
if(rs.mElement_FONT == null) { if (rs.mElement_FONT == null) {
rs.mElement_FONT = createUser(rs, DataType.RS_FONT); synchronized (rs) {
if (rs.mElement_FONT == null) {
rs.mElement_FONT = createUser(rs, DataType.RS_FONT);
}
}
} }
return rs.mElement_FONT; return rs.mElement_FONT;
} }
public static Element A_8(RenderScript rs) { public static Element A_8(RenderScript rs) {
if(rs.mElement_A_8 == null) { if (rs.mElement_A_8 == null) {
rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A); synchronized (rs) {
if (rs.mElement_A_8 == null) {
rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A);
}
}
} }
return rs.mElement_A_8; return rs.mElement_A_8;
} }
public static Element RGB_565(RenderScript rs) { public static Element RGB_565(RenderScript rs) {
if(rs.mElement_RGB_565 == null) { if (rs.mElement_RGB_565 == null) {
rs.mElement_RGB_565 = createPixel(rs, DataType.UNSIGNED_5_6_5, DataKind.PIXEL_RGB); synchronized (rs) {
if (rs.mElement_RGB_565 == null) {
rs.mElement_RGB_565 = createPixel(rs, DataType.UNSIGNED_5_6_5, DataKind.PIXEL_RGB);
}
}
} }
return rs.mElement_RGB_565; return rs.mElement_RGB_565;
} }
public static Element RGB_888(RenderScript rs) { public static Element RGB_888(RenderScript rs) {
if(rs.mElement_RGB_888 == null) { if (rs.mElement_RGB_888 == null) {
rs.mElement_RGB_888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGB); synchronized (rs) {
if (rs.mElement_RGB_888 == null) {
rs.mElement_RGB_888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGB);
}
}
} }
return rs.mElement_RGB_888; return rs.mElement_RGB_888;
} }
public static Element RGBA_5551(RenderScript rs) { public static Element RGBA_5551(RenderScript rs) {
if(rs.mElement_RGBA_5551 == null) { if (rs.mElement_RGBA_5551 == null) {
rs.mElement_RGBA_5551 = createPixel(rs, DataType.UNSIGNED_5_5_5_1, DataKind.PIXEL_RGBA); synchronized (rs) {
if (rs.mElement_RGBA_5551 == null) {
rs.mElement_RGBA_5551 = createPixel(rs, DataType.UNSIGNED_5_5_5_1, DataKind.PIXEL_RGBA);
}
}
} }
return rs.mElement_RGBA_5551; return rs.mElement_RGBA_5551;
} }
public static Element RGBA_4444(RenderScript rs) { public static Element RGBA_4444(RenderScript rs) {
if(rs.mElement_RGBA_4444 == null) { if (rs.mElement_RGBA_4444 == null) {
rs.mElement_RGBA_4444 = createPixel(rs, DataType.UNSIGNED_4_4_4_4, DataKind.PIXEL_RGBA); synchronized (rs) {
if (rs.mElement_RGBA_4444 == null) {
rs.mElement_RGBA_4444 = createPixel(rs, DataType.UNSIGNED_4_4_4_4, DataKind.PIXEL_RGBA);
}
}
} }
return rs.mElement_RGBA_4444; return rs.mElement_RGBA_4444;
} }
public static Element RGBA_8888(RenderScript rs) { public static Element RGBA_8888(RenderScript rs) {
if(rs.mElement_RGBA_8888 == null) { if (rs.mElement_RGBA_8888 == null) {
rs.mElement_RGBA_8888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGBA); synchronized (rs) {
if (rs.mElement_RGBA_8888 == null) {
rs.mElement_RGBA_8888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGBA);
}
}
} }
return rs.mElement_RGBA_8888; return rs.mElement_RGBA_8888;
} }
public static Element F16_2(RenderScript rs) { public static Element F16_2(RenderScript rs) {
if(rs.mElement_HALF_2 == null) { if (rs.mElement_HALF_2 == null) {
rs.mElement_HALF_2 = createVector(rs, DataType.FLOAT_16, 2); synchronized (rs) {
if (rs.mElement_HALF_2 == null) {
rs.mElement_HALF_2 = createVector(rs, DataType.FLOAT_16, 2);
}
}
} }
return rs.mElement_HALF_2; return rs.mElement_HALF_2;
} }
public static Element F16_3(RenderScript rs) { public static Element F16_3(RenderScript rs) {
if(rs.mElement_HALF_3 == null) { if (rs.mElement_HALF_3 == null) {
rs.mElement_HALF_3 = createVector(rs, DataType.FLOAT_16, 3); synchronized (rs) {
if (rs.mElement_HALF_3 == null) {
rs.mElement_HALF_3 = createVector(rs, DataType.FLOAT_16, 3);
}
}
} }
return rs.mElement_HALF_3; return rs.mElement_HALF_3;
} }
public static Element F16_4(RenderScript rs) { public static Element F16_4(RenderScript rs) {
if(rs.mElement_HALF_4 == null) { if (rs.mElement_HALF_4 == null) {
rs.mElement_HALF_4 = createVector(rs, DataType.FLOAT_16, 4); synchronized (rs) {
if (rs.mElement_HALF_4 == null) {
rs.mElement_HALF_4 = createVector(rs, DataType.FLOAT_16, 4);
}
}
} }
return rs.mElement_HALF_4; return rs.mElement_HALF_4;
} }
public static Element F32_2(RenderScript rs) { public static Element F32_2(RenderScript rs) {
if(rs.mElement_FLOAT_2 == null) { if (rs.mElement_FLOAT_2 == null) {
rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2); synchronized (rs) {
if (rs.mElement_FLOAT_2 == null) {
rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2);
}
}
} }
return rs.mElement_FLOAT_2; return rs.mElement_FLOAT_2;
} }
public static Element F32_3(RenderScript rs) { public static Element F32_3(RenderScript rs) {
if(rs.mElement_FLOAT_3 == null) { if (rs.mElement_FLOAT_3 == null) {
rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_32, 3); synchronized (rs) {
if (rs.mElement_FLOAT_3 == null) {
rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_32, 3);
}
}
} }
return rs.mElement_FLOAT_3; return rs.mElement_FLOAT_3;
} }
public static Element F32_4(RenderScript rs) { public static Element F32_4(RenderScript rs) {
if(rs.mElement_FLOAT_4 == null) { if (rs.mElement_FLOAT_4 == null) {
rs.mElement_FLOAT_4 = createVector(rs, DataType.FLOAT_32, 4); synchronized (rs) {
if (rs.mElement_FLOAT_4 == null) {
rs.mElement_FLOAT_4 = createVector(rs, DataType.FLOAT_32, 4);
}
}
} }
return rs.mElement_FLOAT_4; return rs.mElement_FLOAT_4;
} }
public static Element F64_2(RenderScript rs) { public static Element F64_2(RenderScript rs) {
if(rs.mElement_DOUBLE_2 == null) { if (rs.mElement_DOUBLE_2 == null) {
rs.mElement_DOUBLE_2 = createVector(rs, DataType.FLOAT_64, 2); synchronized (rs) {
if (rs.mElement_DOUBLE_2 == null) {
rs.mElement_DOUBLE_2 = createVector(rs, DataType.FLOAT_64, 2);
}
}
} }
return rs.mElement_DOUBLE_2; return rs.mElement_DOUBLE_2;
} }
public static Element F64_3(RenderScript rs) { public static Element F64_3(RenderScript rs) {
if(rs.mElement_DOUBLE_3 == null) { if (rs.mElement_DOUBLE_3 == null) {
rs.mElement_DOUBLE_3 = createVector(rs, DataType.FLOAT_64, 3); synchronized (rs) {
if (rs.mElement_DOUBLE_3 == null) {
rs.mElement_DOUBLE_3 = createVector(rs, DataType.FLOAT_64, 3);
}
}
} }
return rs.mElement_DOUBLE_3; return rs.mElement_DOUBLE_3;
} }
public static Element F64_4(RenderScript rs) { public static Element F64_4(RenderScript rs) {
if(rs.mElement_DOUBLE_4 == null) { if (rs.mElement_DOUBLE_4 == null) {
rs.mElement_DOUBLE_4 = createVector(rs, DataType.FLOAT_64, 4); synchronized (rs) {
if (rs.mElement_DOUBLE_4 == null) {
rs.mElement_DOUBLE_4 = createVector(rs, DataType.FLOAT_64, 4);
}
}
} }
return rs.mElement_DOUBLE_4; return rs.mElement_DOUBLE_4;
} }
public static Element U8_2(RenderScript rs) { public static Element U8_2(RenderScript rs) {
if(rs.mElement_UCHAR_2 == null) { if (rs.mElement_UCHAR_2 == null) {
rs.mElement_UCHAR_2 = createVector(rs, DataType.UNSIGNED_8, 2); synchronized (rs) {
if (rs.mElement_UCHAR_2 == null) {
rs.mElement_UCHAR_2 = createVector(rs, DataType.UNSIGNED_8, 2);
}
}
} }
return rs.mElement_UCHAR_2; return rs.mElement_UCHAR_2;
} }
public static Element U8_3(RenderScript rs) { public static Element U8_3(RenderScript rs) {
if(rs.mElement_UCHAR_3 == null) { if (rs.mElement_UCHAR_3 == null) {
rs.mElement_UCHAR_3 = createVector(rs, DataType.UNSIGNED_8, 3); synchronized (rs) {
if (rs.mElement_UCHAR_3 == null) {
rs.mElement_UCHAR_3 = createVector(rs, DataType.UNSIGNED_8, 3);
}
}
} }
return rs.mElement_UCHAR_3; return rs.mElement_UCHAR_3;
} }
public static Element U8_4(RenderScript rs) { public static Element U8_4(RenderScript rs) {
if(rs.mElement_UCHAR_4 == null) { if (rs.mElement_UCHAR_4 == null) {
rs.mElement_UCHAR_4 = createVector(rs, DataType.UNSIGNED_8, 4); synchronized (rs) {
if (rs.mElement_UCHAR_4 == null) {
rs.mElement_UCHAR_4 = createVector(rs, DataType.UNSIGNED_8, 4);
}
}
} }
return rs.mElement_UCHAR_4; return rs.mElement_UCHAR_4;
} }
public static Element I8_2(RenderScript rs) { public static Element I8_2(RenderScript rs) {
if(rs.mElement_CHAR_2 == null) { if (rs.mElement_CHAR_2 == null) {
rs.mElement_CHAR_2 = createVector(rs, DataType.SIGNED_8, 2); synchronized (rs) {
if (rs.mElement_CHAR_2 == null) {
rs.mElement_CHAR_2 = createVector(rs, DataType.SIGNED_8, 2);
}
}
} }
return rs.mElement_CHAR_2; return rs.mElement_CHAR_2;
} }
public static Element I8_3(RenderScript rs) { public static Element I8_3(RenderScript rs) {
if(rs.mElement_CHAR_3 == null) { if (rs.mElement_CHAR_3 == null) {
rs.mElement_CHAR_3 = createVector(rs, DataType.SIGNED_8, 3); synchronized (rs) {
if (rs.mElement_CHAR_3 == null) {
rs.mElement_CHAR_3 = createVector(rs, DataType.SIGNED_8, 3);
}
}
} }
return rs.mElement_CHAR_3; return rs.mElement_CHAR_3;
} }
public static Element I8_4(RenderScript rs) { public static Element I8_4(RenderScript rs) {
if(rs.mElement_CHAR_4 == null) { if (rs.mElement_CHAR_4 == null) {
rs.mElement_CHAR_4 = createVector(rs, DataType.SIGNED_8, 4); synchronized (rs) {
if (rs.mElement_CHAR_4 == null) {
rs.mElement_CHAR_4 = createVector(rs, DataType.SIGNED_8, 4);
}
}
} }
return rs.mElement_CHAR_4; return rs.mElement_CHAR_4;
} }
public static Element U16_2(RenderScript rs) { public static Element U16_2(RenderScript rs) {
if(rs.mElement_USHORT_2 == null) { if (rs.mElement_USHORT_2 == null) {
rs.mElement_USHORT_2 = createVector(rs, DataType.UNSIGNED_16, 2); synchronized (rs) {
if (rs.mElement_USHORT_2 == null) {
rs.mElement_USHORT_2 = createVector(rs, DataType.UNSIGNED_16, 2);
}
}
} }
return rs.mElement_USHORT_2; return rs.mElement_USHORT_2;
} }
public static Element U16_3(RenderScript rs) { public static Element U16_3(RenderScript rs) {
if(rs.mElement_USHORT_3 == null) { if (rs.mElement_USHORT_3 == null) {
rs.mElement_USHORT_3 = createVector(rs, DataType.UNSIGNED_16, 3); synchronized (rs) {
if (rs.mElement_USHORT_3 == null) {
rs.mElement_USHORT_3 = createVector(rs, DataType.UNSIGNED_16, 3);
}
}
} }
return rs.mElement_USHORT_3; return rs.mElement_USHORT_3;
} }
public static Element U16_4(RenderScript rs) { public static Element U16_4(RenderScript rs) {
if(rs.mElement_USHORT_4 == null) { if (rs.mElement_USHORT_4 == null) {
rs.mElement_USHORT_4 = createVector(rs, DataType.UNSIGNED_16, 4); synchronized (rs) {
if (rs.mElement_USHORT_4 == null) {
rs.mElement_USHORT_4 = createVector(rs, DataType.UNSIGNED_16, 4);
}
}
} }
return rs.mElement_USHORT_4; return rs.mElement_USHORT_4;
} }
public static Element I16_2(RenderScript rs) { public static Element I16_2(RenderScript rs) {
if(rs.mElement_SHORT_2 == null) { if (rs.mElement_SHORT_2 == null) {
rs.mElement_SHORT_2 = createVector(rs, DataType.SIGNED_16, 2); synchronized (rs) {
if (rs.mElement_SHORT_2 == null) {
rs.mElement_SHORT_2 = createVector(rs, DataType.SIGNED_16, 2);
}
}
} }
return rs.mElement_SHORT_2; return rs.mElement_SHORT_2;
} }
public static Element I16_3(RenderScript rs) { public static Element I16_3(RenderScript rs) {
if(rs.mElement_SHORT_3 == null) { if (rs.mElement_SHORT_3 == null) {
rs.mElement_SHORT_3 = createVector(rs, DataType.SIGNED_16, 3); synchronized (rs) {
if (rs.mElement_SHORT_3 == null) {
rs.mElement_SHORT_3 = createVector(rs, DataType.SIGNED_16, 3);
}
}
} }
return rs.mElement_SHORT_3; return rs.mElement_SHORT_3;
} }
public static Element I16_4(RenderScript rs) { public static Element I16_4(RenderScript rs) {
if(rs.mElement_SHORT_4 == null) { if (rs.mElement_SHORT_4 == null) {
rs.mElement_SHORT_4 = createVector(rs, DataType.SIGNED_16, 4); synchronized (rs) {
if (rs.mElement_SHORT_4 == null) {
rs.mElement_SHORT_4 = createVector(rs, DataType.SIGNED_16, 4);
}
}
} }
return rs.mElement_SHORT_4; return rs.mElement_SHORT_4;
} }
public static Element U32_2(RenderScript rs) { public static Element U32_2(RenderScript rs) {
if(rs.mElement_UINT_2 == null) { if (rs.mElement_UINT_2 == null) {
rs.mElement_UINT_2 = createVector(rs, DataType.UNSIGNED_32, 2); synchronized (rs) {
if (rs.mElement_UINT_2 == null) {
rs.mElement_UINT_2 = createVector(rs, DataType.UNSIGNED_32, 2);
}
}
} }
return rs.mElement_UINT_2; return rs.mElement_UINT_2;
} }
public static Element U32_3(RenderScript rs) { public static Element U32_3(RenderScript rs) {
if(rs.mElement_UINT_3 == null) { if (rs.mElement_UINT_3 == null) {
rs.mElement_UINT_3 = createVector(rs, DataType.UNSIGNED_32, 3); synchronized (rs) {
if (rs.mElement_UINT_3 == null) {
rs.mElement_UINT_3 = createVector(rs, DataType.UNSIGNED_32, 3);
}
}
} }
return rs.mElement_UINT_3; return rs.mElement_UINT_3;
} }
public static Element U32_4(RenderScript rs) { public static Element U32_4(RenderScript rs) {
if(rs.mElement_UINT_4 == null) { if (rs.mElement_UINT_4 == null) {
rs.mElement_UINT_4 = createVector(rs, DataType.UNSIGNED_32, 4); synchronized (rs) {
if (rs.mElement_UINT_4 == null) {
rs.mElement_UINT_4 = createVector(rs, DataType.UNSIGNED_32, 4);
}
}
} }
return rs.mElement_UINT_4; return rs.mElement_UINT_4;
} }
public static Element I32_2(RenderScript rs) { public static Element I32_2(RenderScript rs) {
if(rs.mElement_INT_2 == null) { if (rs.mElement_INT_2 == null) {
rs.mElement_INT_2 = createVector(rs, DataType.SIGNED_32, 2); synchronized (rs) {
if (rs.mElement_INT_2 == null) {
rs.mElement_INT_2 = createVector(rs, DataType.SIGNED_32, 2);
}
}
} }
return rs.mElement_INT_2; return rs.mElement_INT_2;
} }
public static Element I32_3(RenderScript rs) { public static Element I32_3(RenderScript rs) {
if(rs.mElement_INT_3 == null) { if (rs.mElement_INT_3 == null) {
rs.mElement_INT_3 = createVector(rs, DataType.SIGNED_32, 3); synchronized (rs) {
if (rs.mElement_INT_3 == null) {
rs.mElement_INT_3 = createVector(rs, DataType.SIGNED_32, 3);
}
}
} }
return rs.mElement_INT_3; return rs.mElement_INT_3;
} }
public static Element I32_4(RenderScript rs) { public static Element I32_4(RenderScript rs) {
if(rs.mElement_INT_4 == null) { if (rs.mElement_INT_4 == null) {
rs.mElement_INT_4 = createVector(rs, DataType.SIGNED_32, 4); synchronized (rs) {
if (rs.mElement_INT_4 == null) {
rs.mElement_INT_4 = createVector(rs, DataType.SIGNED_32, 4);
}
}
} }
return rs.mElement_INT_4; return rs.mElement_INT_4;
} }
public static Element U64_2(RenderScript rs) { public static Element U64_2(RenderScript rs) {
if(rs.mElement_ULONG_2 == null) { if (rs.mElement_ULONG_2 == null) {
rs.mElement_ULONG_2 = createVector(rs, DataType.UNSIGNED_64, 2); synchronized (rs) {
if (rs.mElement_ULONG_2 == null) {
rs.mElement_ULONG_2 = createVector(rs, DataType.UNSIGNED_64, 2);
}
}
} }
return rs.mElement_ULONG_2; return rs.mElement_ULONG_2;
} }
public static Element U64_3(RenderScript rs) { public static Element U64_3(RenderScript rs) {
if(rs.mElement_ULONG_3 == null) { if (rs.mElement_ULONG_3 == null) {
rs.mElement_ULONG_3 = createVector(rs, DataType.UNSIGNED_64, 3); synchronized (rs) {
if (rs.mElement_ULONG_3 == null) {
rs.mElement_ULONG_3 = createVector(rs, DataType.UNSIGNED_64, 3);
}
}
} }
return rs.mElement_ULONG_3; return rs.mElement_ULONG_3;
} }
public static Element U64_4(RenderScript rs) { public static Element U64_4(RenderScript rs) {
if(rs.mElement_ULONG_4 == null) { if (rs.mElement_ULONG_4 == null) {
rs.mElement_ULONG_4 = createVector(rs, DataType.UNSIGNED_64, 4); synchronized (rs) {
if (rs.mElement_ULONG_4 == null) {
rs.mElement_ULONG_4 = createVector(rs, DataType.UNSIGNED_64, 4);
}
}
} }
return rs.mElement_ULONG_4; return rs.mElement_ULONG_4;
} }
public static Element I64_2(RenderScript rs) { public static Element I64_2(RenderScript rs) {
if(rs.mElement_LONG_2 == null) { if (rs.mElement_LONG_2 == null) {
rs.mElement_LONG_2 = createVector(rs, DataType.SIGNED_64, 2); synchronized (rs) {
if (rs.mElement_LONG_2 == null) {
rs.mElement_LONG_2 = createVector(rs, DataType.SIGNED_64, 2);
}
}
} }
return rs.mElement_LONG_2; return rs.mElement_LONG_2;
} }
public static Element I64_3(RenderScript rs) { public static Element I64_3(RenderScript rs) {
if(rs.mElement_LONG_3 == null) { if (rs.mElement_LONG_3 == null) {
rs.mElement_LONG_3 = createVector(rs, DataType.SIGNED_64, 3); synchronized (rs) {
if (rs.mElement_LONG_3 == null) {
rs.mElement_LONG_3 = createVector(rs, DataType.SIGNED_64, 3);
}
}
} }
return rs.mElement_LONG_3; return rs.mElement_LONG_3;
} }
public static Element I64_4(RenderScript rs) { public static Element I64_4(RenderScript rs) {
if(rs.mElement_LONG_4 == null) { if (rs.mElement_LONG_4 == null) {
rs.mElement_LONG_4 = createVector(rs, DataType.SIGNED_64, 4); synchronized (rs) {
if (rs.mElement_LONG_4 == null) {
rs.mElement_LONG_4 = createVector(rs, DataType.SIGNED_64, 4);
}
}
} }
return rs.mElement_LONG_4; return rs.mElement_LONG_4;
} }
public static Element YUV(RenderScript rs) { public static Element YUV(RenderScript rs) {
if (rs.mElement_YUV == null) { if (rs.mElement_YUV == null) {
rs.mElement_YUV = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_YUV); synchronized (rs) {
if (rs.mElement_YUV == null) {
rs.mElement_YUV = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_YUV);
}
}
} }
return rs.mElement_YUV; return rs.mElement_YUV;
} }
public static Element MATRIX_4X4(RenderScript rs) { public static Element MATRIX_4X4(RenderScript rs) {
if(rs.mElement_MATRIX_4X4 == null) { if (rs.mElement_MATRIX_4X4 == null) {
rs.mElement_MATRIX_4X4 = createUser(rs, DataType.MATRIX_4X4); synchronized (rs) {
if (rs.mElement_MATRIX_4X4 == null) {
rs.mElement_MATRIX_4X4 = createUser(rs, DataType.MATRIX_4X4);
}
}
} }
return rs.mElement_MATRIX_4X4; return rs.mElement_MATRIX_4X4;
} }
@@ -780,15 +1035,23 @@ public class Element extends BaseObj {
} }
public static Element MATRIX_3X3(RenderScript rs) { public static Element MATRIX_3X3(RenderScript rs) {
if(rs.mElement_MATRIX_3X3 == null) { if (rs.mElement_MATRIX_3X3 == null) {
rs.mElement_MATRIX_3X3 = createUser(rs, DataType.MATRIX_3X3); synchronized (rs) {
if (rs.mElement_MATRIX_3X3 == null) {
rs.mElement_MATRIX_3X3 = createUser(rs, DataType.MATRIX_3X3);
}
}
} }
return rs.mElement_MATRIX_3X3; return rs.mElement_MATRIX_3X3;
} }
public static Element MATRIX_2X2(RenderScript rs) { public static Element MATRIX_2X2(RenderScript rs) {
if(rs.mElement_MATRIX_2X2 == null) { if (rs.mElement_MATRIX_2X2 == null) {
rs.mElement_MATRIX_2X2 = createUser(rs, DataType.MATRIX_2X2); synchronized (rs) {
if (rs.mElement_MATRIX_2X2 == null) {
rs.mElement_MATRIX_2X2 = createUser(rs, DataType.MATRIX_2X2);
}
}
} }
return rs.mElement_MATRIX_2X2; return rs.mElement_MATRIX_2X2;
} }

View File

@@ -1037,97 +1037,97 @@ public class RenderScript {
@SuppressWarnings({"FieldCanBeLocal"}) @SuppressWarnings({"FieldCanBeLocal"})
MessageThread mMessageThread; MessageThread mMessageThread;
Element mElement_U8; volatile Element mElement_U8;
Element mElement_I8; volatile Element mElement_I8;
Element mElement_U16; volatile Element mElement_U16;
Element mElement_I16; volatile Element mElement_I16;
Element mElement_U32; volatile Element mElement_U32;
Element mElement_I32; volatile Element mElement_I32;
Element mElement_U64; volatile Element mElement_U64;
Element mElement_I64; volatile Element mElement_I64;
Element mElement_F16; volatile Element mElement_F16;
Element mElement_F32; volatile Element mElement_F32;
Element mElement_F64; volatile Element mElement_F64;
Element mElement_BOOLEAN; volatile Element mElement_BOOLEAN;
Element mElement_ELEMENT; volatile Element mElement_ELEMENT;
Element mElement_TYPE; volatile Element mElement_TYPE;
Element mElement_ALLOCATION; volatile Element mElement_ALLOCATION;
Element mElement_SAMPLER; volatile Element mElement_SAMPLER;
Element mElement_SCRIPT; volatile Element mElement_SCRIPT;
Element mElement_MESH; volatile Element mElement_MESH;
Element mElement_PROGRAM_FRAGMENT; volatile Element mElement_PROGRAM_FRAGMENT;
Element mElement_PROGRAM_VERTEX; volatile Element mElement_PROGRAM_VERTEX;
Element mElement_PROGRAM_RASTER; volatile Element mElement_PROGRAM_RASTER;
Element mElement_PROGRAM_STORE; volatile Element mElement_PROGRAM_STORE;
Element mElement_FONT; volatile Element mElement_FONT;
Element mElement_A_8; volatile Element mElement_A_8;
Element mElement_RGB_565; volatile Element mElement_RGB_565;
Element mElement_RGB_888; volatile Element mElement_RGB_888;
Element mElement_RGBA_5551; volatile Element mElement_RGBA_5551;
Element mElement_RGBA_4444; volatile Element mElement_RGBA_4444;
Element mElement_RGBA_8888; volatile Element mElement_RGBA_8888;
Element mElement_HALF_2; volatile Element mElement_HALF_2;
Element mElement_HALF_3; volatile Element mElement_HALF_3;
Element mElement_HALF_4; volatile Element mElement_HALF_4;
Element mElement_FLOAT_2; volatile Element mElement_FLOAT_2;
Element mElement_FLOAT_3; volatile Element mElement_FLOAT_3;
Element mElement_FLOAT_4; volatile Element mElement_FLOAT_4;
Element mElement_DOUBLE_2; volatile Element mElement_DOUBLE_2;
Element mElement_DOUBLE_3; volatile Element mElement_DOUBLE_3;
Element mElement_DOUBLE_4; volatile Element mElement_DOUBLE_4;
Element mElement_UCHAR_2; volatile Element mElement_UCHAR_2;
Element mElement_UCHAR_3; volatile Element mElement_UCHAR_3;
Element mElement_UCHAR_4; volatile Element mElement_UCHAR_4;
Element mElement_CHAR_2; volatile Element mElement_CHAR_2;
Element mElement_CHAR_3; volatile Element mElement_CHAR_3;
Element mElement_CHAR_4; volatile Element mElement_CHAR_4;
Element mElement_USHORT_2; volatile Element mElement_USHORT_2;
Element mElement_USHORT_3; volatile Element mElement_USHORT_3;
Element mElement_USHORT_4; volatile Element mElement_USHORT_4;
Element mElement_SHORT_2; volatile Element mElement_SHORT_2;
Element mElement_SHORT_3; volatile Element mElement_SHORT_3;
Element mElement_SHORT_4; volatile Element mElement_SHORT_4;
Element mElement_UINT_2; volatile Element mElement_UINT_2;
Element mElement_UINT_3; volatile Element mElement_UINT_3;
Element mElement_UINT_4; volatile Element mElement_UINT_4;
Element mElement_INT_2; volatile Element mElement_INT_2;
Element mElement_INT_3; volatile Element mElement_INT_3;
Element mElement_INT_4; volatile Element mElement_INT_4;
Element mElement_ULONG_2; volatile Element mElement_ULONG_2;
Element mElement_ULONG_3; volatile Element mElement_ULONG_3;
Element mElement_ULONG_4; volatile Element mElement_ULONG_4;
Element mElement_LONG_2; volatile Element mElement_LONG_2;
Element mElement_LONG_3; volatile Element mElement_LONG_3;
Element mElement_LONG_4; volatile Element mElement_LONG_4;
Element mElement_YUV; volatile Element mElement_YUV;
Element mElement_MATRIX_4X4; volatile Element mElement_MATRIX_4X4;
Element mElement_MATRIX_3X3; volatile Element mElement_MATRIX_3X3;
Element mElement_MATRIX_2X2; volatile Element mElement_MATRIX_2X2;
Sampler mSampler_CLAMP_NEAREST; volatile Sampler mSampler_CLAMP_NEAREST;
Sampler mSampler_CLAMP_LINEAR; volatile Sampler mSampler_CLAMP_LINEAR;
Sampler mSampler_CLAMP_LINEAR_MIP_LINEAR; volatile Sampler mSampler_CLAMP_LINEAR_MIP_LINEAR;
Sampler mSampler_WRAP_NEAREST; volatile Sampler mSampler_WRAP_NEAREST;
Sampler mSampler_WRAP_LINEAR; volatile Sampler mSampler_WRAP_LINEAR;
Sampler mSampler_WRAP_LINEAR_MIP_LINEAR; volatile Sampler mSampler_WRAP_LINEAR_MIP_LINEAR;
Sampler mSampler_MIRRORED_REPEAT_NEAREST; volatile Sampler mSampler_MIRRORED_REPEAT_NEAREST;
Sampler mSampler_MIRRORED_REPEAT_LINEAR; volatile Sampler mSampler_MIRRORED_REPEAT_LINEAR;
Sampler mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR; volatile Sampler mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR;
ProgramStore mProgramStore_BLEND_NONE_DEPTH_TEST; ProgramStore mProgramStore_BLEND_NONE_DEPTH_TEST;
ProgramStore mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH; ProgramStore mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH;

View File

@@ -98,13 +98,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler CLAMP_NEAREST(RenderScript rs) { public static Sampler CLAMP_NEAREST(RenderScript rs) {
if(rs.mSampler_CLAMP_NEAREST == null) { if (rs.mSampler_CLAMP_NEAREST == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.NEAREST); if (rs.mSampler_CLAMP_NEAREST == null) {
b.setMagnification(Value.NEAREST); Builder b = new Builder(rs);
b.setWrapS(Value.CLAMP); b.setMinification(Value.NEAREST);
b.setWrapT(Value.CLAMP); b.setMagnification(Value.NEAREST);
rs.mSampler_CLAMP_NEAREST = b.create(); b.setWrapS(Value.CLAMP);
b.setWrapT(Value.CLAMP);
rs.mSampler_CLAMP_NEAREST = b.create();
}
}
} }
return rs.mSampler_CLAMP_NEAREST; return rs.mSampler_CLAMP_NEAREST;
} }
@@ -118,13 +122,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler CLAMP_LINEAR(RenderScript rs) { public static Sampler CLAMP_LINEAR(RenderScript rs) {
if(rs.mSampler_CLAMP_LINEAR == null) { if (rs.mSampler_CLAMP_LINEAR == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.LINEAR); if (rs.mSampler_CLAMP_LINEAR == null) {
b.setMagnification(Value.LINEAR); Builder b = new Builder(rs);
b.setWrapS(Value.CLAMP); b.setMinification(Value.LINEAR);
b.setWrapT(Value.CLAMP); b.setMagnification(Value.LINEAR);
rs.mSampler_CLAMP_LINEAR = b.create(); b.setWrapS(Value.CLAMP);
b.setWrapT(Value.CLAMP);
rs.mSampler_CLAMP_LINEAR = b.create();
}
}
} }
return rs.mSampler_CLAMP_LINEAR; return rs.mSampler_CLAMP_LINEAR;
} }
@@ -138,13 +146,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler CLAMP_LINEAR_MIP_LINEAR(RenderScript rs) { public static Sampler CLAMP_LINEAR_MIP_LINEAR(RenderScript rs) {
if(rs.mSampler_CLAMP_LINEAR_MIP_LINEAR == null) { if (rs.mSampler_CLAMP_LINEAR_MIP_LINEAR == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.LINEAR_MIP_LINEAR); if (rs.mSampler_CLAMP_LINEAR_MIP_LINEAR == null) {
b.setMagnification(Value.LINEAR); Builder b = new Builder(rs);
b.setWrapS(Value.CLAMP); b.setMinification(Value.LINEAR_MIP_LINEAR);
b.setWrapT(Value.CLAMP); b.setMagnification(Value.LINEAR);
rs.mSampler_CLAMP_LINEAR_MIP_LINEAR = b.create(); b.setWrapS(Value.CLAMP);
b.setWrapT(Value.CLAMP);
rs.mSampler_CLAMP_LINEAR_MIP_LINEAR = b.create();
}
}
} }
return rs.mSampler_CLAMP_LINEAR_MIP_LINEAR; return rs.mSampler_CLAMP_LINEAR_MIP_LINEAR;
} }
@@ -158,13 +170,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler WRAP_NEAREST(RenderScript rs) { public static Sampler WRAP_NEAREST(RenderScript rs) {
if(rs.mSampler_WRAP_NEAREST == null) { if (rs.mSampler_WRAP_NEAREST == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.NEAREST); if (rs.mSampler_WRAP_NEAREST == null) {
b.setMagnification(Value.NEAREST); Builder b = new Builder(rs);
b.setWrapS(Value.WRAP); b.setMinification(Value.NEAREST);
b.setWrapT(Value.WRAP); b.setMagnification(Value.NEAREST);
rs.mSampler_WRAP_NEAREST = b.create(); b.setWrapS(Value.WRAP);
b.setWrapT(Value.WRAP);
rs.mSampler_WRAP_NEAREST = b.create();
}
}
} }
return rs.mSampler_WRAP_NEAREST; return rs.mSampler_WRAP_NEAREST;
} }
@@ -178,13 +194,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler WRAP_LINEAR(RenderScript rs) { public static Sampler WRAP_LINEAR(RenderScript rs) {
if(rs.mSampler_WRAP_LINEAR == null) { if (rs.mSampler_WRAP_LINEAR == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.LINEAR); if (rs.mSampler_WRAP_LINEAR == null) {
b.setMagnification(Value.LINEAR); Builder b = new Builder(rs);
b.setWrapS(Value.WRAP); b.setMinification(Value.LINEAR);
b.setWrapT(Value.WRAP); b.setMagnification(Value.LINEAR);
rs.mSampler_WRAP_LINEAR = b.create(); b.setWrapS(Value.WRAP);
b.setWrapT(Value.WRAP);
rs.mSampler_WRAP_LINEAR = b.create();
}
}
} }
return rs.mSampler_WRAP_LINEAR; return rs.mSampler_WRAP_LINEAR;
} }
@@ -198,13 +218,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler WRAP_LINEAR_MIP_LINEAR(RenderScript rs) { public static Sampler WRAP_LINEAR_MIP_LINEAR(RenderScript rs) {
if(rs.mSampler_WRAP_LINEAR_MIP_LINEAR == null) { if (rs.mSampler_WRAP_LINEAR_MIP_LINEAR == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.LINEAR_MIP_LINEAR); if (rs.mSampler_WRAP_LINEAR_MIP_LINEAR == null) {
b.setMagnification(Value.LINEAR); Builder b = new Builder(rs);
b.setWrapS(Value.WRAP); b.setMinification(Value.LINEAR_MIP_LINEAR);
b.setWrapT(Value.WRAP); b.setMagnification(Value.LINEAR);
rs.mSampler_WRAP_LINEAR_MIP_LINEAR = b.create(); b.setWrapS(Value.WRAP);
b.setWrapT(Value.WRAP);
rs.mSampler_WRAP_LINEAR_MIP_LINEAR = b.create();
}
}
} }
return rs.mSampler_WRAP_LINEAR_MIP_LINEAR; return rs.mSampler_WRAP_LINEAR_MIP_LINEAR;
} }
@@ -218,13 +242,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler MIRRORED_REPEAT_NEAREST(RenderScript rs) { public static Sampler MIRRORED_REPEAT_NEAREST(RenderScript rs) {
if(rs.mSampler_MIRRORED_REPEAT_NEAREST == null) { if (rs.mSampler_MIRRORED_REPEAT_NEAREST == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.NEAREST); if (rs.mSampler_MIRRORED_REPEAT_NEAREST == null) {
b.setMagnification(Value.NEAREST); Builder b = new Builder(rs);
b.setWrapS(Value.MIRRORED_REPEAT); b.setMinification(Value.NEAREST);
b.setWrapT(Value.MIRRORED_REPEAT); b.setMagnification(Value.NEAREST);
rs.mSampler_MIRRORED_REPEAT_NEAREST = b.create(); b.setWrapS(Value.MIRRORED_REPEAT);
b.setWrapT(Value.MIRRORED_REPEAT);
rs.mSampler_MIRRORED_REPEAT_NEAREST = b.create();
}
}
} }
return rs.mSampler_MIRRORED_REPEAT_NEAREST; return rs.mSampler_MIRRORED_REPEAT_NEAREST;
} }
@@ -238,13 +266,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler MIRRORED_REPEAT_LINEAR(RenderScript rs) { public static Sampler MIRRORED_REPEAT_LINEAR(RenderScript rs) {
if(rs.mSampler_MIRRORED_REPEAT_LINEAR == null) { if (rs.mSampler_MIRRORED_REPEAT_LINEAR == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.LINEAR); if (rs.mSampler_MIRRORED_REPEAT_LINEAR == null) {
b.setMagnification(Value.LINEAR); Builder b = new Builder(rs);
b.setWrapS(Value.MIRRORED_REPEAT); b.setMinification(Value.LINEAR);
b.setWrapT(Value.MIRRORED_REPEAT); b.setMagnification(Value.LINEAR);
rs.mSampler_MIRRORED_REPEAT_LINEAR = b.create(); b.setWrapS(Value.MIRRORED_REPEAT);
b.setWrapT(Value.MIRRORED_REPEAT);
rs.mSampler_MIRRORED_REPEAT_LINEAR = b.create();
}
}
} }
return rs.mSampler_MIRRORED_REPEAT_LINEAR; return rs.mSampler_MIRRORED_REPEAT_LINEAR;
} }
@@ -258,13 +290,17 @@ public class Sampler extends BaseObj {
* @return Sampler * @return Sampler
*/ */
public static Sampler MIRRORED_REPEAT_LINEAR_MIP_LINEAR(RenderScript rs) { public static Sampler MIRRORED_REPEAT_LINEAR_MIP_LINEAR(RenderScript rs) {
if(rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR == null) { if (rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR == null) {
Builder b = new Builder(rs); synchronized (rs) {
b.setMinification(Value.LINEAR_MIP_LINEAR); if (rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR == null) {
b.setMagnification(Value.LINEAR); Builder b = new Builder(rs);
b.setWrapS(Value.MIRRORED_REPEAT); b.setMinification(Value.LINEAR_MIP_LINEAR);
b.setWrapT(Value.MIRRORED_REPEAT); b.setMagnification(Value.LINEAR);
rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR = b.create(); b.setWrapS(Value.MIRRORED_REPEAT);
b.setWrapT(Value.MIRRORED_REPEAT);
rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR = b.create();
}
}
} }
return rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR; return rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR;
} }