| 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 "SkData.h" | 10 #include "SkData.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 off_t SkPDFPage::getPageSize(SkPDFCatalog* catalog, off_t fileOffset) { | 49 off_t SkPDFPage::getPageSize(SkPDFCatalog* catalog, off_t fileOffset) { |
| 50 SkASSERT(fContentStream.get() != NULL); | 50 SkASSERT(fContentStream.get() != NULL); |
| 51 catalog->setFileOffset(fContentStream.get(), fileOffset); | 51 catalog->setFileOffset(fContentStream.get(), fileOffset); |
| 52 return SkToOffT(fContentStream->getOutputSize(catalog, true)); | 52 return SkToOffT(fContentStream->getOutputSize(catalog, true)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void SkPDFPage::emitPage(SkWStream* stream, SkPDFCatalog* catalog) { | 55 void SkPDFPage::emitPage(SkWStream* stream, SkPDFCatalog* catalog) { |
| 56 SkASSERT(fContentStream.get() != NULL); | 56 SkASSERT(fContentStream.get() != NULL); |
| 57 fContentStream->emitObject(stream, catalog, true); | 57 fContentStream->emitIndirectObject(stream, catalog); |
| 58 } | 58 } |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages, | 61 void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages, |
| 62 SkPDFCatalog* catalog, | 62 SkPDFCatalog* catalog, |
| 63 SkTDArray<SkPDFDict*>* pageTree, | 63 SkTDArray<SkPDFDict*>* pageTree, |
| 64 SkPDFDict** rootNode) { | 64 SkPDFDict** rootNode) { |
| 65 // PDF wants a tree describing all the pages in the document. We arbitrary | 65 // PDF wants a tree describing all the pages in the document. We arbitrary |
| 66 // choose 8 (kNodeSize) as the number of allowed children. The internal | 66 // choose 8 (kNodeSize) as the number of allowed children. The internal |
| 67 // nodes have type "Pages" with an array of children, a parent pointer, and | 67 // nodes have type "Pages" with an array of children, a parent pointer, and |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 return fDevice->getFontResources(); | 149 return fDevice->getFontResources(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 const SkPDFGlyphSetMap& SkPDFPage::getFontGlyphUsage() const { | 152 const SkPDFGlyphSetMap& SkPDFPage::getFontGlyphUsage() const { |
| 153 return fDevice->getFontGlyphUsage(); | 153 return fDevice->getFontGlyphUsage(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void SkPDFPage::appendDestinations(SkPDFDict* dict) { | 156 void SkPDFPage::appendDestinations(SkPDFDict* dict) { |
| 157 fDevice->appendDestinations(dict, this); | 157 fDevice->appendDestinations(dict, this); |
| 158 } | 158 } |
| OLD | NEW |