OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef DMSrcSink_DEFINED | 8 #ifndef DMSrcSink_DEFINED |
9 #define DMSrcSink_DEFINED | 9 #define DMSrcSink_DEFINED |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 kScanline_Mode, | 111 kScanline_Mode, |
112 kStripe_Mode, // Tests the skipping of scanlines | 112 kStripe_Mode, // Tests the skipping of scanlines |
113 kSubset_Mode, // For codecs that support subsets directly. | 113 kSubset_Mode, // For codecs that support subsets directly. |
114 kGen_Mode, // Test SkCodecImageGenerator (includes YUV) | 114 kGen_Mode, // Test SkCodecImageGenerator (includes YUV) |
115 }; | 115 }; |
116 enum DstColorType { | 116 enum DstColorType { |
117 kGetFromCanvas_DstColorType, | 117 kGetFromCanvas_DstColorType, |
118 kIndex8_Always_DstColorType, | 118 kIndex8_Always_DstColorType, |
119 kGrayscale_Always_DstColorType, | 119 kGrayscale_Always_DstColorType, |
120 }; | 120 }; |
121 CodecSrc(Path, Mode, DstColorType, float); | 121 CodecSrc(Path, Mode, DstColorType, SkAlphaType, float); |
122 | 122 |
123 Error draw(SkCanvas*) const override; | 123 Error draw(SkCanvas*) const override; |
124 SkISize size() const override; | 124 SkISize size() const override; |
125 Name name() const override; | 125 Name name() const override; |
126 bool veto(SinkFlags) const override; | 126 bool veto(SinkFlags) const override; |
127 private: | 127 private: |
128 Path fPath; | 128 Path fPath; |
129 Mode fMode; | 129 Mode fMode; |
130 DstColorType fDstColorType; | 130 DstColorType fDstColorType; |
| 131 SkAlphaType fDstAlphaType; |
131 float fScale; | 132 float fScale; |
132 }; | 133 }; |
133 | 134 |
134 class AndroidCodecSrc : public Src { | 135 class AndroidCodecSrc : public Src { |
135 public: | 136 public: |
136 enum Mode { | 137 enum Mode { |
137 kFullImage_Mode, | 138 kFullImage_Mode, |
138 // Splits the image into multiple subsets using a divisor and decodes th
e subsets | 139 // Splits the image into multiple subsets using a divisor and decodes th
e subsets |
139 // separately. | 140 // separately. |
140 kDivisor_Mode, | 141 kDivisor_Mode, |
141 }; | 142 }; |
142 | 143 |
143 AndroidCodecSrc(Path, Mode, CodecSrc::DstColorType, int sampleSize); | 144 AndroidCodecSrc(Path, Mode, CodecSrc::DstColorType, SkAlphaType, int sampleS
ize); |
144 | 145 |
145 Error draw(SkCanvas*) const override; | 146 Error draw(SkCanvas*) const override; |
146 SkISize size() const override; | 147 SkISize size() const override; |
147 Name name() const override; | 148 Name name() const override; |
148 bool veto(SinkFlags) const override; | 149 bool veto(SinkFlags) const override; |
149 private: | 150 private: |
150 Path fPath; | 151 Path fPath; |
151 Mode fMode; | 152 Mode fMode; |
152 CodecSrc::DstColorType fDstColorType; | 153 CodecSrc::DstColorType fDstColorType; |
| 154 SkAlphaType fDstAlphaType; |
153 int fSampleSize; | 155 int fSampleSize; |
154 }; | 156 }; |
155 | 157 |
156 // Allows for testing of various implementations of Android's BitmapRegionDecode
r | 158 // Allows for testing of various implementations of Android's BitmapRegionDecode
r |
157 class BRDSrc : public Src { | 159 class BRDSrc : public Src { |
158 public: | 160 public: |
159 enum Mode { | 161 enum Mode { |
160 // Decode the entire image as one region. | 162 // Decode the entire image as one region. |
161 kFullImage_Mode, | 163 kFullImage_Mode, |
162 // Splits the image into multiple regions using a divisor and decodes th
e regions | 164 // Splits the image into multiple regions using a divisor and decodes th
e regions |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 353 |
352 class ViaTwice : public Via { | 354 class ViaTwice : public Via { |
353 public: | 355 public: |
354 explicit ViaTwice(Sink* sink) : Via(sink) {} | 356 explicit ViaTwice(Sink* sink) : Via(sink) {} |
355 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 357 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
356 }; | 358 }; |
357 | 359 |
358 } // namespace DM | 360 } // namespace DM |
359 | 361 |
360 #endif//DMSrcSink_DEFINED | 362 #endif//DMSrcSink_DEFINED |
OLD | NEW |