Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08571961 authored by Alex Sakhartchouk's avatar Alex Sakhartchouk
Browse files

Cleanup and refactoring of an earlier cl.

Change-Id: I5e356ed88375a1620846e0c500659e3b7ead5030
parent 320a4bed
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);

@@ -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");
+2 −1
Original line number Diff line number Diff line
@@ -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 {
+0 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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();
    }
@@ -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();
    }
+15 −9
Original line number Diff line number Diff line
@@ -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());
@@ -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