| 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.approach != SinkFlags:
:kDirect) && | 274 return flags.type != SinkFlags::kRaster || flags.type != SinkFlags::kGPU
|| |
| 275 flags.type != SinkFlags::kGPU; | 275 flags.approach != SinkFlags::kDirect; |
| 276 } | 276 } |
| 277 | 277 |
| 278 // Test all other modes to direct raster backends (8888 and 565). | 278 // Test all other modes to direct raster backends (8888 and 565). |
| 279 return flags.type != SinkFlags::kRaster || flags.approach != SinkFlags::kDir
ect; | 279 return flags.type != SinkFlags::kRaster || flags.approach != SinkFlags::kDir
ect; |
| 280 } | 280 } |
| 281 | 281 |
| 282 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 and s
kbug.com/3339. | 282 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 and s
kbug.com/3339. |
| 283 // This allows us to still test unpremultiplied decodes. | 283 // This allows us to still test unpremultiplied decodes. |
| 284 void premultiply_if_necessary(SkBitmap& bitmap) { | 284 void premultiply_if_necessary(SkBitmap& bitmap) { |
| 285 if (kUnpremul_SkAlphaType != bitmap.alphaType()) { | 285 if (kUnpremul_SkAlphaType != bitmap.alphaType()) { |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 skr.visit<void>(i, drawsAsSingletonPictures); | 1408 skr.visit<void>(i, drawsAsSingletonPictures); |
| 1409 } | 1409 } |
| 1410 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1410 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
| 1411 | 1411 |
| 1412 canvas->drawPicture(macroPic); | 1412 canvas->drawPicture(macroPic); |
| 1413 return check_against_reference(bitmap, src, fSink); | 1413 return check_against_reference(bitmap, src, fSink); |
| 1414 }); | 1414 }); |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 } // namespace DM | 1417 } // namespace DM |
| OLD | NEW |