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

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

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/SkPDFShader.cpp ('k') | src/pdf/SkPDFStream.cpp » ('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 #ifndef SkPDFStream_DEFINED 10 #ifndef SkPDFStream_DEFINED
(...skipping 21 matching lines...) Expand all
32 explicit SkPDFStream(SkData* data); 32 explicit SkPDFStream(SkData* data);
33 33
34 /** Create a PDF stream. A Length entry is automatically added to the 34 /** Create a PDF stream. A Length entry is automatically added to the
35 * stream dictionary. 35 * stream dictionary.
36 * @param stream The data part of the stream. Will be duplicate()d. 36 * @param stream The data part of the stream. Will be duplicate()d.
37 */ 37 */
38 explicit SkPDFStream(SkStream* stream); 38 explicit SkPDFStream(SkStream* stream);
39 39
40 virtual ~SkPDFStream(); 40 virtual ~SkPDFStream();
41 41
42 // The SkPDFObject interface. This two method uses a mutex to 42 // The SkPDFObject interface.
43 // allow multiple threads to call at the same time.
44 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog) SK_OVERRID E; 43 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog) SK_OVERRID E;
45 44
46 protected: 45 protected:
47 enum State { 46 enum State {
48 kUnused_State, //!< The stream hasn't been requested yet. 47 kUnused_State, //!< The stream hasn't been requested yet.
49 kNoCompression_State, //!< The stream's been requested in an 48 kNoCompression_State, //!< The stream's been requested in an
50 // uncompressed form. 49 // uncompressed form.
51 kCompressed_State, //!< The stream's already been compressed. 50 kCompressed_State, //!< The stream's already been compressed.
52 }; 51 };
53 52
(...skipping 29 matching lines...) Expand all
83 } 82 }
84 83
85 State getState() const { 84 State getState() const {
86 return fState; 85 return fState;
87 } 86 }
88 87
89 private: 88 private:
90 // Indicates what form (or if) the stream has been requested. 89 // Indicates what form (or if) the stream has been requested.
91 State fState; 90 State fState;
92 91
93 // Mutex guards fState, fDataStream, and fSubstitute in public interface.
94 SkMutex fMutex;
95
96 SkAutoTDelete<SkStreamRewindable> fDataStream; 92 SkAutoTDelete<SkStreamRewindable> fDataStream;
97 SkAutoTUnref<SkPDFStream> fSubstitute; 93 SkAutoTUnref<SkPDFStream> fSubstitute;
98 94
99 typedef SkPDFDict INHERITED; 95 typedef SkPDFDict INHERITED;
100 }; 96 };
101 97
102 #endif 98 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/pdf/SkPDFStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698