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

Commit ce13d94c authored by Stephen Hines's avatar Stephen Hines
Browse files

New RS types test for checking compilation.

Change-Id: Ib4d0326462d4d0229430f61c74f16979f7b38dbb
parent 2ec6a54c
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -56,16 +56,16 @@ void initParts(int w, int h)
int root() {
    rsgClearColor(0.f, 0.f, 0.f, 1.f);

    BallControl_t bc;
    BallControl_t bc = {0};
    Ball_t *bout;

    if (frame & 1) {
        bc.ain = rsGetAllocation(balls2);
        bc.aout = rsGetAllocation(balls1);
        rsSetObject(&bc.ain, rsGetAllocation(balls2));
        rsSetObject(&bc.aout, rsGetAllocation(balls1));
        bout = balls2;
    } else {
        bc.ain = rsGetAllocation(balls1);
        bc.aout = rsGetAllocation(balls2);
        rsSetObject(&bc.ain, rsGetAllocation(balls1));
        rsSetObject(&bc.aout, rsGetAllocation(balls2));
        bout = balls1;
    }

@@ -99,6 +99,8 @@ int root() {
    rsgBindProgramStore(gPS);
    rsgDrawMesh(arcMesh, 0, 0, arcIdx);
    rsgDrawMesh(partMesh);
    rsClearObject(&bc.ain);
    rsClearObject(&bc.aout);
    return 1;
}
+3 −1
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ static void computeGaussianWeights() {


static void copyInput() {
    rs_allocation ain = rsGetAllocation(InPixel);
    rs_allocation ain = {0};
    rsSetObject(&ain,rsGetAllocation(InPixel));
    uint32_t dimx = rsAllocationGetDimX(ain);
    uint32_t dimy = rsAllocationGetDimY(ain);
    for(uint32_t y = 0; y < dimy; y++) {
@@ -72,6 +73,7 @@ static void copyInput() {
            ScratchPixel1[x + y * dimx] = convert_float4(InPixel[x + y * dimx]);
        }
    }
    rsClearObject(&ain);
}

void filter() {
+3 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ int root(int launchID) {
    rsgBindFont(gItalic);
    color(0.2, 0.2, 0.2, 0);

    rs_allocation listAlloc = rsGetAllocation(gList);
    rs_allocation listAlloc = {0};
    rsSetObject(&listAlloc, rsGetAllocation(gList));
    int allocSize = rsAllocationGetDimX(listAlloc);

    int width = rsgGetWidth();
@@ -66,6 +67,7 @@ int root(int launchID) {
        }
        currentYPos += itemHeight;
    }
    rsClearObject(&listAlloc);

    return 10;
}
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ public class RSTestCore {

        unitTests.add(new UT_primitives(this, mRes));
        unitTests.add(new UT_rsdebug(this, mRes));
        unitTests.add(new UT_rstypes(this, mRes));
        unitTests.add(new UT_fp_mad(this, mRes));
        /*
        unitTests.add(new UnitTest(null, "<Pass>", 1));
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.rs.test;

import android.content.res.Resources;
import android.renderscript.*;

public class UT_rstypes extends UnitTest {
    private Resources mRes;

    protected UT_rstypes(RSTestCore rstc, Resources res) {
        super(rstc, "rsTypes");
        mRes = res;
    }

    public void run() {
        RenderScript pRS = RenderScript.create();
        ScriptC_rstypes s = new ScriptC_rstypes(pRS, mRes, R.raw.rstypes, true);
        pRS.mMessageCallback = mRsMessage;
        s.invoke_test_rstypes(0, 0);
        pRS.finish();
        waitForMessage();
        pRS.destroy();
    }
}
Loading