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 #include "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
9 #include "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 , fMode(mode) | 264 , fMode(mode) |
265 , fDstColorType(dstColorType) | 265 , fDstColorType(dstColorType) |
266 , fDstAlphaType(dstAlphaType) | 266 , fDstAlphaType(dstAlphaType) |
267 , fScale(scale) | 267 , fScale(scale) |
268 , fRunSerially(serial_from_path_name(path)) | 268 , fRunSerially(serial_from_path_name(path)) |
269 {} | 269 {} |
270 | 270 |
271 bool CodecSrc::veto(SinkFlags flags) const { | 271 bool CodecSrc::veto(SinkFlags flags) const { |
272 // Test CodecImageGenerator on 8888, 565, and gpu | 272 // Test CodecImageGenerator on 8888, 565, and gpu |
273 if (kGen_Mode == fMode) { | 273 if (kGen_Mode == fMode) { |
274 return flags.type != SinkFlags::kRaster || flags.type != SinkFlags::kGPU
|| | 274 // For image generator, we want to test kDirect approaches for kRaster a
nd kGPU, |
| 275 // while skipping everything else. |
| 276 return (flags.type != SinkFlags::kRaster && flags.type != SinkFlags::kGP
U) || |
275 flags.approach != SinkFlags::kDirect; | 277 flags.approach != SinkFlags::kDirect; |
276 } | 278 } |
277 | 279 |
278 // Test all other modes to direct raster backends (8888 and 565). | 280 // Test all other modes to direct raster backends (8888 and 565). |
279 return flags.type != SinkFlags::kRaster || flags.approach != SinkFlags::kDir
ect; | 281 return flags.type != SinkFlags::kRaster || flags.approach != SinkFlags::kDir
ect; |
280 } | 282 } |
281 | 283 |
282 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 and s
kbug.com/3339. | 284 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 and s
kbug.com/3339. |
283 // This allows us to still test unpremultiplied decodes. | 285 // This allows us to still test unpremultiplied decodes. |
284 void premultiply_if_necessary(SkBitmap& bitmap) { | 286 void premultiply_if_necessary(SkBitmap& bitmap) { |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 skr.visit<void>(i, drawsAsSingletonPictures); | 1410 skr.visit<void>(i, drawsAsSingletonPictures); |
1409 } | 1411 } |
1410 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1412 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
1411 | 1413 |
1412 canvas->drawPicture(macroPic); | 1414 canvas->drawPicture(macroPic); |
1413 return check_against_reference(bitmap, src, fSink); | 1415 return check_against_reference(bitmap, src, fSink); |
1414 }); | 1416 }); |
1415 } | 1417 } |
1416 | 1418 |
1417 } // namespace DM | 1419 } // namespace DM |
OLD | NEW |