void SkPDFInt::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) { return emitIndirectObject(stream, catalog); } stream->writeDecAsText(fValue); }
void SkPDFImage::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) return emitIndirectObject(stream, catalog); fStream->emitObject(stream, catalog, indirect); }
void SkPDFScalar::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) { return emitIndirectObject(stream, catalog); } Append(fValue, stream); }
void SkPDFDict::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) { return emitIndirectObject(stream, catalog); } stream->writeText("<<"); for (int i = 0; i < fValue.count(); i++) { fValue[i].key->emitObject(stream, catalog, false); stream->writeText(" "); fValue[i].value->emit(stream, catalog, false); stream->writeText("\n"); } stream->writeText(">>"); }
void SkPDFArray::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) { return emitIndirectObject(stream, catalog); } stream->writeText("["); for (int i = 0; i < fValue.count(); i++) { fValue[i]->emit(stream, catalog, false); if (i + 1 < fValue.count()) { stream->writeText(" "); } } stream->writeText("]"); }
void SkPDFStream::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) return emitIndirectObject(stream, catalog); this->INHERITED::emitObject(stream, catalog, false); stream->writeText(" stream\n"); if (fPlainData.get()) { stream->write(fPlainData->getMemoryBase(), fLength); } else { SkAutoDataUnref data(fCompressedData.copyToData()); stream->write(data.data(), fLength); } stream->writeText("\nendstream"); }
void SkPDFDict::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) { return emitIndirectObject(stream, catalog); } SkAutoMutexAcquire lock(fMutex); // If another thread triggers a // resize while this thread is in // the for-loop, we can be left // with a bad fValue[i] reference. stream->writeText("<<"); for (int i = 0; i < fValue.count(); i++) { SkASSERT(fValue[i].key); SkASSERT(fValue[i].value); fValue[i].key->emitObject(stream, catalog, false); stream->writeText(" "); fValue[i].value->emit(stream, catalog, false); stream->writeText("\n"); } stream->writeText(">>"); }
void SkPDFString::emitObject(SkWStream* stream, SkPDFCatalog* catalog, bool indirect) { if (indirect) return emitIndirectObject(stream, catalog); stream->write(fValue.c_str(), fValue.size()); }