summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-09-06 23:54:05 -0700
committerJason Sams <jsams@google.com>2012-09-06 23:54:05 -0700
commitc1ccbf52319993634e3bcc2433c66aff6dd87707 (patch)
tree4706f0dbc16dfe0370f593fc8661bdbe94c7dee0 /tests/RenderScriptTests
parent8fd5853c1c07c2fd3954b3c5e64702d70af31144 (diff)
downloadframeworks_base-c1ccbf52319993634e3bcc2433c66aff6dd87707.zip
frameworks_base-c1ccbf52319993634e3bcc2433c66aff6dd87707.tar.gz
frameworks_base-c1ccbf52319993634e3bcc2433c66aff6dd87707.tar.bz2
Add greyscale intrinsic test.
Change-Id: I24c9b8769ab7fe2fed9ef17f7ff1063c60977c41
Diffstat (limited to 'tests/RenderScriptTests')
-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));
}