Fix height calculation when doing copyImageToBuffer

The bug only manifested when we were forcing copies from the origin.

Bug: skia:
Change-Id: I63f17ad9282b10f0d9c9c9ef38031faad32e20a3
Reviewed-on: https://skia-review.googlesource.com/110445
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2018-02-26 16:14:10 -05:00 committed by Skia Commit-Bot
parent a021f85cc6
commit 3cdfa09a2f

View File

@ -1982,8 +1982,9 @@ bool GrVkGpu::onReadPixels(GrSurface* surface, GrSurfaceOrigin origin, int left,
}
size_t transBufferRowBytes = bpp * region.imageExtent.width;
size_t imageRows = bpp * region.imageExtent.height;
GrVkTransferBuffer* transferBuffer =
static_cast<GrVkTransferBuffer*>(this->createBuffer(transBufferRowBytes * height,
static_cast<GrVkTransferBuffer*>(this->createBuffer(transBufferRowBytes * imageRows,
kXferGpuToCpu_GrBufferType,
kStream_GrAccessPattern));