| 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 |
| 11 #include "DMGpuSupport.h" | 11 #include "DMGpuSupport.h" |
| 12 #include "SkBBHFactory.h" | 12 #include "SkBBHFactory.h" |
| 13 #include "SkBBoxHierarchy.h" | 13 #include "SkBBoxHierarchy.h" |
| 14 #include "SkBitmap.h" | 14 #include "SkBitmap.h" |
| 15 #include "SkBitmapRegionDecoderInterface.h" | 15 #include "SkBitmapRegionDecoder.h" |
| 16 #include "SkCanvas.h" | 16 #include "SkCanvas.h" |
| 17 #include "SkData.h" | 17 #include "SkData.h" |
| 18 #include "SkGPipe.h" | 18 #include "SkGPipe.h" |
| 19 #include "SkPicture.h" | 19 #include "SkPicture.h" |
| 20 #include "gm.h" | 20 #include "gm.h" |
| 21 | 21 |
| 22 namespace DM { | 22 namespace DM { |
| 23 | 23 |
| 24 // This is just convenience. It lets you use either return "foo" or return SkSt
ringPrintf(...). | 24 // This is just convenience. It lets you use either return "foo" or return SkSt
ringPrintf(...). |
| 25 struct ImplicitString : public SkString { | 25 struct ImplicitString : public SkString { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 enum Mode { | 156 enum Mode { |
| 157 // Decode the entire image as one region. | 157 // Decode the entire image as one region. |
| 158 kFullImage_Mode, | 158 kFullImage_Mode, |
| 159 // Splits the image into multiple regions using a divisor and decodes th
e regions | 159 // Splits the image into multiple regions using a divisor and decodes th
e regions |
| 160 // separately. Also, this test adds a border of a few pixels to each of
the regions | 160 // separately. Also, this test adds a border of a few pixels to each of
the regions |
| 161 // that it is decoding. This tests the behavior when a client asks for
a region that | 161 // that it is decoding. This tests the behavior when a client asks for
a region that |
| 162 // does not fully fit in the image. | 162 // does not fully fit in the image. |
| 163 kDivisor_Mode, | 163 kDivisor_Mode, |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 BRDSrc(Path, SkBitmapRegionDecoderInterface::Strategy, Mode, CodecSrc::DstCo
lorType, uint32_t); | 166 BRDSrc(Path, SkBitmapRegionDecoder::Strategy, Mode, CodecSrc::DstColorType,
uint32_t); |
| 167 | 167 |
| 168 Error draw(SkCanvas*) const override; | 168 Error draw(SkCanvas*) const override; |
| 169 SkISize size() const override; | 169 SkISize size() const override; |
| 170 Name name() const override; | 170 Name name() const override; |
| 171 bool veto(SinkFlags) const override; | 171 bool veto(SinkFlags) const override; |
| 172 private: | 172 private: |
| 173 Path fPath; | 173 Path fPath; |
| 174 SkBitmapRegionDecoderInterface::Strategy fStrategy; | 174 SkBitmapRegionDecoder::Strategy fStrategy; |
| 175 Mode fMode; | 175 Mode fMode; |
| 176 CodecSrc::DstColorType fDstColorType; | 176 CodecSrc::DstColorType fDstColorType; |
| 177 uint32_t fSampleSize; | 177 uint32_t fSampleSize; |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 class ImageSrc : public Src { | 180 class ImageSrc : public Src { |
| 181 public: | 181 public: |
| 182 // divisor == 0 means decode the whole image | 182 // divisor == 0 means decode the whole image |
| 183 // divisor > 0 means decode in subsets, dividing into a divisor x divisor gr
id. | 183 // divisor > 0 means decode in subsets, dividing into a divisor x divisor gr
id. |
| 184 explicit ImageSrc(Path path, int divisor = 0); | 184 explicit ImageSrc(Path path, int divisor = 0); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 class ViaTwice : public Via { | 363 class ViaTwice : public Via { |
| 364 public: | 364 public: |
| 365 explicit ViaTwice(Sink* sink) : Via(sink) {} | 365 explicit ViaTwice(Sink* sink) : Via(sink) {} |
| 366 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 366 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
| 367 }; | 367 }; |
| 368 | 368 |
| 369 } // namespace DM | 369 } // namespace DM |
| 370 | 370 |
| 371 #endif//DMSrcSink_DEFINED | 371 #endif//DMSrcSink_DEFINED |
| OLD | NEW |