OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 SkPDFShader_DEFINED | 10 #ifndef SkPDFShader_DEFINED |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 SK_DECLARE_INST_COUNT(SkPDFFunctionShader); | 55 SK_DECLARE_INST_COUNT(SkPDFFunctionShader); |
56 | 56 |
57 public: | 57 public: |
58 static SkPDFFunctionShader* Create(SkPDFCanon*, | 58 static SkPDFFunctionShader* Create(SkPDFCanon*, |
59 SkAutoTDelete<SkPDFShader::State>*); | 59 SkAutoTDelete<SkPDFShader::State>*); |
60 virtual ~SkPDFFunctionShader(); | 60 virtual ~SkPDFFunctionShader(); |
61 bool equals(const SkPDFShader::State&) const; | 61 bool equals(const SkPDFShader::State&) const; |
62 | 62 |
63 private: | 63 private: |
64 SkAutoTDelete<const SkPDFShader::State> fShaderState; | 64 SkAutoTDelete<const SkPDFShader::State> fShaderState; |
65 SkTDArray<SkPDFObject*> fResources; | |
66 SkPDFFunctionShader(SkPDFShader::State*); | 65 SkPDFFunctionShader(SkPDFShader::State*); |
67 typedef SkPDFDict INHERITED; | 66 typedef SkPDFDict INHERITED; |
68 }; | 67 }; |
69 | 68 |
70 /** | 69 /** |
71 * A shader for PDF gradients. This encapsulates the function shader | 70 * A shader for PDF gradients. This encapsulates the function shader |
72 * inside a tiling pattern while providing a common pattern interface. | 71 * inside a tiling pattern while providing a common pattern interface. |
73 * The encapsulation allows the use of a SMask for transparency gradients. | 72 * The encapsulation allows the use of a SMask for transparency gradients. |
74 */ | 73 */ |
75 class SkPDFAlphaFunctionShader : public SkPDFStream { | 74 class SkPDFAlphaFunctionShader : public SkPDFStream { |
76 public: | 75 public: |
77 static SkPDFAlphaFunctionShader* Create(SkPDFCanon*, | 76 static SkPDFAlphaFunctionShader* Create(SkPDFCanon*, |
78 SkScalar dpi, | 77 SkScalar dpi, |
79 SkAutoTDelete<SkPDFShader::State>*); | 78 SkAutoTDelete<SkPDFShader::State>*); |
80 virtual ~SkPDFAlphaFunctionShader(); | 79 virtual ~SkPDFAlphaFunctionShader(); |
81 bool equals(const SkPDFShader::State&) const; | 80 bool equals(const SkPDFShader::State&) const; |
82 | 81 |
83 private: | 82 private: |
84 SkAutoTDelete<const SkPDFShader::State> fShaderState; | 83 SkAutoTDelete<const SkPDFShader::State> fShaderState; |
85 SkAutoTUnref<SkPDFObject> fColorShader; | |
86 SkAutoTUnref<SkPDFResourceDict> fResourceDict; | |
87 SkPDFAlphaFunctionShader(SkPDFShader::State*); | 84 SkPDFAlphaFunctionShader(SkPDFShader::State*); |
| 85 typedef SkPDFStream INHERITED; |
88 }; | 86 }; |
89 | 87 |
90 class SkPDFImageShader : public SkPDFStream { | 88 class SkPDFImageShader : public SkPDFStream { |
91 public: | 89 public: |
92 static SkPDFImageShader* Create(SkPDFCanon*, | 90 static SkPDFImageShader* Create(SkPDFCanon*, |
93 SkScalar dpi, | 91 SkScalar dpi, |
94 SkAutoTDelete<SkPDFShader::State>*); | 92 SkAutoTDelete<SkPDFShader::State>*); |
95 virtual ~SkPDFImageShader(); | 93 virtual ~SkPDFImageShader(); |
96 bool equals(const SkPDFShader::State&) const; | 94 bool equals(const SkPDFShader::State&) const; |
97 | 95 |
98 private: | 96 private: |
99 SkAutoTDelete<const SkPDFShader::State> fShaderState; | 97 SkAutoTDelete<const SkPDFShader::State> fShaderState; |
100 SkTSet<SkPDFObject*> fResources; | |
101 SkPDFImageShader(SkPDFShader::State*); | 98 SkPDFImageShader(SkPDFShader::State*); |
| 99 typedef SkPDFStream INHERITED; |
102 }; | 100 }; |
103 | 101 |
104 #endif | 102 #endif |
OLD | NEW |