summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests/ComputePerf/src/com/example/android
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2011-11-10 14:18:27 -0800
committerJason Sams <jsams@google.com>2011-11-10 14:19:19 -0800
commit91e0dc7eb549462f9648856b5750dc82f967be7e (patch)
tree2fe0ff8c87b3121284733474be6665821a98f2f4 /tests/RenderScriptTests/ComputePerf/src/com/example/android
parent137266978bc08cbd147ad46c23aa26a7fe64f0f7 (diff)
downloadframeworks_base-91e0dc7eb549462f9648856b5750dc82f967be7e.zip
frameworks_base-91e0dc7eb549462f9648856b5750dc82f967be7e.tar.gz
frameworks_base-91e0dc7eb549462f9648856b5750dc82f967be7e.tar.bz2
Make image processing results more stable.
Minor cleanup for mandel benchmark. Change-Id: I549d9572842e9d11ba97362dd343338fea3abe9b
Diffstat (limited to 'tests/RenderScriptTests/ComputePerf/src/com/example/android')
-rw-r--r--tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/mandelbrot.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/mandelbrot.rs b/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/mandelbrot.rs
index a7987b3..0ffb0e5 100644
--- a/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/mandelbrot.rs
+++ b/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/mandelbrot.rs
@@ -25,13 +25,14 @@ void root(uchar4 *v_out, uint32_t x, uint32_t y) {
p.y = -1.f + ((float)y / gDimY) * 2.f;
float2 t = 0;
+ float2 t2 = t * t;
int iteration = 0;
- while((t.x*t.x + t.y*t.y < 4.f) && (iteration < gMaxIteration)) {
- float2 t2 = t * t;
+ while((t2.x + t2.y < 4.f) && (iteration < gMaxIteration)) {
float xtemp = t2.x - t2.y + p.x;
t.y = 2 * t.x * t.y + p.y;
t.x = xtemp;
iteration++;
+ t2 = t * t;
}
if(iteration >= gMaxIteration) {