Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: tools/flags/SkCommandLineFlags.h

Issue 1350323002: Add slice tool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename slice to imgslice Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | tools/imgslice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*/
« no previous file with comments | « gyp/tools.gyp ('k') | tools/imgslice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698