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

Commit dd35634c authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Fix BitmapMesh buffer copy"

parents 296832e0 0664fef9
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -258,11 +258,11 @@ status_t DisplayListRenderer::drawBitmapData(const SkBitmap* bitmap, float left,


status_t DisplayListRenderer::drawBitmapMesh(const SkBitmap* bitmap, int meshWidth, int meshHeight,
status_t DisplayListRenderer::drawBitmapMesh(const SkBitmap* bitmap, int meshWidth, int meshHeight,
        const float* vertices, const int* colors, const SkPaint* paint) {
        const float* vertices, const int* colors, const SkPaint* paint) {
    int count = (meshWidth + 1) * (meshHeight + 1) * 2;
    int vertexCount = (meshWidth + 1) * (meshHeight + 1);
    bitmap = refBitmap(bitmap);
    bitmap = refBitmap(bitmap);
    vertices = refBuffer<float>(vertices, count);
    vertices = refBuffer<float>(vertices, vertexCount * 2); // 2 floats per vertex
    paint = refPaint(paint);
    paint = refPaint(paint);
    colors = refBuffer<int>(colors, count);
    colors = refBuffer<int>(colors, vertexCount); // 1 color per vertex


    addDrawOp(new (alloc()) DrawBitmapMeshOp(bitmap, meshWidth, meshHeight,
    addDrawOp(new (alloc()) DrawBitmapMeshOp(bitmap, meshWidth, meshHeight,
                    vertices, colors, paint));
                    vertices, colors, paint));