From d66110f5972169dbcda8932c3a9a001adff23df4 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Tue, 28 Jun 2016 13:38:26 -0700 Subject: [PATCH] Fix vulkan onGetWritePixelsInfo When the configs are the same in Vulkan we know we can do write pixels, but the caller may need to do a draw, so make sure we set up the tempDrawInfo before returning. BUG=skia:5461, skia:5458 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2108873003 Review-Url: https://codereview.chromium.org/2108873003 --- src/gpu/vk/GrVkGpu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index ca6ccde..e5d24fc 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -252,10 +252,6 @@ bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, return false; } - if (dstSurface->config() == srcConfig) { - return true; - } - GrRenderTarget* renderTarget = dstSurface->asRenderTarget(); // Start off assuming no swizzling @@ -271,6 +267,10 @@ bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, tempDrawInfo->fTempSurfaceDesc.fSampleCnt = 0; tempDrawInfo->fTempSurfaceDesc.fOrigin = kTopLeft_GrSurfaceOrigin; + if (dstSurface->config() == srcConfig) { + return true; + } + if (renderTarget && this->vkCaps().isConfigRenderable(renderTarget->config(), false)) { ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); -- 2.7.4