| 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 #include "SkRTConf.h" | 8 #include "SkRTConf.h" |
| 9 #include "SkOSFile.h" | 9 #include "SkOSFile.h" |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (confArray->getAt(0)->isDefault()) { | 98 if (confArray->getAt(0)->isDefault()) { |
| 99 o->writeText("# "); | 99 o->writeText("# "); |
| 100 } | 100 } |
| 101 confArray->getAt(0)->print(o); | 101 confArray->getAt(0)->print(o); |
| 102 o->newline(); | 102 o->newline(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 delete o; | 105 delete o; |
| 106 } | 106 } |
| 107 | 107 |
| 108 int SkRTConfRegistry::countNonDefault() const { |
| 109 int count = 0; |
| 110 ConfMap::Iter iter(fConfs); |
| 111 SkTDArray<SkRTConfBase *> *confArray; |
| 112 while (iter.next(&confArray)) { |
| 113 if (!confArray->getAt(0)->isDefault()) { |
| 114 ++count; |
| 115 } |
| 116 } |
| 117 return count; |
| 118 } |
| 119 |
| 108 void SkRTConfRegistry::printNonDefault(const char *fname) const { | 120 void SkRTConfRegistry::printNonDefault(const char *fname) const { |
| 109 SkWStream *o; | 121 SkWStream *o; |
| 110 | 122 |
| 111 if (NULL != fname) { | 123 if (NULL != fname) { |
| 112 o = new SkFILEWStream(fname); | 124 o = new SkFILEWStream(fname); |
| 113 } else { | 125 } else { |
| 114 o = new SkDebugWStream(); | 126 o = new SkDebugWStream(); |
| 115 } | 127 } |
| 116 ConfMap::Iter iter(fConfs); | 128 ConfMap::Iter iter(fConfs); |
| 117 SkTDArray<SkRTConfBase *> *confArray; | 129 SkTDArray<SkRTConfBase *> *confArray; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 sk_setenv("skia_nonexistent_item", "132"); | 328 sk_setenv("skia_nonexistent_item", "132"); |
| 317 int result = 0; | 329 int result = 0; |
| 318 registryWithoutContents.parse("nonexistent.item", &result); | 330 registryWithoutContents.parse("nonexistent.item", &result); |
| 319 SkASSERT(result == 132); | 331 SkASSERT(result == 132); |
| 320 } | 332 } |
| 321 | 333 |
| 322 SkRTConfRegistry::SkRTConfRegistry(bool) | 334 SkRTConfRegistry::SkRTConfRegistry(bool) |
| 323 : fConfs(100) { | 335 : fConfs(100) { |
| 324 } | 336 } |
| 325 #endif | 337 #endif |
| OLD | NEW |