Fix crash in viewer on certain android devices
authoregdaniel <egdaniel@google.com>
Thu, 11 Aug 2016 15:15:12 +0000 (08:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Aug 2016 15:15:12 +0000 (08:15 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2239493002

Review-Url: https://codereview.chromium.org/2239493002

tools/viewer/sk_app/android/VulkanWindowContext_android.cpp

index 68f2051..b50e152 100644 (file)
@@ -15,11 +15,9 @@ namespace window_context_factory {
 
 WindowContext* NewVulkanForAndroid(ANativeWindow* window, const DisplayParams& params) {
     auto createVkSurface = [window] (VkInstance instance) -> VkSurfaceKHR {
-        static PFN_vkCreateAndroidSurfaceKHR createAndroidSurfaceKHR = nullptr;
-        if (!createAndroidSurfaceKHR) {
-            createAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR)vkGetInstanceProcAddr(
-                instance, "vkCreateAndroidSurfaceKHR");
-        }
+        PFN_vkCreateAndroidSurfaceKHR createAndroidSurfaceKHR =
+                (PFN_vkCreateAndroidSurfaceKHR)vkGetInstanceProcAddr(instance,
+                                                                     "vkCreateAndroidSurfaceKHR");
 
         if (!window) {
             return VK_NULL_HANDLE;