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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 SkAlphaType fDstAlphaType; | 197 SkAlphaType fDstAlphaType; |
198 bool fIsGpu; | 198 bool fIsGpu; |
199 bool fRunSerially; | 199 bool fRunSerially; |
200 }; | 200 }; |
201 | 201 |
202 class ColorCodecSrc : public Src { | 202 class ColorCodecSrc : public Src { |
203 public: | 203 public: |
204 enum Mode { | 204 enum Mode { |
205 // Mimic legacy behavior and apply no color correction. | 205 // Mimic legacy behavior and apply no color correction. |
206 kBaseline_Mode, | 206 kBaseline_Mode, |
| 207 |
| 208 // Color correct images into a specific dst color space. If you happen
to have this |
| 209 // monitor, you're in luck! The unmarked outputs of this test should di
splay |
| 210 // correctly on this monitor in the Chrome browser. If not, it's useful
to know |
| 211 // that this monitor has a profile that is fairly similar to Adobe RGB. |
| 212 // TODO (msarett): Should we add a new test with a new monitor and verif
y that outputs |
| 213 // look identical on two different dsts? |
| 214 kDst_HPZR30w_Mode, |
207 }; | 215 }; |
208 | 216 |
209 ColorCodecSrc(Path, Mode); | 217 ColorCodecSrc(Path, Mode, sk_sp<SkColorSpace>); |
210 | 218 |
211 Error draw(SkCanvas*) const override; | 219 Error draw(SkCanvas*) const override; |
212 SkISize size() const override; | 220 SkISize size() const override; |
213 Name name() const override; | 221 Name name() const override; |
214 bool veto(SinkFlags) const override; | 222 bool veto(SinkFlags) const override; |
215 private: | 223 private: |
216 Path fPath; | 224 Path fPath; |
217 Mode fMode; | 225 Mode fMode; |
| 226 sk_sp<SkColorSpace> fDstSpace; |
218 }; | 227 }; |
219 | 228 |
220 class SKPSrc : public Src { | 229 class SKPSrc : public Src { |
221 public: | 230 public: |
222 explicit SKPSrc(Path path); | 231 explicit SKPSrc(Path path); |
223 | 232 |
224 Error draw(SkCanvas*) const override; | 233 Error draw(SkCanvas*) const override; |
225 SkISize size() const override; | 234 SkISize size() const override; |
226 Name name() const override; | 235 Name name() const override; |
227 private: | 236 private: |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 392 |
384 class ViaMojo : public Via { | 393 class ViaMojo : public Via { |
385 public: | 394 public: |
386 explicit ViaMojo(Sink* sink) : Via(sink) {} | 395 explicit ViaMojo(Sink* sink) : Via(sink) {} |
387 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 396 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
388 }; | 397 }; |
389 | 398 |
390 } // namespace DM | 399 } // namespace DM |
391 | 400 |
392 #endif//DMSrcSink_DEFINED | 401 #endif//DMSrcSink_DEFINED |
OLD | NEW |