summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-09-07 15:40:00 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-07 15:40:11 -0700
commitcd664f0faaaab2442733a9d2675a69a6429549a5 (patch)
tree9dfb5d648a4eca2c2177a006b2a0a9f812840c0f /tests
parent3f7bbe8cd37aba1be1a80222270057d78a032b54 (diff)
parentc1ccbf52319993634e3bcc2433c66aff6dd87707 (diff)
downloadframeworks_base-cd664f0faaaab2442733a9d2675a69a6429549a5.zip
frameworks_base-cd664f0faaaab2442733a9d2675a69a6429549a5.tar.gz
frameworks_base-cd664f0faaaab2442733a9d2675a69a6429549a5.tar.bz2
Merge "Add greyscale intrinsic test." into jb-mr1-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorMatrix.java10
-rw-r--r--tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java12
2 files changed, 16 insertions, 6 deletions
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorMatrix.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorMatrix.java
index 87a2de1..2ac40a1 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorMatrix.java
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorMatrix.java
@@ -33,9 +33,11 @@ public class ColorMatrix extends TestBase {
private ScriptC_colormatrix mScript;
private ScriptIntrinsicColorMatrix mIntrinsic;
private boolean mUseIntrinsic;
+ private boolean mUseGrey;
- public ColorMatrix(boolean useIntrinsic) {
+ public ColorMatrix(boolean useIntrinsic, boolean useGrey) {
mUseIntrinsic = useIntrinsic;
+ mUseGrey = useGrey;
}
public void createTest(android.content.res.Resources res) {
@@ -46,7 +48,11 @@ public class ColorMatrix extends TestBase {
if (mUseIntrinsic) {
mIntrinsic = ScriptIntrinsicColorMatrix.create(mRS, Element.U8_4(mRS));
- mIntrinsic.setColorMatrix(m);
+ if (mUseGrey) {
+ mIntrinsic.setGreyscale();
+ } else {
+ mIntrinsic.setColorMatrix(m);
+ }
} else {
mScript = new ScriptC_colormatrix(mRS, res, R.raw.colormatrix);
mScript.invoke_setMatrix(m);
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
index 2e7c671..37577eb 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
@@ -180,12 +180,15 @@ public class ImageProcessingActivity extends Activity
mTest = new Convolve3x3(true);
break;
case 19:
- mTest = new ColorMatrix(false);
+ mTest = new ColorMatrix(false, false);
break;
case 20:
- mTest = new ColorMatrix(true);
+ mTest = new ColorMatrix(true, false);
break;
case 21:
+ mTest = new ColorMatrix(true, true);
+ break;
+ case 22:
mTest = new Copy();
break;
}
@@ -200,7 +203,7 @@ public class ImageProcessingActivity extends Activity
}
void setupTests() {
- mTestNames = new String[22];
+ mTestNames = new String[23];
mTestNames[0] = "Levels Vec3 Relaxed";
mTestNames[1] = "Levels Vec4 Relaxed";
mTestNames[2] = "Levels Vec3 Full";
@@ -222,7 +225,8 @@ public class ImageProcessingActivity extends Activity
mTestNames[18] = "Intrinsics Convolve 3x3";
mTestNames[19] = "ColorMatrix";
mTestNames[20] = "Intrinsics ColorMatrix";
- mTestNames[21] = "Copy";
+ mTestNames[21] = "Intrinsics ColorMatrix Grey";
+ mTestNames[22] = "Copy";
mTestSpinner.setAdapter(new ArrayAdapter<String>(
this, R.layout.spinner_layout, mTestNames));
}