Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: src/pdf/SkPDFStream.cpp

Issue 827733004: Change function signature of SkPDFObject::emitObject. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFStream.h ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
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 27 matching lines...) Expand all
38 removeLength = false; 38 removeLength = false;
39 } 39 }
40 this->mergeFrom(pdfStream); 40 this->mergeFrom(pdfStream);
41 if (removeLength) { 41 if (removeLength) {
42 this->remove("Length"); 42 this->remove("Length");
43 } 43 }
44 } 44 }
45 45
46 SkPDFStream::~SkPDFStream() {} 46 SkPDFStream::~SkPDFStream() {}
47 47
48 void SkPDFStream::emitObject(SkWStream* stream, SkPDFCatalog* catalog, 48 void SkPDFStream::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
49 bool indirect) {
50 if (indirect) {
51 return emitIndirectObject(stream, catalog);
52 }
53 SkAutoMutexAcquire lock(fMutex); // multiple threads could be calling emit 49 SkAutoMutexAcquire lock(fMutex); // multiple threads could be calling emit
54 if (!this->populate(catalog)) { 50 if (!this->populate(catalog)) {
55 return fSubstitute->emitObject(stream, catalog, indirect); 51 return fSubstitute->emitObject(stream, catalog);
56 } 52 }
57 53
58 this->INHERITED::emitObject(stream, catalog, false); 54 this->INHERITED::emitObject(stream, catalog);
59 stream->writeText(" stream\n"); 55 stream->writeText(" stream\n");
60 stream->writeStream(fDataStream.get(), fDataStream->getLength()); 56 stream->writeStream(fDataStream.get(), fDataStream->getLength());
61 SkAssertResult(fDataStream->rewind()); 57 SkAssertResult(fDataStream->rewind());
62 stream->writeText("\nendstream"); 58 stream->writeText("\nendstream");
63 } 59 }
64 60
65 size_t SkPDFStream::getOutputSize(SkPDFCatalog* catalog, bool indirect) { 61 size_t SkPDFStream::getOutputSize(SkPDFCatalog* catalog, bool indirect) {
66 if (indirect) { 62 if (indirect) {
67 return getIndirectOutputSize(catalog); 63 return getIndirectOutputSize(catalog);
68 } 64 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } else if (fState == kNoCompression_State && !skip_compression(catalog) && 123 } else if (fState == kNoCompression_State && !skip_compression(catalog) &&
128 SkFlate::HaveFlate()) { 124 SkFlate::HaveFlate()) {
129 if (!fSubstitute.get()) { 125 if (!fSubstitute.get()) {
130 fSubstitute.reset(new SkPDFStream(*this)); 126 fSubstitute.reset(new SkPDFStream(*this));
131 catalog->setSubstitute(this, fSubstitute.get()); 127 catalog->setSubstitute(this, fSubstitute.get());
132 } 128 }
133 return false; 129 return false;
134 } 130 }
135 return true; 131 return true;
136 } 132 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFStream.h ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698