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 "SkBitmapRegionDecoder.h" |
15 #include "SkCanvas.h" | 16 #include "SkCanvas.h" |
16 #include "SkCodec.h" | 17 #include "SkCodec.h" |
17 #include "SkData.h" | 18 #include "SkData.h" |
18 #include "SkGPipe.h" | 19 #include "SkGPipe.h" |
19 #include "SkPicture.h" | 20 #include "SkPicture.h" |
20 #include "gm.h" | 21 #include "gm.h" |
21 | 22 |
22 namespace DM { | 23 namespace DM { |
23 | 24 |
24 // This is just convenience. It lets you use either return "foo" or return SkSt
ringPrintf(...). | 25 // This is just convenience. It lets you use either return "foo" or return SkSt
ringPrintf(...). |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 94 |
94 Error draw(SkCanvas*) const override; | 95 Error draw(SkCanvas*) const override; |
95 SkISize size() const override; | 96 SkISize size() const override; |
96 Name name() const override; | 97 Name name() const override; |
97 void modifyGrContextOptions(GrContextOptions* options) const override; | 98 void modifyGrContextOptions(GrContextOptions* options) const override; |
98 | 99 |
99 private: | 100 private: |
100 skiagm::GMRegistry::Factory fFactory; | 101 skiagm::GMRegistry::Factory fFactory; |
101 }; | 102 }; |
102 | 103 |
| 104 // Allows for testing of various implementations of Android's BitmapRegionDecode
r |
| 105 class BRDSrc : public Src { |
| 106 public: |
| 107 enum Mode { |
| 108 kFullImage_Mode, |
| 109 kDivisor_Mode, |
| 110 }; |
| 111 |
| 112 BRDSrc(Path, SkBitmapRegionDecoder::Strategy, Mode, SkColorType, uint32_t); |
| 113 |
| 114 Error draw(SkCanvas*) const override; |
| 115 SkISize size() const override; |
| 116 Name name() const override; |
| 117 bool veto(SinkFlags) const override; |
| 118 private: |
| 119 Path fPath; |
| 120 SkBitmapRegionDecoder::Strategy fStrategy; |
| 121 Mode fMode; |
| 122 SkColorType fColorType; |
| 123 uint32_t fSampleSize; |
| 124 }; |
| 125 |
103 class CodecSrc : public Src { | 126 class CodecSrc : public Src { |
104 public: | 127 public: |
105 enum Mode { | 128 enum Mode { |
106 kNormal_Mode, | 129 kNormal_Mode, |
107 kScanline_Mode, | 130 kScanline_Mode, |
108 kScanline_Subset_Mode, | 131 kScanline_Subset_Mode, |
109 kStripe_Mode, // Tests the skipping of scanlines | 132 kStripe_Mode, // Tests the skipping of scanlines |
110 kSubset_Mode, // For codecs that support subsets directly. | 133 kSubset_Mode, // For codecs that support subsets directly. |
111 }; | 134 }; |
112 enum DstColorType { | 135 enum DstColorType { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 332 |
310 class ViaTwice : public Via { | 333 class ViaTwice : public Via { |
311 public: | 334 public: |
312 explicit ViaTwice(Sink* sink) : Via(sink) {} | 335 explicit ViaTwice(Sink* sink) : Via(sink) {} |
313 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 336 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
314 }; | 337 }; |
315 | 338 |
316 } // namespace DM | 339 } // namespace DM |
317 | 340 |
318 #endif//DMSrcSink_DEFINED | 341 #endif//DMSrcSink_DEFINED |
OLD | NEW |