Index: include/utils/SkRTConf.h |
diff --git a/include/utils/SkRTConf.h b/include/utils/SkRTConf.h |
index d09410ebb17dc256a972e2e2feabcdf6d7780088..4d7cda23d599508d1aad66505346812eddcebb01 100644 |
--- a/include/utils/SkRTConf.h |
+++ b/include/utils/SkRTConf.h |
@@ -52,10 +52,17 @@ protected: |
#ifdef SK_DEVELOPER |
#define SK_CONF_DECLARE(confType, varName, confName, defaultValue, description) static SkRTConf<confType> varName(confName, defaultValue, description) |
-#define SK_CONF_SET(confname, value) skRTConfRegistry().set(confname, value) |
+#define SK_CONF_SET(confname, value) \ |
reed1
2013/11/06 15:02:21
at some point we should clean-up the readability o
|
+ skRTConfRegistry().set(confname, value, true) |
+/* SK_CONF_TRY_SET() is like SK_CONF_SET(), but doesn't complain if |
+ confname can't be found. This is useful if the SK_CONF_DECLARE is |
+ inside a source file whose linkage is dependent on the system. */ |
+#define SK_CONF_TRY_SET(confname, value) \ |
+ skRTConfRegistry().set(confname, value, false) |
#else |
#define SK_CONF_DECLARE(confType, varName, confName, defaultValue, description) static confType varName = defaultValue |
#define SK_CONF_SET(confname, value) (void) confname, (void) value |
+#define SK_CONF_TRY_SET(confname, value) (void) confname, (void) value |
#endif |
/** \class SkRTConfRegistry |
@@ -72,7 +79,9 @@ public: |
const char *configFileLocation() const; |
void possiblyDumpFile() const; |
void validate() const; |
- template <typename T> void set(const char *confname, T value); |
+ template <typename T> void set(const char *confname, |
+ T value, |
+ bool warnIfNotFound = true); |
#ifdef SK_SUPPORT_UNITTEST |
static void UnitTest(); |
#endif |