| 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" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 return object; | 192 return object; |
| 193 } | 193 } |
| 194 | 194 |
| 195 off_t SkPDFCatalog::setSubstituteResourcesOffsets(off_t fileOffset, | 195 off_t SkPDFCatalog::setSubstituteResourcesOffsets(off_t fileOffset, |
| 196 bool firstPage) { | 196 bool firstPage) { |
| 197 SkTSet<SkPDFObject*>* targetSet = getSubstituteList(firstPage); | 197 SkTSet<SkPDFObject*>* targetSet = getSubstituteList(firstPage); |
| 198 off_t offsetSum = fileOffset; | 198 off_t offsetSum = fileOffset; |
| 199 for (int i = 0; i < targetSet->count(); ++i) { | 199 for (int i = 0; i < targetSet->count(); ++i) { |
| 200 offsetSum += setFileOffset((*targetSet)[i], offsetSum); | 200 offsetSum += SkToOffT(setFileOffset((*targetSet)[i], offsetSum)); |
| 201 } | 201 } |
| 202 return offsetSum - fileOffset; | 202 return offsetSum - fileOffset; |
| 203 } | 203 } |
| 204 | 204 |
| 205 void SkPDFCatalog::emitSubstituteResources(SkWStream *stream, bool firstPage) { | 205 void SkPDFCatalog::emitSubstituteResources(SkWStream *stream, bool firstPage) { |
| 206 SkTSet<SkPDFObject*>* targetSet = getSubstituteList(firstPage); | 206 SkTSet<SkPDFObject*>* targetSet = getSubstituteList(firstPage); |
| 207 for (int i = 0; i < targetSet->count(); ++i) { | 207 for (int i = 0; i < targetSet->count(); ++i) { |
| 208 (*targetSet)[i]->emit(stream, this, true); | 208 (*targetSet)[i]->emit(stream, this, true); |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 SkTSet<SkPDFObject*>* SkPDFCatalog::getSubstituteList(bool firstPage) { | 212 SkTSet<SkPDFObject*>* SkPDFCatalog::getSubstituteList(bool firstPage) { |
| 213 return firstPage ? &fSubstituteResourcesFirstPage : | 213 return firstPage ? &fSubstituteResourcesFirstPage : |
| 214 &fSubstituteResourcesRemaining; | 214 &fSubstituteResourcesRemaining; |
| 215 } | 215 } |
| OLD | NEW |