Fix vulkan onGetWritePixelsInfo
authoregdaniel <egdaniel@google.com>
Tue, 28 Jun 2016 20:38:26 +0000 (13:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 28 Jun 2016 20:38:26 +0000 (13:38 -0700)
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

index ca6ccde..e5d24fc 100644 (file)
@@ -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);