New SkRTConf macro SK_CONF_TRY_SET: no complaint on missing configuration

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.

Internally to the SkRTConf system, SkRTConfRegistry::set() was given
an additional parameter controling wanrings.

A new RuntimeConfig unit test was introduced.  It should run silently.
In the future, it should be expanded to cover all of the SkRTConf
functionality.

(For example, the images.jpeg.suppressDecoderWarnings variable is
defined and used only in SkImageDecoder_libjpeg.cpp, but on MacOS, we
use Core Graphics via SkImageDecoder_CG.cpp - SkImageDecoder_libjpeg
is never linked in.  The same is true of the Windows Imaging Component
on Windows.)

BUG=
R=reed@google.com

Review URL: https://codereview.chromium.org/54503007

git-svn-id: http://skia.googlecode.com/svn/trunk/include@12155 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/utils/SkRTConf.h b/utils/SkRTConf.h
index d09410e..4d7cda2 100644
--- a/utils/SkRTConf.h
+++ b/utils/SkRTConf.h
@@ -52,10 +52,17 @@
 
 #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) \
+    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 @@
     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