summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-09-20 17:30:34 -0700
committerJason Sams <jsams@google.com>2012-09-20 17:30:34 -0700
commit36fa5a42ba1e09d1aff2087ad352e6d63f36f652 (patch)
tree307c65070888795759ebb5b30e0ff93816b556b2 /tests
parentd053554f80adaa84d4bdde53656ccce5ae3332b6 (diff)
downloadframeworks_base-36fa5a42ba1e09d1aff2087ad352e6d63f36f652.zip
frameworks_base-36fa5a42ba1e09d1aff2087ad352e6d63f36f652.tar.gz
frameworks_base-36fa5a42ba1e09d1aff2087ad352e6d63f36f652.tar.bz2
Fix aprox fs function names
bug b206696 Change-Id: I64c092c1f6b8d990783bf5d31db37e12a4dbdb82
Diffstat (limited to 'tests')
-rw-r--r--tests/RenderScriptTests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs13
-rw-r--r--tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/fisheye_approx.rsh4
-rw-r--r--tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette_approx.rsh6
3 files changed, 11 insertions, 12 deletions
diff --git a/tests/RenderScriptTests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs b/tests/RenderScriptTests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs
index 7b8ec04..2ee56ec 100644
--- a/tests/RenderScriptTests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs
+++ b/tests/RenderScriptTests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs
@@ -383,13 +383,12 @@ static void bench_fp_math() {
}
static void bench_approx_math() {
- BENCH_FN_FUNC_FN(approx_recip);
- BENCH_FN_FUNC_FN(approx_sqrt);
- BENCH_FN_FUNC_FN(approx_rsqrt);
- BENCH_FN_FUNC_FN(approx_length);
- BENCH_FN_FUNC_FN_FN(approx_distance);
- BENCH_FN_FUNC_FN(approx_normalize);
- BENCH_FN_FUNC_FN(approx_atan);
+ BENCH_FN_FUNC_FN(half_recip);
+ BENCH_FN_FUNC_FN(half_sqrt);
+ BENCH_FN_FUNC_FN(half_rsqrt);
+ BENCH_FN_FUNC_FN(fast_length);
+ BENCH_FN_FUNC_FN_FN(fast_distance);
+ BENCH_FN_FUNC_FN(fast_normalize);
}
void bench() {
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/fisheye_approx.rsh b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/fisheye_approx.rsh
index 008acbe..08b4126 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/fisheye_approx.rsh
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/fisheye_approx.rsh
@@ -48,8 +48,8 @@ void root(uchar4 *out, uint32_t x, uint32_t y) {
const float2 coord = mad(inCoord, inv_dimensions, neg_center);
const float2 scaledCoord = axis_scale * coord;
const float dist2 = scaledCoord.x*scaledCoord.x + scaledCoord.y*scaledCoord.y;
- const float inv_dist = approx_rsqrt(dist2);
- const float radian = M_PI_2 - approx_atan((alpha * approx_sqrt(radius2 - dist2)) * inv_dist);
+ const float inv_dist = half_rsqrt(dist2);
+ const float radian = M_PI_2 - atan((alpha * half_sqrt(radius2 - dist2)) * inv_dist);
const float scalar = radian * factor * inv_dist;
const float2 new_coord = mad(coord, scalar, center);
const float4 fout = rsSample(in_alloc, sampler, new_coord);
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette_approx.rsh b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette_approx.rsh
index 19d0117..7f7bdcf 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette_approx.rsh
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette_approx.rsh
@@ -49,9 +49,9 @@ void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) {
const float4 fin = convert_float4(*in);
const float2 inCoord = {(float)x, (float)y};
const float2 coord = mad(inCoord, inv_dimensions, neg_center);
- const float sloped_dist_ratio = approx_length(axis_scale * coord) * sloped_inv_max_dist;
- // TODO: add approx_exp once implemented
- const float lumen = opp_shade + shade * approx_recip(1.f + sloped_neg_range * exp(sloped_dist_ratio));
+ const float sloped_dist_ratio = fast_length(axis_scale * coord) * sloped_inv_max_dist;
+ // TODO: add half_exp once implemented
+ const float lumen = opp_shade + shade * half_recip(1.f + sloped_neg_range * exp(sloped_dist_ratio));
float4 fout;
fout.rgb = fin.rgb * lumen;
fout.w = fin.w;