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

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

Issue 942153002: PDF: remove unnecessary mutexes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 23 matching lines...) Expand all
34 } 34 }
35 this->mergeFrom(pdfStream); 35 this->mergeFrom(pdfStream);
36 if (removeLength) { 36 if (removeLength) {
37 this->remove("Length"); 37 this->remove("Length");
38 } 38 }
39 } 39 }
40 40
41 SkPDFStream::~SkPDFStream() {} 41 SkPDFStream::~SkPDFStream() {}
42 42
43 void SkPDFStream::emitObject(SkWStream* stream, SkPDFCatalog* catalog) { 43 void SkPDFStream::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
44 SkAutoMutexAcquire lock(fMutex); // multiple threads could be calling emit
45 if (!this->populate(catalog)) { 44 if (!this->populate(catalog)) {
46 return fSubstitute->emitObject(stream, catalog); 45 return fSubstitute->emitObject(stream, catalog);
47 } 46 }
48 47
49 this->INHERITED::emitObject(stream, catalog); 48 this->INHERITED::emitObject(stream, catalog);
50 stream->writeText(" stream\n"); 49 stream->writeText(" stream\n");
51 stream->writeStream(fDataStream.get(), fDataStream->getLength()); 50 stream->writeStream(fDataStream.get(), fDataStream->getLength());
52 SkAssertResult(fDataStream->rewind()); 51 SkAssertResult(fDataStream->rewind());
53 stream->writeText("\nendstream"); 52 stream->writeText("\nendstream");
54 } 53 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 else if (fState == kNoCompression_State) { 105 else if (fState == kNoCompression_State) {
107 if (!fSubstitute.get()) { 106 if (!fSubstitute.get()) {
108 fSubstitute.reset(new SkPDFStream(*this)); 107 fSubstitute.reset(new SkPDFStream(*this));
109 catalog->setSubstitute(this, fSubstitute.get()); 108 catalog->setSubstitute(this, fSubstitute.get());
110 } 109 }
111 return false; 110 return false;
112 } 111 }
113 return true; 112 return true;
114 #endif // SK_NO_FLATE 113 #endif // SK_NO_FLATE
115 } 114 }
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