OLD | NEW |
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 18 matching lines...) Expand all Loading... |
29 class SkPDFGraphicState : public SkPDFDict { | 29 class SkPDFGraphicState : public SkPDFDict { |
30 SK_DECLARE_INST_COUNT(SkPDFGraphicState) | 30 SK_DECLARE_INST_COUNT(SkPDFGraphicState) |
31 public: | 31 public: |
32 enum SkPDFSMaskMode { | 32 enum SkPDFSMaskMode { |
33 kAlpha_SMaskMode, | 33 kAlpha_SMaskMode, |
34 kLuminosity_SMaskMode | 34 kLuminosity_SMaskMode |
35 }; | 35 }; |
36 | 36 |
37 virtual ~SkPDFGraphicState(); | 37 virtual ~SkPDFGraphicState(); |
38 | 38 |
39 virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects, | |
40 SkTSet<SkPDFObject*>* newResourceObjects); | |
41 | |
42 // Override emitObject so that we can populate the dictionary on | 39 // Override emitObject so that we can populate the dictionary on |
43 // demand. | 40 // demand. |
44 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog); | 41 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog); |
45 | 42 |
46 /** 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 |
47 * 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 |
48 * unreference it when done. This is needed to accommodate the weak | 45 * unreference it when done. This is needed to accommodate the weak |
49 * 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 |
50 * other references. | 47 * other references. |
51 * @param paint The SkPaint to emulate. | 48 * @param paint The SkPaint to emulate. |
(...skipping 19 matching lines...) Expand all Loading... |
71 */ | 68 */ |
72 static SkPDFGraphicState* GetNoSMaskGraphicState(); | 69 static SkPDFGraphicState* GetNoSMaskGraphicState(); |
73 | 70 |
74 bool equals(const SkPaint&) const; | 71 bool equals(const SkPaint&) const; |
75 | 72 |
76 // Only public for SK_DECLARE_STATIC_LAZY_PTR | 73 // Only public for SK_DECLARE_STATIC_LAZY_PTR |
77 static SkPDFGraphicState* CreateNoSMaskGraphicState(); | 74 static SkPDFGraphicState* CreateNoSMaskGraphicState(); |
78 | 75 |
79 private: | 76 private: |
80 const SkPaint fPaint; | 77 const SkPaint fPaint; |
81 SkTDArray<SkPDFObject*> fResources; | |
82 bool fPopulated; | 78 bool fPopulated; |
83 bool fSMask; | 79 bool fSMask; |
84 | 80 |
85 SkPDFGraphicState(); | 81 SkPDFGraphicState(); |
86 explicit SkPDFGraphicState(const SkPaint& paint); | 82 explicit SkPDFGraphicState(const SkPaint& paint); |
87 | 83 |
88 void populateDict(); | 84 void populateDict(); |
89 | 85 |
90 static SkPDFObject* GetInvertFunction(); | |
91 | |
92 typedef SkPDFDict INHERITED; | 86 typedef SkPDFDict INHERITED; |
93 }; | 87 }; |
94 | 88 |
95 #endif | 89 #endif |
OLD | NEW |