Test FS getElementAt
bug 7190126
Change-Id: I1fbaa77af051cf44134f8bfe56339ce5d3b7edbb
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs
index 783bc4a..ea42524 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs
@@ -48,15 +48,15 @@
uint32_t y1 = min((int32_t)y+1, (int32_t)(gHeight -1));
uint32_t y2 = max((int32_t)y-1, (int32_t)0);
- uint p00 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x1, y1))[0];
- uint p01 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x, y1))[0];
- uint p02 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x2, y1))[0];
- uint p10 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x1, y))[0];
- uint p11 = 230 * ((uchar *)rsGetElementAt(gBlendSource, x, y))[0];
- uint p12 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x2, y))[0];
- uint p20 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x1, y2))[0];
- uint p21 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x, y2))[0];
- uint p22 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x2, y2))[0];
+ uint p00 = 56 * rsGetElementAt_uchar(gBlendSource, x1, y1);
+ uint p01 = 114 * rsGetElementAt_uchar(gBlendSource, x, y1);
+ uint p02 = 56 * rsGetElementAt_uchar(gBlendSource, x2, y1);
+ uint p10 = 114 * rsGetElementAt_uchar(gBlendSource, x1, y);
+ uint p11 = 230 * rsGetElementAt_uchar(gBlendSource, x, y);
+ uint p12 = 114 * rsGetElementAt_uchar(gBlendSource, x2, y);
+ uint p20 = 56 * rsGetElementAt_uchar(gBlendSource, x1, y2);
+ uint p21 = 114 * rsGetElementAt_uchar(gBlendSource, x, y2);
+ uint p22 = 56 * rsGetElementAt_uchar(gBlendSource, x2, y2);
p00 += p01;
p02 += p10;
@@ -78,7 +78,7 @@
rs_allocation gNoise;
void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) {
float4 ip = convert_float4(*in);
- float pnoise = (float) ((uchar *)rsGetElementAt(gNoise, x, y))[0];
+ float pnoise = (float) rsGetElementAt_uchar(gNoise, x, y);
float energy_level = ip.r + ip.g + ip.b;
float energy_mask = (28.f - sqrt(energy_level)) * 0.03571f;