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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const SkMatrix& matrix, | 49 const SkMatrix& matrix, |
50 const SkIRect& surfaceBBox, | 50 const SkIRect& surfaceBBox, |
51 SkScalar rasterScale); | 51 SkScalar rasterScale); |
52 | 52 |
53 static sk_sp<SkPDFArray> MakeRangeObject(); | 53 static sk_sp<SkPDFArray> MakeRangeObject(); |
54 }; | 54 }; |
55 | 55 |
56 class SkPDFFunctionShader final : public SkPDFDict { | 56 class SkPDFFunctionShader final : public SkPDFDict { |
57 public: | 57 public: |
58 static SkPDFFunctionShader* Create(SkPDFCanon*, | 58 static SkPDFFunctionShader* Create(SkPDFCanon*, |
59 SkAutoTDelete<SkPDFShader::State>*); | 59 std::unique_ptr<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 std::unique_ptr<const SkPDFShader::State> fShaderState; |
65 SkPDFFunctionShader(SkPDFShader::State*); | 65 SkPDFFunctionShader(SkPDFShader::State*); |
66 typedef SkPDFDict INHERITED; | 66 typedef SkPDFDict INHERITED; |
67 }; | 67 }; |
68 | 68 |
69 /** | 69 /** |
70 * A shader for PDF gradients. This encapsulates the function shader | 70 * A shader for PDF gradients. This encapsulates the function shader |
71 * inside a tiling pattern while providing a common pattern interface. | 71 * inside a tiling pattern while providing a common pattern interface. |
72 * The encapsulation allows the use of a SMask for transparency gradients. | 72 * The encapsulation allows the use of a SMask for transparency gradients. |
73 */ | 73 */ |
74 class SkPDFAlphaFunctionShader final : public SkPDFStream { | 74 class SkPDFAlphaFunctionShader final : public SkPDFStream { |
75 public: | 75 public: |
76 static SkPDFAlphaFunctionShader* Create(SkPDFDocument*, | 76 static SkPDFAlphaFunctionShader* Create(SkPDFDocument*, |
77 SkScalar dpi, | 77 SkScalar dpi, |
78 SkAutoTDelete<SkPDFShader::State>*); | 78 std::unique_ptr<SkPDFShader::State>*
); |
79 virtual ~SkPDFAlphaFunctionShader(); | 79 virtual ~SkPDFAlphaFunctionShader(); |
80 bool equals(const SkPDFShader::State&) const; | 80 bool equals(const SkPDFShader::State&) const; |
81 | 81 |
82 private: | 82 private: |
83 SkAutoTDelete<const SkPDFShader::State> fShaderState; | 83 std::unique_ptr<const SkPDFShader::State> fShaderState; |
84 SkPDFAlphaFunctionShader(SkPDFShader::State*); | 84 SkPDFAlphaFunctionShader(SkPDFShader::State*); |
85 typedef SkPDFStream INHERITED; | 85 typedef SkPDFStream INHERITED; |
86 }; | 86 }; |
87 | 87 |
88 class SkPDFImageShader final : public SkPDFStream { | 88 class SkPDFImageShader final : public SkPDFStream { |
89 public: | 89 public: |
90 static SkPDFImageShader* Create(SkPDFDocument*, | 90 static SkPDFImageShader* Create(SkPDFDocument*, |
91 SkScalar dpi, | 91 SkScalar dpi, |
92 SkAutoTDelete<SkPDFShader::State>*); | 92 std::unique_ptr<SkPDFShader::State>*); |
93 virtual ~SkPDFImageShader(); | 93 virtual ~SkPDFImageShader(); |
94 bool equals(const SkPDFShader::State&) const; | 94 bool equals(const SkPDFShader::State&) const; |
95 | 95 |
96 private: | 96 private: |
97 SkAutoTDelete<const SkPDFShader::State> fShaderState; | 97 std::unique_ptr<const SkPDFShader::State> fShaderState; |
98 SkPDFImageShader(SkPDFShader::State*); | 98 SkPDFImageShader(SkPDFShader::State*); |
99 typedef SkPDFStream INHERITED; | 99 typedef SkPDFStream INHERITED; |
100 }; | 100 }; |
101 | 101 |
102 #endif | 102 #endif |
OLD | NEW |