Dawn: fix mipmap width and height computation during upload.

Don't go below 1 in width or height when downsizing for uploads.
This can happen with rectangular textures, where one dimension hits
the lower bound.

Change-Id: Ica28e6274cf1df658145233ab6694f2c64c55201
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252316
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2019-11-01 18:20:01 -04:00 committed by Skia Commit-Bot
parent 1cc6067757
commit b1576fd065

View File

@ -168,7 +168,7 @@ void GrDawnTexture::upload(const GrMipLevel texels[], int mipLevels, const SkIRe
copyEncoder.CopyBufferToTexture(&srcBuffer, &dstTexture, &copySize);
x /= 2;
y /= 2;
width /= 2;
height /= 2;
width = SkTMax(1u, width / 2);
height = SkTMax(1u, height / 2);
}
}