Index: src/gpu/vk/GrVkGpu.cpp |
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp |
index 6b36cdb7c801dd4e7dd09374268a0e5e00ff0e91..a208aed456405f8184f14cfc7eaed0e9c6dbda2b 100644 |
--- a/src/gpu/vk/GrVkGpu.cpp |
+++ b/src/gpu/vk/GrVkGpu.cpp |
@@ -180,6 +180,8 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, |
fVkCaps.reset(new GrVkCaps(options, fInterface, physDev)); |
fCaps.reset(SkRef(fVkCaps.get())); |
+ fResourceProvider.init(); |
+ |
fCurrentCmdBuffer = fResourceProvider.createCommandBuffer(); |
SkASSERT(fCurrentCmdBuffer); |
fCurrentCmdBuffer->begin(this); |
@@ -267,6 +269,9 @@ bool GrVkGpu::onWritePixels(GrSurface* surface, |
} |
// TODO: We're ignoring MIP levels here. |
+ if (texels.empty() || !texels.begin()->fPixels) { |
+ return false; |
+ } |
// We assume Vulkan doesn't do sRGB <-> linear conversions when reading and writing pixels. |
if (GrPixelConfigIsSRGB(surface->config()) != GrPixelConfigIsSRGB(config)) { |
@@ -537,7 +542,7 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::Li |
} |
// TODO: We're ignoring MIP levels here. |
- if (!texels.empty()) { |
+ if (!texels.empty() && texels.begin()->fPixels) { |
if (!this->uploadTexData(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fConfig, |
texels.begin()->fPixels, texels.begin()->fRowBytes)) { |
tex->unref(); |