| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 private: | 87 private: |
| 88 skiagm::GMRegistry::Factory fFactory; | 88 skiagm::GMRegistry::Factory fFactory; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class CodecSrc : public Src { | 91 class CodecSrc : public Src { |
| 92 public: | 92 public: |
| 93 enum Mode { | 93 enum Mode { |
| 94 kNormal_Mode, | 94 kNormal_Mode, |
| 95 kScanline_Mode, | 95 kScanline_Mode, |
| 96 }; | 96 }; |
| 97 CodecSrc(Path, Mode); | 97 enum DstColorType { |
| 98 kGetFromCanvas_DstColorType, |
| 99 kIndex8_Always_DstColorType, |
| 100 kGrayscale_Always_DstColorType, |
| 101 }; |
| 102 CodecSrc(Path, Mode, DstColorType); |
| 98 | 103 |
| 99 Error draw(SkCanvas*) const override; | 104 Error draw(SkCanvas*) const override; |
| 100 SkISize size() const override; | 105 SkISize size() const override; |
| 101 Name name() const override; | 106 Name name() const override; |
| 102 private: | 107 private: |
| 103 Path fPath; | 108 Path fPath; |
| 104 Mode fMode; | 109 Mode fMode; |
| 110 DstColorType fDstColorType; |
| 105 }; | 111 }; |
| 106 | 112 |
| 107 | 113 |
| 108 class ImageSrc : public Src { | 114 class ImageSrc : public Src { |
| 109 public: | 115 public: |
| 110 // divisor == 0 means decode the whole image | 116 // divisor == 0 means decode the whole image |
| 111 // divisor > 0 means decode in subsets, dividing into a divisor x divisor gr
id. | 117 // divisor > 0 means decode in subsets, dividing into a divisor x divisor gr
id. |
| 112 explicit ImageSrc(Path path, int divisor = 0); | 118 explicit ImageSrc(Path path, int divisor = 0); |
| 113 | 119 |
| 114 Error draw(SkCanvas*) const override; | 120 Error draw(SkCanvas*) const override; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 279 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
| 274 int enclave() const override { return fSink->enclave(); } | 280 int enclave() const override { return fSink->enclave(); } |
| 275 const char* fileExtension() const override { return fSink->fileExtension();
} | 281 const char* fileExtension() const override { return fSink->fileExtension();
} |
| 276 private: | 282 private: |
| 277 SkAutoTDelete<Sink> fSink; | 283 SkAutoTDelete<Sink> fSink; |
| 278 }; | 284 }; |
| 279 | 285 |
| 280 } // namespace DM | 286 } // namespace DM |
| 281 | 287 |
| 282 #endif//DMSrcSink_DEFINED | 288 #endif//DMSrcSink_DEFINED |
| OLD | NEW |