[RenderScript] Fix refocus test to accommodate different rounding
behavior for half_sqrt().

Bug: 27882507
Change-Id: I971b674cad5bdce3b6fb14526285a48141451281
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_d1new_helper.rsh b/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_d1new_helper.rsh
index 39c8d90..77a0c31 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_d1new_helper.rsh
+++ b/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_d1new_helper.rsh
@@ -73,7 +73,7 @@
   }
 
   // Converts min_dist to a matte value.
-  rsSetElementAt_uchar(g_sharp_matte, (uchar)(dilation_radius + 1 - (int)half_sqrt((float)min_dist)), index_sharp_meta);
+  rsSetElementAt_uchar(g_sharp_matte, (uchar)(dilation_radius + 1 - (int)(half_sqrt((float)min_dist) + 0.5f)), index_sharp_meta);
   // If sharp->matte > 0, depth must be within the depth range of this layer.
   rsSetElementAt_uchar(g_sharp_dilated_depth, (uchar)depth, index_sharp_meta);
 }
@@ -113,7 +113,7 @@
     current_meta_index += jump_to_next_row;
   }
   // Converts min_dist to a matte value.
-  rsSetElementAt_uchar(g_sharp_matte, (uchar)(dilation_radius + 1 - (int)half_sqrt((float)min_dist)), index_sharp_meta);
+  rsSetElementAt_uchar(g_sharp_matte, (uchar)(dilation_radius + 1 - (int)(half_sqrt((float)min_dist) + 0.5f)), index_sharp_meta);
   // If sharp->matte > 0, depth must be within the depth range of this layer.
   return (uchar)depth;
 }