From: egdaniel Date: Tue, 28 Jun 2016 20:38:26 +0000 (-0700) Subject: Fix vulkan onGetWritePixelsInfo X-Git-Tag: submit/tizen/20180928.044319~129^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d66110f5972169dbcda8932c3a9a001adff23df4;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index ca6ccde67a..e5d24fc580 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);