Mesh Rect -> RectF

Test: build & boot; no functionality changes
Fixes: 267686303
Change-Id: I1f9edb4e2d07823ffdc4f0074b4ef1358849aa99
diff --git a/core/api/current.txt b/core/api/current.txt
index d6be2d2..5be9252 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -15611,8 +15611,8 @@
   }
 
   public class Mesh {
-    ctor public Mesh(@NonNull android.graphics.MeshSpecification, int, @NonNull java.nio.Buffer, int, @NonNull android.graphics.Rect);
-    ctor public Mesh(@NonNull android.graphics.MeshSpecification, int, @NonNull java.nio.Buffer, int, @NonNull java.nio.ShortBuffer, @NonNull android.graphics.Rect);
+    ctor public Mesh(@NonNull android.graphics.MeshSpecification, int, @NonNull java.nio.Buffer, int, @NonNull android.graphics.RectF);
+    ctor public Mesh(@NonNull android.graphics.MeshSpecification, int, @NonNull java.nio.Buffer, int, @NonNull java.nio.ShortBuffer, @NonNull android.graphics.RectF);
     method public void setColorUniform(@NonNull String, @ColorInt int);
     method public void setColorUniform(@NonNull String, @ColorLong long);
     method public void setColorUniform(@NonNull String, @NonNull android.graphics.Color);
diff --git a/graphics/java/android/graphics/Mesh.java b/graphics/java/android/graphics/Mesh.java
index ce673ce..6a1313e 100644
--- a/graphics/java/android/graphics/Mesh.java
+++ b/graphics/java/android/graphics/Mesh.java
@@ -76,7 +76,7 @@
      * @param bounds       bounds of the mesh object.
      */
     public Mesh(@NonNull MeshSpecification meshSpec, @Mode int mode,
-            @NonNull Buffer vertexBuffer, int vertexCount, @NonNull Rect bounds) {
+            @NonNull Buffer vertexBuffer, int vertexCount, @NonNull RectF bounds) {
         if (mode != TRIANGLES && mode != TRIANGLE_STRIP) {
             throw new IllegalArgumentException("Invalid value passed in for mode parameter");
         }
@@ -110,7 +110,7 @@
      */
     public Mesh(@NonNull MeshSpecification meshSpec, @Mode int mode,
             @NonNull Buffer vertexBuffer, int vertexCount, @NonNull ShortBuffer indexBuffer,
-            @NonNull Rect bounds) {
+            @NonNull RectF bounds) {
         if (mode != TRIANGLES && mode != TRIANGLE_STRIP) {
             throw new IllegalArgumentException("Invalid value passed in for mode parameter");
         }
@@ -364,13 +364,13 @@
     private static native long nativeGetFinalizer();
 
     private static native long nativeMake(long meshSpec, int mode, Buffer vertexBuffer,
-            boolean isDirect, int vertexCount, int vertexOffset, int left, int top, int right,
-            int bottom);
+            boolean isDirect, int vertexCount, int vertexOffset, float left, float top, float right,
+            float bottom);
 
     private static native long nativeMakeIndexed(long meshSpec, int mode, Buffer vertexBuffer,
             boolean isVertexDirect, int vertexCount, int vertexOffset, ShortBuffer indexBuffer,
-            boolean isIndexDirect, int indexCount, int indexOffset, int left, int top, int right,
-            int bottom);
+            boolean isIndexDirect, int indexCount, int indexOffset, float left, float top,
+            float right, float bottom);
 
     private static native void nativeUpdateUniforms(long builder, String uniformName, float value1,
             float value2, float value3, float value4, int count);
diff --git a/libs/hwui/jni/Mesh.cpp b/libs/hwui/jni/Mesh.cpp
index 3aac48d..b13d9ba 100644
--- a/libs/hwui/jni/Mesh.cpp
+++ b/libs/hwui/jni/Mesh.cpp
@@ -38,8 +38,8 @@
 }
 
 static jlong make(JNIEnv* env, jobject, jlong meshSpec, jint mode, jobject vertexBuffer,
-                  jboolean isDirect, jint vertexCount, jint vertexOffset, jint left, jint top,
-                  jint right, jint bottom) {
+                  jboolean isDirect, jint vertexCount, jint vertexOffset, jfloat left, jfloat top,
+                  jfloat right, jfloat bottom) {
     auto skMeshSpec = sk_ref_sp(reinterpret_cast<SkMeshSpecification*>(meshSpec));
     sk_sp<SkMesh::VertexBuffer> skVertexBuffer =
             genVertexBuffer(env, vertexBuffer, vertexCount * skMeshSpec->stride(), isDirect);
@@ -60,7 +60,7 @@
 static jlong makeIndexed(JNIEnv* env, jobject, jlong meshSpec, jint mode, jobject vertexBuffer,
                          jboolean isVertexDirect, jint vertexCount, jint vertexOffset,
                          jobject indexBuffer, jboolean isIndexDirect, jint indexCount,
-                         jint indexOffset, jint left, jint top, jint right, jint bottom) {
+                         jint indexOffset, jfloat left, jfloat top, jfloat right, jfloat bottom) {
     auto skMeshSpec = sk_ref_sp(reinterpret_cast<SkMeshSpecification*>(meshSpec));
     sk_sp<SkMesh::VertexBuffer> skVertexBuffer =
             genVertexBuffer(env, vertexBuffer, vertexCount * skMeshSpec->stride(), isVertexDirect);
@@ -210,8 +210,8 @@
 
 static const JNINativeMethod gMeshMethods[] = {
         {"nativeGetFinalizer", "()J", (void*)getMeshFinalizer},
-        {"nativeMake", "(JILjava/nio/Buffer;ZIIIIII)J", (void*)make},
-        {"nativeMakeIndexed", "(JILjava/nio/Buffer;ZIILjava/nio/ShortBuffer;ZIIIIII)J",
+        {"nativeMake", "(JILjava/nio/Buffer;ZIIFFFF)J", (void*)make},
+        {"nativeMakeIndexed", "(JILjava/nio/Buffer;ZIILjava/nio/ShortBuffer;ZIIFFFF)J",
          (void*)makeIndexed},
         {"nativeUpdateMesh", "(JZ)V", (void*)updateMesh},
         {"nativeUpdateUniforms", "(JLjava/lang/String;[FZ)V", (void*)updateFloatArrayUniforms},
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java
index 0f97bb2..413f92c 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java
@@ -26,7 +26,7 @@
 import android.graphics.MeshSpecification.Attribute;
 import android.graphics.MeshSpecification.Varying;
 import android.graphics.Paint;
-import android.graphics.Rect;
+import android.graphics.RectF;
 import android.os.Bundle;
 import android.view.View;
 
@@ -65,7 +65,7 @@
             vertexBuffer.put(5, 400.0f);
             vertexBuffer.rewind();
             Mesh mesh = new Mesh(
-                    meshSpec, Mesh.TRIANGLES, vertexBuffer, 3, new Rect(0, 0, 1000, 1000));
+                    meshSpec, Mesh.TRIANGLES, vertexBuffer, 3, new RectF(0, 0, 1000, 1000));
 
             canvas.drawMesh(mesh, BlendMode.COLOR, new Paint());
 
@@ -99,7 +99,7 @@
             iVertexBuffer.rewind();
             indexBuffer.rewind();
             Mesh mesh2 = new Mesh(meshSpec, Mesh.TRIANGLES, iVertexBuffer, 102, indexBuffer,
-                    new Rect(0, 0, 1000, 1000));
+                    new RectF(0, 0, 1000, 1000));
             Paint paint = new Paint();
             paint.setColor(Color.RED);
             canvas.drawMesh(mesh2, BlendMode.COLOR, paint);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java
index bb296cc..e62db6b 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java
@@ -26,7 +26,7 @@
 import android.graphics.MeshSpecification.Attribute;
 import android.graphics.MeshSpecification.Varying;
 import android.graphics.Paint;
-import android.graphics.Rect;
+import android.graphics.RectF;
 import android.os.Bundle;
 import android.view.View;
 
@@ -111,7 +111,7 @@
             indexBuffer.rewind();
             Mesh mesh = new Mesh(
                     meshSpec, Mesh.TRIANGLES, vertexBuffer, numTriangles + 2, indexBuffer,
-                    new Rect(0, 0, 1000, 1000)
+                    new RectF(0, 0, 1000, 1000)
             );
             mesh.setFloatUniform("test", 1.0f, 2.0f);
             Paint paint = new Paint();