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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 enum Mode { | 158 enum Mode { |
159 // Decode the entire image as one region. | 159 // Decode the entire image as one region. |
160 kFullImage_Mode, | 160 kFullImage_Mode, |
161 // Splits the image into multiple regions using a divisor and decodes th
e regions | 161 // Splits the image into multiple regions using a divisor and decodes th
e regions |
162 // separately. Also, this test adds a border of a few pixels to each of
the regions | 162 // separately. Also, this test adds a border of a few pixels to each of
the regions |
163 // that it is decoding. This tests the behavior when a client asks for
a region that | 163 // that it is decoding. This tests the behavior when a client asks for
a region that |
164 // does not fully fit in the image. | 164 // does not fully fit in the image. |
165 kDivisor_Mode, | 165 kDivisor_Mode, |
166 }; | 166 }; |
167 | 167 |
168 BRDSrc(Path, SkBitmapRegionDecoder::Strategy, Mode, CodecSrc::DstColorType,
uint32_t); | 168 BRDSrc(Path, Mode, CodecSrc::DstColorType, uint32_t); |
169 | 169 |
170 Error draw(SkCanvas*) const override; | 170 Error draw(SkCanvas*) const override; |
171 SkISize size() const override; | 171 SkISize size() const override; |
172 Name name() const override; | 172 Name name() const override; |
173 bool veto(SinkFlags) const override; | 173 bool veto(SinkFlags) const override; |
174 private: | 174 private: |
175 Path fPath; | 175 Path fPath; |
176 SkBitmapRegionDecoder::Strategy fStrategy; | |
177 Mode fMode; | 176 Mode fMode; |
178 CodecSrc::DstColorType fDstColorType; | 177 CodecSrc::DstColorType fDstColorType; |
179 uint32_t fSampleSize; | 178 uint32_t fSampleSize; |
180 }; | 179 }; |
181 | 180 |
182 class ImageGenSrc : public Src { | 181 class ImageGenSrc : public Src { |
183 public: | 182 public: |
184 enum Mode { | 183 enum Mode { |
185 kCodec_Mode, // Use CodecImageGenerator | 184 kCodec_Mode, // Use CodecImageGenerator |
186 kPlatform_Mode, // Uses CG or WIC | 185 kPlatform_Mode, // Uses CG or WIC |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 383 |
385 class ViaMojo : public Via { | 384 class ViaMojo : public Via { |
386 public: | 385 public: |
387 explicit ViaMojo(Sink* sink) : Via(sink) {} | 386 explicit ViaMojo(Sink* sink) : Via(sink) {} |
388 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 387 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
389 }; | 388 }; |
390 | 389 |
391 } // namespace DM | 390 } // namespace DM |
392 | 391 |
393 #endif//DMSrcSink_DEFINED | 392 #endif//DMSrcSink_DEFINED |
OLD | NEW |