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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 enum Mode { | 105 enum Mode { |
106 kCodec_Mode, | 106 kCodec_Mode, |
107 // We choose to test only one mode with zero initialized memory. | 107 // We choose to test only one mode with zero initialized memory. |
108 // This will exercise all of the interesting cases in SkSwizzler | 108 // This will exercise all of the interesting cases in SkSwizzler |
109 // without doubling the size of our test suite. | 109 // without doubling the size of our test suite. |
110 kCodecZeroInit_Mode, | 110 kCodecZeroInit_Mode, |
111 kScanline_Mode, | 111 kScanline_Mode, |
112 kStripe_Mode, // Tests the skipping of scanlines | 112 kStripe_Mode, // Tests the skipping of scanlines |
113 kCroppedScanline_Mode, // Tests (jpeg) cropped scanline optimization | 113 kCroppedScanline_Mode, // Tests (jpeg) cropped scanline optimization |
114 kSubset_Mode, // For codecs that support subsets directly. | 114 kSubset_Mode, // For codecs that support subsets directly. |
115 kGen_Mode, // Test SkCodecImageGenerator (includes YUV) | |
116 }; | 115 }; |
117 enum DstColorType { | 116 enum DstColorType { |
118 kGetFromCanvas_DstColorType, | 117 kGetFromCanvas_DstColorType, |
119 kIndex8_Always_DstColorType, | 118 kIndex8_Always_DstColorType, |
120 kGrayscale_Always_DstColorType, | 119 kGrayscale_Always_DstColorType, |
121 }; | 120 }; |
122 CodecSrc(Path, Mode, DstColorType, SkAlphaType, float); | 121 CodecSrc(Path, Mode, DstColorType, SkAlphaType, float); |
123 | 122 |
124 Error draw(SkCanvas*) const override; | 123 Error draw(SkCanvas*) const override; |
125 SkISize size() const override; | 124 SkISize size() const override; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 Name name() const override; | 179 Name name() const override; |
181 bool veto(SinkFlags) const override; | 180 bool veto(SinkFlags) const override; |
182 private: | 181 private: |
183 Path fPath; | 182 Path fPath; |
184 SkBitmapRegionDecoder::Strategy fStrategy; | 183 SkBitmapRegionDecoder::Strategy fStrategy; |
185 Mode fMode; | 184 Mode fMode; |
186 CodecSrc::DstColorType fDstColorType; | 185 CodecSrc::DstColorType fDstColorType; |
187 uint32_t fSampleSize; | 186 uint32_t fSampleSize; |
188 }; | 187 }; |
189 | 188 |
189 class ImageGenSrc : public Src { | |
190 public: | |
191 enum Mode { | |
192 kCodec_Mode, // Use CodecImageGenerator | |
193 kCG_Mode, // Use CG | |
scroggo
2016/03/07 13:04:30
Should this instead be something like kPlatform mo
msarett
2016/03/08 23:20:17
kPlatform SGTM. Good idea! No reason to have sep
| |
194 }; | |
195 ImageGenSrc(Path, Mode, SkAlphaType, bool); | |
196 | |
197 Error draw(SkCanvas*) const override; | |
198 SkISize size() const override; | |
199 Name name() const override; | |
200 bool veto(SinkFlags) const override; | |
201 bool serial() const override { return fRunSerially; } | |
202 private: | |
203 Path fPath; | |
204 Mode fMode; | |
205 SkAlphaType fDstAlphaType; | |
206 bool fIsGpu; | |
207 bool fRunSerially; | |
208 }; | |
209 | |
190 class SKPSrc : public Src { | 210 class SKPSrc : public Src { |
191 public: | 211 public: |
192 explicit SKPSrc(Path path); | 212 explicit SKPSrc(Path path); |
193 | 213 |
194 Error draw(SkCanvas*) const override; | 214 Error draw(SkCanvas*) const override; |
195 SkISize size() const override; | 215 SkISize size() const override; |
196 Name name() const override; | 216 Name name() const override; |
197 private: | 217 private: |
198 Path fPath; | 218 Path fPath; |
199 }; | 219 }; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 | 378 |
359 class ViaMojo : public Via { | 379 class ViaMojo : public Via { |
360 public: | 380 public: |
361 explicit ViaMojo(Sink* sink) : Via(sink) {} | 381 explicit ViaMojo(Sink* sink) : Via(sink) {} |
362 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 382 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
363 }; | 383 }; |
364 | 384 |
365 } // namespace DM | 385 } // namespace DM |
366 | 386 |
367 #endif//DMSrcSink_DEFINED | 387 #endif//DMSrcSink_DEFINED |
OLD | NEW |