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

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

Issue 944643002: PDF: Now threadsafe! (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO=DONE 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/SkPDFFontImpl.h ('k') | src/pdf/SkPDFGraphicState.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 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 #ifndef SkPDFGraphicState_DEFINED 10 #ifndef SkPDFGraphicState_DEFINED
(...skipping 29 matching lines...) Expand all
40 // demand. 40 // demand.
41 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog); 41 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog);
42 42
43 /** Get the graphic state for the passed SkPaint. The reference count of 43 /** Get the graphic state for the passed SkPaint. The reference count of
44 * the object is incremented and it is the caller's responsibility to 44 * the object is incremented and it is the caller's responsibility to
45 * unreference it when done. This is needed to accommodate the weak 45 * unreference it when done. This is needed to accommodate the weak
46 * reference pattern used when the returned object is new and has no 46 * reference pattern used when the returned object is new and has no
47 * other references. 47 * other references.
48 * @param paint The SkPaint to emulate. 48 * @param paint The SkPaint to emulate.
49 */ 49 */
50 static SkPDFGraphicState* GetGraphicStateForPaint(const SkPaint& paint); 50 static SkPDFGraphicState* GetGraphicStateForPaint(SkPDFCanon* canon,
51 const SkPaint& paint);
51 52
52 /** Make a graphic state that only sets the passed soft mask. The 53 /** Make a graphic state that only sets the passed soft mask. The
53 * reference count of the object is incremented and it is the caller's 54 * reference count of the object is incremented and it is the caller's
54 * responsibility to unreference it when done. 55 * responsibility to unreference it when done.
55 * @param sMask The form xobject to use as a soft mask. 56 * @param sMask The form xobject to use as a soft mask.
56 * @param invert Indicates if the alpha of the sMask should be inverted. 57 * @param invert Indicates if the alpha of the sMask should be inverted.
57 * @param sMaskMode Whether to use alpha or luminosity for the sMask. 58 * @param sMaskMode Whether to use alpha or luminosity for the sMask.
58 */ 59 */
59 static SkPDFGraphicState* GetSMaskGraphicState(SkPDFFormXObject* sMask, 60 static SkPDFGraphicState* GetSMaskGraphicState(SkPDFFormXObject* sMask,
60 bool invert, 61 bool invert,
61 SkPDFSMaskMode sMaskMode); 62 SkPDFSMaskMode sMaskMode);
62 63
63 /** Get a graphic state that only unsets the soft mask. The reference 64 /** Get a graphic state that only unsets the soft mask. The reference
64 * count of the object is incremented and it is the caller's responsibility 65 * count of the object is incremented and it is the caller's responsibility
65 * to unreference it when done. This is needed to accommodate the weak 66 * to unreference it when done. This is needed to accommodate the weak
66 * reference pattern used when the returned object is new and has no 67 * reference pattern used when the returned object is new and has no
67 * other references. 68 * other references.
68 */ 69 */
69 static SkPDFGraphicState* GetNoSMaskGraphicState(); 70 static SkPDFGraphicState* GetNoSMaskGraphicState();
70 71
71 bool equals(const SkPaint&) const; 72 bool equals(const SkPaint&) const;
72 73
73 // Only public for SK_DECLARE_STATIC_LAZY_PTR 74 // Only public for SK_DECLARE_STATIC_LAZY_PTR
74 static SkPDFGraphicState* CreateNoSMaskGraphicState(); 75 static SkPDFGraphicState* CreateNoSMaskGraphicState();
75 76
76 private: 77 private:
78 SkPDFCanon* const fCanon;
77 const SkPaint fPaint; 79 const SkPaint fPaint;
78 bool fPopulated; 80 bool fPopulated;
79 bool fSMask;
80 81
81 SkPDFGraphicState(); 82 SkPDFGraphicState();
82 explicit SkPDFGraphicState(const SkPaint& paint); 83 SkPDFGraphicState(SkPDFCanon* canon, const SkPaint& paint);
83 84
84 void populateDict(); 85 void populateDict();
85 86
86 typedef SkPDFDict INHERITED; 87 typedef SkPDFDict INHERITED;
87 }; 88 };
88 89
89 #endif 90 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFontImpl.h ('k') | src/pdf/SkPDFGraphicState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698