Fix FallRS by keeping a reference to the mesh.
diff --git a/java/Fall/src/com/android/fall/rs/FallRS.java b/java/Fall/src/com/android/fall/rs/FallRS.java
index 3b13bed..8a33d66 100644
--- a/java/Fall/src/com/android/fall/rs/FallRS.java
+++ b/java/Fall/src/com/android/fall/rs/FallRS.java
@@ -103,6 +103,9 @@
private int mMeshWidth;
private int mMeshHeight;
+ @SuppressWarnings({"FieldCanBeLocal"})
+ private RenderScript.TriangleMesh mMesh;
+
private Allocation mRippleMap;
private Allocation mRefractionMap;
@@ -211,8 +214,8 @@
}
}
- RenderScript.TriangleMesh mesh = rs.triangleMeshCreate();
- mesh.setName("WaterMesh");
+ mMesh = rs.triangleMeshCreate();
+ mMesh.setName("WaterMesh");
mMeshWidth = wResolution + 1;
mMeshHeight = hResolution + 1;