bsalomon 2016-04-29 18:30:06 -07:00 committed by Commit bot
parent 572f879b61
commit cf942c4ef7
2 changed files with 5 additions and 5 deletions

View File

@ -283,7 +283,7 @@ bool GrVkGpu::onWritePixels(GrSurface* surface,
success = this->uploadTexDataLinear(vkTex, left, top, width, height, config,
texels.begin()->fPixels, texels.begin()->fRowBytes);
} else {
uint32_t mipLevels = texels.count();
int mipLevels = texels.count();
if (vkTex->texturePriv().maxMipMapLevel() != mipLevels) {
if (!vkTex->reallocForMipmap(this, mipLevels)) {
return false;
@ -459,7 +459,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
region.bufferOffset = individualMipOffsets[currentMipLevel];
region.bufferRowLength = currentWidth;
region.bufferImageHeight = currentHeight;
region.imageSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, currentMipLevel, 0, 1 };
region.imageSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, SkToU32(currentMipLevel), 0, 1 };
region.imageOffset = { left, top, 0 };
region.imageExtent = { (uint32_t)currentWidth, (uint32_t)currentHeight, 1 };
}

View File

@ -37,11 +37,11 @@ public:
: INHERITED()
, fImage(VK_NULL_HANDLE)
, fAlloc(VK_NULL_HANDLE)
, fFlags(kNo_Flags)
, fFormat(VK_FORMAT_UNDEFINED) {}
, fFormat(VK_FORMAT_UNDEFINED)
, fFlags(kNo_Flags) {}
Resource(VkImage image, VkDeviceMemory alloc, uint32_t flags, VkFormat format)
: fImage(image), fAlloc(alloc), fFlags(flags), fFormat(format) {}
: fImage(image), fAlloc(alloc), fFormat(format), fFlags(flags) {}
~Resource() override {}