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 |
11 #define SkPDFGraphicState_DEFINED | 11 #define SkPDFGraphicState_DEFINED |
12 | 12 |
13 #include "SkPaint.h" | 13 #include "SkPaint.h" |
14 #include "SkPDFTypes.h" | 14 #include "SkPDFTypes.h" |
15 #include "SkTemplates.h" | 15 #include "SkTemplates.h" |
16 #include "SkThread.h" | 16 #include "SkThread.h" |
17 | 17 |
18 class SkPDFFormXObject; | 18 class SkPDFFormXObject; |
19 | 19 |
20 /** \class SkPDFGraphicState | 20 /** \class SkPDFGraphicState |
21 SkPaint objects roughly correspond to graphic state dictionaries that can | 21 SkPaint objects roughly correspond to graphic state dictionaries that can |
22 be installed. So that a given dictionary is only output to the pdf file | 22 be installed. So that a given dictionary is only output to the pdf file |
23 once, we want to canonicalize them. Static methods in this class manage | 23 once, we want to canonicalize them. Static methods in this class manage |
24 a weakly referenced set of SkPDFGraphicState objects: when the last | 24 a weakly referenced set of SkPDFGraphicState objects: when the last |
25 reference to a SkPDFGraphicState is removed, it removes itself from the | 25 reference to a SkPDFGraphicState is removed, it removes itself from the |
26 static set of objects. | 26 static set of objects. |
27 | 27 |
28 */ | 28 */ |
29 class SkPDFGraphicState : public SkPDFDict { | 29 class SkPDFGraphicState : public SkPDFDict { |
| 30 SK_DECLARE_INST_COUNT(SkPDFGraphicState) |
30 public: | 31 public: |
31 enum SkPDFSMaskMode { | 32 enum SkPDFSMaskMode { |
32 kAlpha_SMaskMode, | 33 kAlpha_SMaskMode, |
33 kLuminosity_SMaskMode | 34 kLuminosity_SMaskMode |
34 }; | 35 }; |
35 | 36 |
36 virtual ~SkPDFGraphicState(); | 37 virtual ~SkPDFGraphicState(); |
37 | 38 |
38 virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects, | 39 virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects, |
39 SkTSet<SkPDFObject*>* newResourceObjects); | 40 SkTSet<SkPDFObject*>* newResourceObjects); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 static SkBaseMutex& CanonicalPaintsMutex(); | 98 static SkBaseMutex& CanonicalPaintsMutex(); |
98 | 99 |
99 SkPDFGraphicState(); | 100 SkPDFGraphicState(); |
100 explicit SkPDFGraphicState(const SkPaint& paint); | 101 explicit SkPDFGraphicState(const SkPaint& paint); |
101 | 102 |
102 void populateDict(); | 103 void populateDict(); |
103 | 104 |
104 static SkPDFObject* GetInvertFunction(); | 105 static SkPDFObject* GetInvertFunction(); |
105 | 106 |
106 static int Find(const SkPaint& paint); | 107 static int Find(const SkPaint& paint); |
| 108 typedef SkPDFDict INHERITED; |
107 }; | 109 }; |
108 | 110 |
109 #endif | 111 #endif |
OLD | NEW |