Index: tools/flags/SkCommandLineFlags.h |
diff --git a/tools/flags/SkCommandLineFlags.h b/tools/flags/SkCommandLineFlags.h |
index bf8f1403d034705b78e0ca2e179e04ff120b8a2e..5909413523143f87fd9d25eab0d565a37d82c082 100644 |
--- a/tools/flags/SkCommandLineFlags.h |
+++ b/tools/flags/SkCommandLineFlags.h |
@@ -218,6 +218,9 @@ SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(nam |
#define DECLARE_string(name) extern SkCommandLineFlags::StringArray FLAGS_##name; |
+ |
+ |
+ |
#define DEFINE_int32(name, defaultValue, helpString) \ |
int32_t FLAGS_##name; \ |
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateIntFlag(TO_STRING(name), \ |
@@ -225,6 +228,14 @@ SK_UNUSED static bool unused_##name = SkFlagInfo::CreateIntFlag(TO_STRING(name), |
defaultValue, \ |
helpString) |
+#define DEFINE_int32_2(name, shortName, defaultValue, helpString) \ |
+int32_t FLAGS_##name; \ |
+SK_UNUSED static bool unused_##name = SkFlagInfo::CreateIntFlag(TO_STRING(name), \ |
+ TO_STRING(shortName), \ |
+ &FLAGS_##name, \ |
+ defaultValue, \ |
+ helpString) |
+ |
#define DECLARE_int32(name) extern int32_t FLAGS_##name; |
#define DEFINE_double(name, defaultValue, helpString) \ |
@@ -289,6 +300,14 @@ public: |
return true; |
} |
+ static bool CreateIntFlag(const char* name, const char* shortName, int32_t* pInt, |
+ int32_t defaultValue, const char* helpString) { |
+ SkFlagInfo* info = new SkFlagInfo(name, shortName, kInt_FlagType, helpString); |
+ info->fIntValue = pInt; |
+ *info->fIntValue = info->fDefaultInt = defaultValue; |
+ return true; |
+ } |
+ |
/** |
* See comments for CreateBoolFlag. |
*/ |