Add support for creating a shared vulkan test context

Bug: skia:
Change-Id: I997c6269e4676bf4cedddcd87e71d107053678bb
Reviewed-on: https://skia-review.googlesource.com/16905
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index e02bc1b..5aa5785 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -189,16 +189,14 @@
             break;
         }
 #ifdef SK_VULKAN
-        case kVulkan_GrBackend:
-            if (masterContext) {
-                // Shared contexts not supported yet
-                return ContextInfo();
-            }
+        case kVulkan_GrBackend: {
+            VkTestContext* vkSharedContext = masterContext
+                    ? static_cast<VkTestContext*>(masterContext->fTestContext) : nullptr;
             SkASSERT(kVulkan_ContextType == type);
             if (ContextOverrides::kRequireNVPRSupport & overrides) {
                 return ContextInfo();
             }
-            testCtx.reset(CreatePlatformVkTestContext());
+            testCtx.reset(CreatePlatformVkTestContext(vkSharedContext));
             if (!testCtx) {
                 return ContextInfo();
             }
@@ -214,6 +212,7 @@
             }
             backendContext = testCtx->backendContext();
             break;
+        }
 #endif
         default:
             return ContextInfo();