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

Commit 4cc8c7dd authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 7489

* changes:
  More test app work
parents 49763e42 7aa4f3a1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -85,10 +85,12 @@ LOCAL_SRC_FILES:= \
	rsContext.cpp \
	rsDevice.cpp \
	rsElement.cpp \
        rsFileA3D.cpp \
	rsLight.cpp \
	rsLocklessFifo.cpp \
	rsObjectBase.cpp \
	rsMatrix.cpp \
        rsMesh.cpp \
	rsProgram.cpp \
	rsProgramFragment.cpp \
	rsProgramFragmentStore.cpp \
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
    package="com.android.rollo">
    <application android:label="Rollo">
        <activity android:name="Rollo"
                  android:theme="@android:style/Theme.Black.NoTitleBar">
                  android:theme="@android:style/Theme.Translucent">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
+67 −0
Original line number Diff line number Diff line
#pragma version(1)
#pragma stateVertex(PV)
#pragma stateFragment(PF)
#pragma stateFragmentStore(PFS)

void drawLoop(int x, int y, int z, int rot)
{
    int ct;
    int tx;
    int ty;
    int tmpSin;
    int tmpCos;
    int sz;

    for (ct = 0; ct < 10; ct ++) {
        tmpSin = sinx((ct * 36 + rot) * 0x10000);
        tmpCos = cosx((ct * 36 + rot) * 0x10000);

        ty = y + tmpCos * 4;
        tx = x + tmpSin * 4;
        pfBindTexture(NAMED_PF, 0, loadI32(1, ct & 3));

        sz = 0xc000;
        drawQuad(tx - sz, ty - sz, z,
                 tx + sz, ty - sz, z,
                 tx + sz, ty + sz, z,
                 tx - sz, ty + sz, z);
    }
}

int main(void* con, int ft, int launchID)
{
    int rowCount;
    int x;
    int y;
    int row;
    int col;
    int imageID;
    int tx1;
    int ty1;
    int tz1;
    int tx2;
    int ty2;
    int tz2;
    int tmpSin;
    int tmpCos;
    int iconCount;
    int pressure;

    int ringCount;



    rotStep = 16 * 0x10000;
    pressure = loadI32(0, 2);
    rowCount = 4;

    iconCount = loadI32(0, 1);
    rot = (-20 + loadI32(0, 0)) * 0x10000;

    for (ringCount = 0; ringCount < 5; ringCount++) {
        drawLoop(0, 0, 0x90000 + (ringCount * 0x80000));
    }

    return 0;
}
+5 −2
Original line number Diff line number Diff line
@@ -190,8 +190,9 @@ public class RolloRS {

    private void initRS() {
        mRS.scriptCBegin();
        mRS.scriptCSetClearColor(0.0f, 0.0f, 0.1f, 1.0f);
        mRS.scriptCSetScript(mRes, R.raw.rollo);
        mRS.scriptCSetClearColor(0.0f, 0.0f, 0.1f, 0.5f);
        //mRS.scriptCSetScript(mRes, R.raw.rollo);
        mRS.scriptCSetScript(mRes, R.raw.rollo2);
        mRS.scriptCSetRoot(true);
        mScript = mRS.scriptCCreate();

@@ -202,6 +203,8 @@ public class RolloRS {
        mScript.bindAllocation(mAllocIconID, 1);
        setPosition(0, 0);

        //RenderScript.File f = mRS.fileOpen("/sdcard/test.a3d");

        mRS.contextBindRootScript(mScript);
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.graphics.PixelFormat;

public class RolloView extends RSSurfaceView {

@@ -44,6 +45,7 @@ public class RolloView extends RSSurfaceView {
        super(context);

        //setFocusable(true);
        getHolder().setFormat(PixelFormat.TRANSLUCENT);
    }

    private RenderScript mRS;
@@ -55,6 +57,8 @@ public class RolloView extends RSSurfaceView {
        mRS = createRenderScript();
        mRender = new RolloRS();
        mRender.init(mRS, getResources(), w, h);


    }

    @Override
Loading