Loading graphics/java/android/renderscript/Sampler.java +3 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ public class Sampler extends BaseObj { NEAREST (0), LINEAR (1), LINEAR_MIP_LINEAR (2), LINEAR_MIP_NEAREST (5), WRAP (3), CLAMP (4); Loading Loading @@ -201,7 +202,8 @@ public class Sampler extends BaseObj { public void setMin(Value v) { if (v == Value.NEAREST || v == Value.LINEAR || v == Value.LINEAR_MIP_LINEAR) { v == Value.LINEAR_MIP_LINEAR || v == Value.LINEAR_MIP_NEAREST) { mMin = v; } else { throw new IllegalArgumentException("Invalid value"); Loading libs/rs/RenderScript.h +2 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,8 @@ enum RsSamplerValue { RS_SAMPLER_LINEAR, RS_SAMPLER_LINEAR_MIP_LINEAR, RS_SAMPLER_WRAP, RS_SAMPLER_CLAMP RS_SAMPLER_CLAMP, RS_SAMPLER_LINEAR_MIP_NEAREST, }; enum RsTextureTarget { Loading libs/rs/java/Samples/res/raw/shader2movev.glsl +0 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ void main() { mat3 model3 = mat3(UNI_model[0].xyz, UNI_model[1].xyz, UNI_model[2].xyz); vec3 worldNorm = model3 * (ATTRIB_normal + oldPos - objPos.xyz); //vec3 worldNorm = model3 * ATTRIB_normal; varWorldPos = worldPos.xyz; varWorldNormal = worldNorm; Loading libs/rs/java/Samples/src/com/android/samples/RsBench.java +2 −2 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class RsBench extends Activity { @Override protected void onResume() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus // to take appropriate action when the activity loses focus super.onResume(); mView.resume(); } Loading @@ -62,7 +62,7 @@ public class RsBench extends Activity { @Override protected void onPause() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus // to take appropriate action when the activity loses focus super.onPause(); mView.pause(); } Loading libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java +15 −9 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class RsBenchRS { ProgramVertex.ShaderBuilder pvbCustom = new ProgramVertex.ShaderBuilder(mRS); // Specify the resource that contains the shader string pvbCustom.setShader(mRes, R.raw.shaderv); // Use a script field to spcify the input layout // Use a script field to specify the input layout pvbCustom.addInput(ScriptField_VertexShaderInputs_s.createElement(mRS)); // Define the constant input layout pvbCustom.addConstant(mVSConst.getAllocation().getType()); Loading Loading @@ -315,16 +315,22 @@ public class RsBenchRS { private void initFonts() { // Sans font by family name mFontSans = Font.createFromFamily(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); mFontSans = Font.createFromFamily(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); // Create font by file name mFontSerif = Font.create(mRS, mRes, "DroidSerif-Regular.ttf", 8); // Create fonts by family and style mFontSerifBold = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8); mFontSerifItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.ITALIC, 8); mFontSerifBoldItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); mFontMono = Font.createFromFamily(mRS, mRes, "mono", Font.Style.NORMAL, 8); mTextAlloc = Allocation.createFromString(mRS, "String from allocation", Allocation.USAGE_SCRIPT); mFontSerifBold = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8); mFontSerifItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.ITALIC, 8); mFontSerifBoldItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); mFontMono = Font.createFromFamily(mRS, mRes, "mono", Font.Style.NORMAL, 8); mTextAlloc = Allocation.createFromString(mRS, "String from allocation", Allocation.USAGE_SCRIPT); mScript.set_gFontSans(mFontSans); mScript.set_gFontSerif(mFontSerif); Loading Loading
graphics/java/android/renderscript/Sampler.java +3 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ public class Sampler extends BaseObj { NEAREST (0), LINEAR (1), LINEAR_MIP_LINEAR (2), LINEAR_MIP_NEAREST (5), WRAP (3), CLAMP (4); Loading Loading @@ -201,7 +202,8 @@ public class Sampler extends BaseObj { public void setMin(Value v) { if (v == Value.NEAREST || v == Value.LINEAR || v == Value.LINEAR_MIP_LINEAR) { v == Value.LINEAR_MIP_LINEAR || v == Value.LINEAR_MIP_NEAREST) { mMin = v; } else { throw new IllegalArgumentException("Invalid value"); Loading
libs/rs/RenderScript.h +2 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,8 @@ enum RsSamplerValue { RS_SAMPLER_LINEAR, RS_SAMPLER_LINEAR_MIP_LINEAR, RS_SAMPLER_WRAP, RS_SAMPLER_CLAMP RS_SAMPLER_CLAMP, RS_SAMPLER_LINEAR_MIP_NEAREST, }; enum RsTextureTarget { Loading
libs/rs/java/Samples/res/raw/shader2movev.glsl +0 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ void main() { mat3 model3 = mat3(UNI_model[0].xyz, UNI_model[1].xyz, UNI_model[2].xyz); vec3 worldNorm = model3 * (ATTRIB_normal + oldPos - objPos.xyz); //vec3 worldNorm = model3 * ATTRIB_normal; varWorldPos = worldPos.xyz; varWorldNormal = worldNorm; Loading
libs/rs/java/Samples/src/com/android/samples/RsBench.java +2 −2 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class RsBench extends Activity { @Override protected void onResume() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus // to take appropriate action when the activity loses focus super.onResume(); mView.resume(); } Loading @@ -62,7 +62,7 @@ public class RsBench extends Activity { @Override protected void onPause() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus // to take appropriate action when the activity loses focus super.onPause(); mView.pause(); } Loading
libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java +15 −9 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class RsBenchRS { ProgramVertex.ShaderBuilder pvbCustom = new ProgramVertex.ShaderBuilder(mRS); // Specify the resource that contains the shader string pvbCustom.setShader(mRes, R.raw.shaderv); // Use a script field to spcify the input layout // Use a script field to specify the input layout pvbCustom.addInput(ScriptField_VertexShaderInputs_s.createElement(mRS)); // Define the constant input layout pvbCustom.addConstant(mVSConst.getAllocation().getType()); Loading Loading @@ -315,16 +315,22 @@ public class RsBenchRS { private void initFonts() { // Sans font by family name mFontSans = Font.createFromFamily(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); mFontSans = Font.createFromFamily(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); // Create font by file name mFontSerif = Font.create(mRS, mRes, "DroidSerif-Regular.ttf", 8); // Create fonts by family and style mFontSerifBold = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8); mFontSerifItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.ITALIC, 8); mFontSerifBoldItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); mFontMono = Font.createFromFamily(mRS, mRes, "mono", Font.Style.NORMAL, 8); mTextAlloc = Allocation.createFromString(mRS, "String from allocation", Allocation.USAGE_SCRIPT); mFontSerifBold = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8); mFontSerifItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.ITALIC, 8); mFontSerifBoldItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); mFontMono = Font.createFromFamily(mRS, mRes, "mono", Font.Style.NORMAL, 8); mTextAlloc = Allocation.createFromString(mRS, "String from allocation", Allocation.USAGE_SCRIPT); mScript.set_gFontSans(mFontSans); mScript.set_gFontSerif(mFontSerif); Loading