summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-09-18 12:32:10 -0700
committerJason Sams <jsams@google.com>2012-09-18 12:32:10 -0700
commit08a81583c18a849e442ceeb8d7baeca743fb3be8 (patch)
treee249bd2794008cd5c21c7b4c23c9e03d441d017f /tests/RenderScriptTests
parent21dfd7c5fe9e42d2ef3ac7423065c86dfe8f29da (diff)
downloadframeworks_base-08a81583c18a849e442ceeb8d7baeca743fb3be8.zip
frameworks_base-08a81583c18a849e442ceeb8d7baeca743fb3be8.tar.gz
frameworks_base-08a81583c18a849e442ceeb8d7baeca743fb3be8.tar.bz2
Add Kernel, Method, and field IDs
bug 7182873 Change-Id: I066a359bb04027e9376dac088560f042c496b10e
Diffstat (limited to 'tests/RenderScriptTests')
-rw-r--r--tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/GroupTest.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/GroupTest.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/GroupTest.java
index 732da4e..29c204c 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/GroupTest.java
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/GroupTest.java
@@ -21,16 +21,16 @@ import java.lang.Math;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
-import android.renderscript.Script;
-import android.renderscript.ScriptC;
+import android.renderscript.ScriptIntrinsicConvolve3x3;
+import android.renderscript.ScriptIntrinsicColorMatrix;
import android.renderscript.Type;
import android.renderscript.Matrix4f;
import android.renderscript.ScriptGroup;
import android.util.Log;
public class GroupTest extends TestBase {
- private ScriptC_convolve3x3 mConvolve;
- private ScriptC_colormatrix mMatrix;
+ private ScriptIntrinsicConvolve3x3 mConvolve;
+ private ScriptIntrinsicColorMatrix mMatrix;
private Allocation mScratchPixelsAllocation1;
private ScriptGroup mGroup;
@@ -48,20 +48,20 @@ public class GroupTest extends TestBase {
mWidth = mInPixelsAllocation.getType().getX();
mHeight = mInPixelsAllocation.getType().getY();
- mConvolve = new ScriptC_convolve3x3(mRS, res, R.raw.convolve3x3);
- mMatrix = new ScriptC_colormatrix(mRS, res, R.raw.colormatrix);
+ mConvolve = ScriptIntrinsicConvolve3x3.create(mRS, Element.U8_4(mRS));
+ mMatrix = ScriptIntrinsicColorMatrix.create(mRS, Element.U8_4(mRS));
float f[] = new float[9];
f[0] = 0.f; f[1] = -1.f; f[2] = 0.f;
f[3] = -1.f; f[4] = 5.f; f[5] = -1.f;
f[6] = 0.f; f[7] = -1.f; f[8] = 0.f;
- mConvolve.set_gCoeffs(f);
+ mConvolve.setCoefficients(f);
Matrix4f m = new Matrix4f();
m.set(1, 0, 0.2f);
m.set(1, 1, 0.9f);
m.set(1, 2, 0.2f);
- mMatrix.invoke_setMatrix(m);
+ mMatrix.setColorMatrix(m);
Type.Builder tb = new Type.Builder(mRS, Element.U8_4(mRS));
tb.setX(mWidth);
@@ -70,24 +70,23 @@ public class GroupTest extends TestBase {
if (mUseNative) {
ScriptGroup.Builder b = new ScriptGroup.Builder(mRS);
- b.addConnection(connect, mConvolve, mMatrix, null);
+ b.addKernel(mConvolve.getKernelID());
+ b.addKernel(mMatrix.getKernelID());
+ b.addConnection(connect, mConvolve.getKernelID(), mMatrix.getKernelID());
mGroup = b.create();
-
} else {
mScratchPixelsAllocation1 = Allocation.createTyped(mRS, connect);
}
}
public void runTest() {
- mConvolve.set_gIn(mInPixelsAllocation);
- mConvolve.set_gWidth(mWidth);
- mConvolve.set_gHeight(mHeight);
+ mConvolve.setInput(mInPixelsAllocation);
if (mUseNative) {
- mGroup.setOutput(mMatrix, mOutPixelsAllocation);
+ mGroup.setOutput(mMatrix.getKernelID(), mOutPixelsAllocation);
mGroup.execute();
} else {
- mConvolve.forEach_root(mScratchPixelsAllocation1);
- mMatrix.forEach_root(mScratchPixelsAllocation1, mOutPixelsAllocation);
+ mConvolve.forEach(mScratchPixelsAllocation1);
+ mMatrix.forEach(mScratchPixelsAllocation1, mOutPixelsAllocation);
}
}