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 "SkData.h" | 17 #include "SkData.h" |
17 #include "SkGPipe.h" | 18 #include "SkGPipe.h" |
18 #include "SkPicture.h" | 19 #include "SkPicture.h" |
19 #include "gm.h" | 20 #include "gm.h" |
20 | 21 |
21 namespace DM { | 22 namespace DM { |
22 | 23 |
23 // 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(...). |
24 struct ImplicitString : public SkString { | 25 struct ImplicitString : public SkString { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 | 93 |
93 Error draw(SkCanvas*) const override; | 94 Error draw(SkCanvas*) const override; |
94 SkISize size() const override; | 95 SkISize size() const override; |
95 Name name() const override; | 96 Name name() const override; |
96 void modifyGrContextOptions(GrContextOptions* options) const override; | 97 void modifyGrContextOptions(GrContextOptions* options) const override; |
97 | 98 |
98 private: | 99 private: |
99 skiagm::GMRegistry::Factory fFactory; | 100 skiagm::GMRegistry::Factory fFactory; |
100 }; | 101 }; |
101 | 102 |
103 // Allows for testing of various implementations of Android's BitmapRegionDecode r | |
104 class BRDSrc : public Src { | |
105 public: | |
106 enum Mode { | |
107 kFullImage_Mode, | |
scroggo
2015/09/01 22:05:28
Maybe add some comments explaining what these mean
msarett
2015/09/02 18:02:23
Yes that would be helpful. Done.
| |
108 kDivisor_Mode, | |
109 }; | |
110 | |
111 BRDSrc(Path, SkBitmapRegionDecoder::Strategy, Mode, SkColorType, uint32_t); | |
112 | |
113 Error draw(SkCanvas*) const override; | |
114 SkISize size() const override; | |
115 Name name() const override; | |
116 bool veto(SinkFlags) const override; | |
117 private: | |
118 Path fPath; | |
119 SkBitmapRegionDecoder::Strategy fStrategy; | |
120 Mode fMode; | |
121 SkColorType fColorType; | |
122 uint32_t fSampleSize; | |
123 }; | |
124 | |
102 class CodecSrc : public Src { | 125 class CodecSrc : public Src { |
103 public: | 126 public: |
104 enum Mode { | 127 enum Mode { |
105 kNormal_Mode, | 128 kNormal_Mode, |
106 kScanline_Mode, | 129 kScanline_Mode, |
107 kScanline_Subset_Mode, | 130 kScanline_Subset_Mode, |
108 kStripe_Mode, // Tests the skipping of scanlines | 131 kStripe_Mode, // Tests the skipping of scanlines |
109 kSubset_Mode, // For codecs that support subsets directly. | 132 kSubset_Mode, // For codecs that support subsets directly. |
110 }; | 133 }; |
111 enum DstColorType { | 134 enum DstColorType { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 | 331 |
309 class ViaTwice : public Via { | 332 class ViaTwice : public Via { |
310 public: | 333 public: |
311 explicit ViaTwice(Sink* sink) : Via(sink) {} | 334 explicit ViaTwice(Sink* sink) : Via(sink) {} |
312 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 335 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
313 }; | 336 }; |
314 | 337 |
315 } // namespace DM | 338 } // namespace DM |
316 | 339 |
317 #endif//DMSrcSink_DEFINED | 340 #endif//DMSrcSink_DEFINED |
OLD | NEW |