Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: dm/DMSrcSink.h

Issue 1327433003: Various improvements to CodecSrc testing in dm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use loops to improve readability Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« dm/DM.cpp ('K') | « dm/DM.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 Name name() const override; 95 Name name() const override;
96 void modifyGrContextOptions(GrContextOptions* options) const override; 96 void modifyGrContextOptions(GrContextOptions* options) const override;
97 97
98 private: 98 private:
99 skiagm::GMRegistry::Factory fFactory; 99 skiagm::GMRegistry::Factory fFactory;
100 }; 100 };
101 101
102 class CodecSrc : public Src { 102 class CodecSrc : public Src {
103 public: 103 public:
104 enum Mode { 104 enum Mode {
105 kNormal_Mode, 105 kScaledCodec_Mode,
106 kCodec_Mode,
106 kScanline_Mode, 107 kScanline_Mode,
107 kScanline_Subset_Mode, 108 kScanline_Subset_Mode,
108 kStripe_Mode, // Tests the skipping of scanlines 109 kStripe_Mode, // Tests the skipping of scanlines
109 kSubset_Mode, // For codecs that support subsets directly. 110 kSubset_Mode, // For codecs that support subsets directly.
110 }; 111 };
111 enum DstColorType { 112 enum DstColorType {
112 kGetFromCanvas_DstColorType, 113 kGetFromCanvas_DstColorType,
113 kIndex8_Always_DstColorType, 114 kIndex8_Always_DstColorType,
114 kGrayscale_Always_DstColorType, 115 kGrayscale_Always_DstColorType,
115 }; 116 };
116 CodecSrc(Path, Mode, DstColorType, float); 117 CodecSrc(Path, Mode, DstColorType, float, SkString*);
117 118
118 Error draw(SkCanvas*) const override; 119 Error draw(SkCanvas*) const override;
119 SkISize size() const override; 120 SkISize size() const override;
120 Name name() const override; 121 Name name() const override;
121 bool veto(SinkFlags) const override; 122 bool veto(SinkFlags) const override;
122 private: 123 private:
123 Path fPath; 124 Path fPath;
124 Mode fMode; 125 Mode fMode;
125 DstColorType fDstColorType; 126 DstColorType fDstColorType;
126 float fScale; 127 float fScale;
128 // Because we are not using a literal, we must keep the
129 // name of the output directory as a field, so it remains
130 // in live memory until it is used.
131 SkAutoTDelete<SkString> fFolder;
127 }; 132 };
128 133
129 134
130 class ImageSrc : public Src { 135 class ImageSrc : public Src {
131 public: 136 public:
132 // divisor == 0 means decode the whole image 137 // divisor == 0 means decode the whole image
133 // divisor > 0 means decode in subsets, dividing into a divisor x divisor gr id. 138 // divisor > 0 means decode in subsets, dividing into a divisor x divisor gr id.
134 explicit ImageSrc(Path path, int divisor = 0); 139 explicit ImageSrc(Path path, int divisor = 0);
135 140
136 Error draw(SkCanvas*) const override; 141 Error draw(SkCanvas*) const override;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 313
309 class ViaTwice : public Via { 314 class ViaTwice : public Via {
310 public: 315 public:
311 explicit ViaTwice(Sink* sink) : Via(sink) {} 316 explicit ViaTwice(Sink* sink) : Via(sink) {}
312 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; 317 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
313 }; 318 };
314 319
315 } // namespace DM 320 } // namespace DM
316 321
317 #endif//DMSrcSink_DEFINED 322 #endif//DMSrcSink_DEFINED
OLDNEW
« dm/DM.cpp ('K') | « dm/DM.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698