| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google, Inc. | 2 * Copyright 2013 Google, Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #ifndef SkRTConf_DEFINED | 9 #ifndef SkRTConf_DEFINED |
| 10 #define SkRTConf_DEFINED | 10 #define SkRTConf_DEFINED |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 /** \class SkRTConfRegistry | 68 /** \class SkRTConfRegistry |
| 69 A class that maintains a systemwide registry of all runtime configuration | 69 A class that maintains a systemwide registry of all runtime configuration |
| 70 parameters. Mainly used for printing them out and handling multiply-defined | 70 parameters. Mainly used for printing them out and handling multiply-defined |
| 71 knobs. | 71 knobs. |
| 72 */ | 72 */ |
| 73 | 73 |
| 74 class SkRTConfRegistry { | 74 class SkRTConfRegistry { |
| 75 public: | 75 public: |
| 76 SkRTConfRegistry(); | 76 SkRTConfRegistry(); |
| 77 void printAll(const char *fname = NULL) const; | 77 void printAll(const char *fname = NULL) const; |
| 78 bool hasNonDefault() const; |
| 78 void printNonDefault(const char *fname = NULL) const; | 79 void printNonDefault(const char *fname = NULL) const; |
| 79 const char *configFileLocation() const; | 80 const char *configFileLocation() const; |
| 80 void possiblyDumpFile() const; | 81 void possiblyDumpFile() const; |
| 81 void validate() const; | 82 void validate() const; |
| 82 template <typename T> void set(const char *confname, | 83 template <typename T> void set(const char *confname, |
| 83 T value, | 84 T value, |
| 84 bool warnIfNotFound = true); | 85 bool warnIfNotFound = true); |
| 85 #ifdef SK_SUPPORT_UNITTEST | 86 #ifdef SK_SUPPORT_UNITTEST |
| 86 static void UnitTest(); | 87 static void UnitTest(); |
| 87 #endif | 88 #endif |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // static_cast here is okay because there's only one kind of child class. | 185 // static_cast here is okay because there's only one kind of child class. |
| 185 const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf); | 186 const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf); |
| 186 return child_pointer && | 187 return child_pointer && |
| 187 fName == child_pointer->fName && | 188 fName == child_pointer->fName && |
| 188 fDescription == child_pointer->fDescription && | 189 fDescription == child_pointer->fDescription && |
| 189 fValue == child_pointer->fValue && | 190 fValue == child_pointer->fValue && |
| 190 fDefault == child_pointer->fDefault; | 191 fDefault == child_pointer->fDefault; |
| 191 } | 192 } |
| 192 | 193 |
| 193 #endif | 194 #endif |
| OLD | NEW |