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

Commit 0664fef9 authored by Chris Craik's avatar Chris Craik
Browse files

Fix BitmapMesh buffer copy

Change-Id: I7c1a3651c7d91d7ff37ecbe18d974fa8cb1cf415
parent 494fb7b5
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));