Index: tools/flags/SkCommonFlagsConfig.cpp |
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp |
index 0847ae5b79ea268947ef0bf3c8633c0db754b37d..a0d1c77dd962bc594c7ef77a793e720051349ca6 100644 |
--- a/tools/flags/SkCommonFlagsConfig.cpp |
+++ b/tools/flags/SkCommonFlagsConfig.cpp |
@@ -44,6 +44,9 @@ static const char configHelp[] = |
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
" hwui" |
#endif |
+#ifdef SK_VULKAN |
+ " vk" |
+#endif |
" or use extended form 'backend(option=value,...)'.\n"; |
static const char configExtendedHelp[] = |
@@ -72,6 +75,9 @@ static const char configExtendedHelp[] = |
#if SK_MESA |
"\t\tmesa\t\t\tUse MESA.\n" |
#endif |
+#ifdef SK_VULKAN |
+ "\t\tvulkan\t\t\tUse Vulkan.\n" |
+#endif |
"\tcolor\ttype: string\tdefault: 8888.\n" |
"\t Select framebuffer color format.\n" |
"\t Options:\n" |
@@ -117,6 +123,9 @@ static const char configExtendedHelp[] = |
#if SK_MESA |
"\tmesa \t= gpu(api=mesa)\n" |
#endif |
+#ifdef SK_VULKAN |
+ "\vk \t= gpu(api=vulkan)\n" |
+#endif |
#endif |
; |
@@ -159,6 +168,10 @@ static const struct { |
#if SK_MESA |
, { "mesa", "gpu", "api=mesa" } |
#endif |
+#ifdef SK_VULKAN |
+ , { "vk", "gpu", "api=vulkan" } |
+#endif |
+ |
#else |
{ "", "", "" } |
#endif |
@@ -251,6 +264,12 @@ static bool parse_option_gpu_api(const SkString& value, |
return true; |
} |
#endif |
+#ifdef SK_VULKAN |
+ if (value.equals("vulkan")) { |
+ *outContextType = GrContextFactory::kVulkan_ContextType; |
+ return true; |
+ } |
+#endif |
return false; |
} |
static bool parse_option_gpu_color(const SkString& value, |