Loading libs/rs/java/Balls/src/com/android/balls/balls.rs +7 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -99,6 +99,8 @@ int root() { rsgBindProgramStore(gPS); rsgDrawMesh(arcMesh, 0, 0, arcIdx); rsgDrawMesh(partMesh); rsClearObject(&bc.ain); rsClearObject(&bc.aout); return 1; } libs/rs/java/ImageProcessing/src/com/android/rs/image/threshold.rs +3 −1 Original line number Diff line number Diff line Loading @@ -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++) { Loading @@ -72,6 +73,7 @@ static void copyInput() { ScratchPixel1[x + y * dimx] = convert_float4(InPixel[x + y * dimx]); } } rsClearObject(&ain); } void filter() { Loading libs/rs/java/Samples/src/com/android/samples/rslist.rs +3 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -66,6 +67,7 @@ int root(int launchID) { } currentYPos += itemHeight; } rsClearObject(&listAlloc); return 10; } libs/rs/java/tests/src/com/android/rs/test/RSTestCore.java +1 −0 Original line number Diff line number Diff line Loading @@ -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)); Loading libs/rs/java/tests/src/com/android/rs/test/UT_rstypes.java 0 → 100644 +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
libs/rs/java/Balls/src/com/android/balls/balls.rs +7 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -99,6 +99,8 @@ int root() { rsgBindProgramStore(gPS); rsgDrawMesh(arcMesh, 0, 0, arcIdx); rsgDrawMesh(partMesh); rsClearObject(&bc.ain); rsClearObject(&bc.aout); return 1; }
libs/rs/java/ImageProcessing/src/com/android/rs/image/threshold.rs +3 −1 Original line number Diff line number Diff line Loading @@ -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++) { Loading @@ -72,6 +73,7 @@ static void copyInput() { ScratchPixel1[x + y * dimx] = convert_float4(InPixel[x + y * dimx]); } } rsClearObject(&ain); } void filter() { Loading
libs/rs/java/Samples/src/com/android/samples/rslist.rs +3 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -66,6 +67,7 @@ int root(int launchID) { } currentYPos += itemHeight; } rsClearObject(&listAlloc); return 10; }
libs/rs/java/tests/src/com/android/rs/test/RSTestCore.java +1 −0 Original line number Diff line number Diff line Loading @@ -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)); Loading
libs/rs/java/tests/src/com/android/rs/test/UT_rstypes.java 0 → 100644 +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(); } }