OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkPDFCatalog.h" | 10 #include "SkPDFCatalog.h" |
11 #include "SkPDFTypes.h" | 11 #include "SkPDFTypes.h" |
12 #include "SkStream.h" | 12 #include "SkStream.h" |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 | 14 |
15 SkPDFCatalog::SkPDFCatalog(SkPDFDocument::Flags flags) | 15 SkPDFCatalog::SkPDFCatalog() |
16 : fFirstPageCount(0), | 16 : fFirstPageCount(0) |
17 fNextObjNum(1), | 17 , fNextObjNum(1) |
18 fNextFirstPageObjNum(0), | 18 , fNextFirstPageObjNum(0) {} |
19 fDocumentFlags(flags) { | |
20 } | |
21 | 19 |
22 SkPDFCatalog::~SkPDFCatalog() { | 20 SkPDFCatalog::~SkPDFCatalog() { |
23 fSubstituteResourcesRemaining.safeUnrefAll(); | 21 fSubstituteResourcesRemaining.safeUnrefAll(); |
24 fSubstituteResourcesFirstPage.safeUnrefAll(); | 22 fSubstituteResourcesFirstPage.safeUnrefAll(); |
25 } | 23 } |
26 | 24 |
27 SkPDFObject* SkPDFCatalog::addObject(SkPDFObject* obj, bool onFirstPage) { | 25 SkPDFObject* SkPDFCatalog::addObject(SkPDFObject* obj, bool onFirstPage) { |
28 if (findObjectIndex(obj) != -1) { // object already added | 26 if (findObjectIndex(obj) != -1) { // object already added |
29 return obj; | 27 return obj; |
30 } | 28 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 149 |
152 SkPDFObject* SkPDFCatalog::getSubstituteObject(SkPDFObject* object) { | 150 SkPDFObject* SkPDFCatalog::getSubstituteObject(SkPDFObject* object) { |
153 for (int i = 0; i < fSubstituteMap.count(); ++i) { | 151 for (int i = 0; i < fSubstituteMap.count(); ++i) { |
154 if (object == fSubstituteMap[i].fOriginal) { | 152 if (object == fSubstituteMap[i].fOriginal) { |
155 return fSubstituteMap[i].fSubstitute; | 153 return fSubstituteMap[i].fSubstitute; |
156 } | 154 } |
157 } | 155 } |
158 return object; | 156 return object; |
159 } | 157 } |
160 | 158 |
OLD | NEW |