Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d94016e0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix drawVertices in HW accel"

parents 6ec1461d d51e9947
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -536,9 +536,6 @@ public class RecordingCanvas extends Canvas {
            @Nullable int[] colors, int colorOffset, @Nullable short[] indices, int indexOffset,
            int indexCount, @NonNull Paint paint) {
        checkRange(verts.length, vertOffset, vertexCount);
        if (isHardwareAccelerated()) {
            return;
        }
        if (texs != null) {
            checkRange(texs.length, texOffset, vertexCount);
        }
+4 −2
Original line number Diff line number Diff line
@@ -320,9 +320,12 @@ static void drawVertices(JNIEnv* env, jobject, jlong canvasHandle,
                         jintArray jcolors, jint colorIndex,
                         jshortArray jindices, jint indexIndex,
                         jint indexCount, jlong paintHandle) {

    const int vertexCount = floatCount >> 1;  // 2 floats per SkPoint

    AutoJavaFloatArray  vertA(env, jverts, vertIndex + floatCount);
    AutoJavaFloatArray  texA(env, jtexs, texIndex + floatCount);
    AutoJavaIntArray    colorA(env, jcolors, colorIndex + floatCount);
    AutoJavaIntArray    colorA(env, jcolors, colorIndex + vertexCount);
    AutoJavaShortArray  indexA(env, jindices, indexIndex + indexCount);

    const float* verts = vertA.ptr() + vertIndex;
@@ -337,7 +340,6 @@ static void drawVertices(JNIEnv* env, jobject, jlong canvasHandle,
        indices = (const uint16_t*)(indexA.ptr() + indexIndex);
    }

    int vertexCount = floatCount >> 1;  // 2 floats per SkPoint
    SkVertices::VertexMode mode = static_cast<SkVertices::VertexMode>(modeHandle);
    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
    get_canvas(canvasHandle)->drawVertices(SkVertices::MakeCopy(mode, vertexCount,