| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, SkAlphaType, 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 bool serial() const override { return fRunSerially; } |
| 127 private: | 128 private: |
| 128 Path fPath; | 129 Path fPath; |
| 129 Mode fMode; | 130 Mode fMode; |
| 130 DstColorType fDstColorType; | 131 DstColorType fDstColorType; |
| 131 SkAlphaType fDstAlphaType; | 132 SkAlphaType fDstAlphaType; |
| 132 float fScale; | 133 float fScale; |
| 134 bool fRunSerially; |
| 133 }; | 135 }; |
| 134 | 136 |
| 135 class AndroidCodecSrc : public Src { | 137 class AndroidCodecSrc : public Src { |
| 136 public: | 138 public: |
| 137 enum Mode { | 139 enum Mode { |
| 138 kFullImage_Mode, | 140 kFullImage_Mode, |
| 139 // Splits the image into multiple subsets using a divisor and decodes th
e subsets | 141 // Splits the image into multiple subsets using a divisor and decodes th
e subsets |
| 140 // separately. | 142 // separately. |
| 141 kDivisor_Mode, | 143 kDivisor_Mode, |
| 142 }; | 144 }; |
| 143 | 145 |
| 144 AndroidCodecSrc(Path, Mode, CodecSrc::DstColorType, SkAlphaType, int sampleS
ize); | 146 AndroidCodecSrc(Path, Mode, CodecSrc::DstColorType, SkAlphaType, int sampleS
ize); |
| 145 | 147 |
| 146 Error draw(SkCanvas*) const override; | 148 Error draw(SkCanvas*) const override; |
| 147 SkISize size() const override; | 149 SkISize size() const override; |
| 148 Name name() const override; | 150 Name name() const override; |
| 149 bool veto(SinkFlags) const override; | 151 bool veto(SinkFlags) const override; |
| 152 bool serial() const override { return fRunSerially; } |
| 150 private: | 153 private: |
| 151 Path fPath; | 154 Path fPath; |
| 152 Mode fMode; | 155 Mode fMode; |
| 153 CodecSrc::DstColorType fDstColorType; | 156 CodecSrc::DstColorType fDstColorType; |
| 154 SkAlphaType fDstAlphaType; | 157 SkAlphaType fDstAlphaType; |
| 155 int fSampleSize; | 158 int fSampleSize; |
| 159 bool fRunSerially; |
| 156 }; | 160 }; |
| 157 | 161 |
| 158 // Allows for testing of various implementations of Android's BitmapRegionDecode
r | 162 // Allows for testing of various implementations of Android's BitmapRegionDecode
r |
| 159 class BRDSrc : public Src { | 163 class BRDSrc : public Src { |
| 160 public: | 164 public: |
| 161 enum Mode { | 165 enum Mode { |
| 162 // Decode the entire image as one region. | 166 // Decode the entire image as one region. |
| 163 kFullImage_Mode, | 167 kFullImage_Mode, |
| 164 // Splits the image into multiple regions using a divisor and decodes th
e regions | 168 // Splits the image into multiple regions using a divisor and decodes th
e regions |
| 165 // separately. Also, this test adds a border of a few pixels to each of
the regions | 169 // separately. Also, this test adds a border of a few pixels to each of
the regions |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 357 |
| 354 class ViaMojo : public Via { | 358 class ViaMojo : public Via { |
| 355 public: | 359 public: |
| 356 explicit ViaMojo(Sink* sink) : Via(sink) {} | 360 explicit ViaMojo(Sink* sink) : Via(sink) {} |
| 357 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 361 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
| 358 }; | 362 }; |
| 359 | 363 |
| 360 } // namespace DM | 364 } // namespace DM |
| 361 | 365 |
| 362 #endif//DMSrcSink_DEFINED | 366 #endif//DMSrcSink_DEFINED |
| OLD | NEW |