Various fixes in VulkanWindowContext

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4066

Change-Id: Ib42dbe70e868c83bdf06e370388e0cc7639a0992
Reviewed-on: https://skia-review.googlesource.com/4066
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tools/viewer/sk_app/VulkanWindowContext.cpp b/tools/viewer/sk_app/VulkanWindowContext.cpp
index 8ce54f0..9d1e043 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.cpp
+++ b/tools/viewer/sk_app/VulkanWindowContext.cpp
@@ -310,7 +310,7 @@
     fenceInfo.pNext = nullptr;
     fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT;
 
-    // we create one additional backbuffer structure here, because we want to 
+    // we create one additional backbuffer structure here, because we want to
     // give the command buffers they contain a chance to finish before we cycle back
     fBackbuffers = new BackbufferInfo[fImageCount + 1];
     for (uint32_t i = 0; i < fImageCount + 1; ++i) {
@@ -417,7 +417,6 @@
     }
 
     BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex;
-
     GR_VK_CALL_ERRCHECK(fBackendContext->fInterface,
                         WaitForFences(fBackendContext->fDevice, 2, backbuffer->fUsageFences,
                                       true, UINT64_MAX));
@@ -444,7 +443,7 @@
     }
     if (VK_ERROR_OUT_OF_DATE_KHR == res) {
         // tear swapchain down and try again
-        if (!this->createSwapchain(0, 0, fDisplayParams)) {
+        if (!this->createSwapchain(-1, -1, fDisplayParams)) {
             return nullptr;
         }
 
diff --git a/tools/viewer/sk_app/VulkanWindowContext.h b/tools/viewer/sk_app/VulkanWindowContext.h
index abb8730..c1ed871 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.h
+++ b/tools/viewer/sk_app/VulkanWindowContext.h
@@ -36,8 +36,8 @@
         this->createSwapchain(fWidth, fHeight, params);
     }
 
-    GrBackendContext getBackendContext() override { 
-        return (GrBackendContext) fBackendContext.get(); 
+    GrBackendContext getBackendContext() override {
+        return (GrBackendContext) fBackendContext.get();
     }
 
     /** Platform specific function that creates a VkSurfaceKHR for a window */
diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp
index a39bb20..3da8dd1 100644
--- a/tools/viewer/sk_app/WindowContext.cpp
+++ b/tools/viewer/sk_app/WindowContext.cpp
@@ -25,12 +25,13 @@
     return createSurface(nullptr, 0, true, forceSRGB);
 }
 
-sk_sp<SkSurface> WindowContext::createRenderSurface(GrBackendRenderTargetDesc desc, int colorBits) {
+sk_sp<SkSurface> WindowContext::createRenderSurface(const GrBackendRenderTargetDesc& desc,
+                                                    int colorBits) {
     return createSurface(&desc, colorBits, false, false);
 }
 
 sk_sp<SkSurface> WindowContext::createSurface(
-        GrBackendRenderTargetDesc* rtDesc, int colorBits, bool offscreen, bool forceSRGB) {
+        const GrBackendRenderTargetDesc* rtDesc, int colorBits, bool offscreen, bool forceSRGB) {
     if (!this->isGpuContext() || colorBits > 24 || offscreen ||
         kRGBA_F16_SkColorType == fDisplayParams.fColorType) {
         // If we're rendering to F16, we need an off-screen surface - the current render
diff --git a/tools/viewer/sk_app/WindowContext.h b/tools/viewer/sk_app/WindowContext.h
index 99d693a..438d3c0 100644
--- a/tools/viewer/sk_app/WindowContext.h
+++ b/tools/viewer/sk_app/WindowContext.h
@@ -49,7 +49,7 @@
 protected:
     virtual bool isGpuContext() { return true;  }
 
-    sk_sp<SkSurface> createRenderSurface(GrBackendRenderTargetDesc, int colorBits);
+    sk_sp<SkSurface> createRenderSurface(const GrBackendRenderTargetDesc&, int colorBits);
 
     GrContext*        fContext;
 
@@ -61,7 +61,7 @@
 
 private:
     sk_sp<SkSurface> createSurface(
-            GrBackendRenderTargetDesc*, int colorBits, bool offscreen, bool forceSRGB);
+            const GrBackendRenderTargetDesc*, int colorBits, bool offscreen, bool forceSRGB);
 };
 
 }   // namespace sk_app