| 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 "SkPDFResourceDict.h" | 8 #include "SkPDFResourceDict.h" |
| 9 #include "SkPostConfig.h" | 9 #include "SkPostConfig.h" |
| 10 | 10 |
| 11 SK_DEFINE_INST_COUNT(SkPDFResourceDict) | |
| 12 | |
| 13 // Sanity check that the values of enum SkPDFResourceType correspond to the | 11 // Sanity check that the values of enum SkPDFResourceType correspond to the |
| 14 // expected values as defined in the arrays below. | 12 // expected values as defined in the arrays below. |
| 15 // If these are failing, you may need to update the resource_type_prefixes | 13 // If these are failing, you may need to update the resource_type_prefixes |
| 16 // and resource_type_names arrays below. | 14 // and resource_type_names arrays below. |
| 17 SK_COMPILE_ASSERT(SkPDFResourceDict::kExtGState_ResourceType == 0, | 15 SK_COMPILE_ASSERT(SkPDFResourceDict::kExtGState_ResourceType == 0, |
| 18 resource_type_mismatch); | 16 resource_type_mismatch); |
| 19 SK_COMPILE_ASSERT(SkPDFResourceDict::kPattern_ResourceType == 1, | 17 SK_COMPILE_ASSERT(SkPDFResourceDict::kPattern_ResourceType == 1, |
| 20 resource_type_mismatch); | 18 resource_type_mismatch); |
| 21 SK_COMPILE_ASSERT(SkPDFResourceDict::kXObject_ResourceType == 2, | 19 SK_COMPILE_ASSERT(SkPDFResourceDict::kXObject_ResourceType == 2, |
| 22 resource_type_mismatch); | 20 resource_type_mismatch); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 insert(typeName, newDict); // ref counting handled here | 115 insert(typeName, newDict); // ref counting handled here |
| 118 fTypes[type] = newDict; | 116 fTypes[type] = newDict; |
| 119 typeDict = newDict.get(); | 117 typeDict = newDict.get(); |
| 120 } | 118 } |
| 121 | 119 |
| 122 SkAutoTUnref<SkPDFName> keyName( | 120 SkAutoTUnref<SkPDFName> keyName( |
| 123 SkNEW_ARGS(SkPDFName, (getResourceName(type, key)))); | 121 SkNEW_ARGS(SkPDFName, (getResourceName(type, key)))); |
| 124 typeDict->insert(keyName, value); | 122 typeDict->insert(keyName, value); |
| 125 return value; | 123 return value; |
| 126 } | 124 } |
| OLD | NEW |