| 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 "SamplePipeControllers.h" | 9 #include "SamplePipeControllers.h" |
| 10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return flags.type != SinkFlags::kRaster | 81 return flags.type != SinkFlags::kRaster |
| 82 || flags.approach != SinkFlags::kDirect; | 82 || flags.approach != SinkFlags::kDirect; |
| 83 } | 83 } |
| 84 | 84 |
| 85 static SkBitmapRegionDecoderInterface* create_brd(Path path, | 85 static SkBitmapRegionDecoderInterface* create_brd(Path path, |
| 86 SkBitmapRegionDecoderInterface::Strategy strategy) { | 86 SkBitmapRegionDecoderInterface::Strategy strategy) { |
| 87 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); | 87 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); |
| 88 if (!encoded) { | 88 if (!encoded) { |
| 89 return NULL; | 89 return NULL; |
| 90 } | 90 } |
| 91 return SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(new SkMemor
yStream(encoded), | 91 return SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(encoded, st
rategy); |
| 92 strategy); | |
| 93 } | 92 } |
| 94 | 93 |
| 95 Error BRDSrc::draw(SkCanvas* canvas) const { | 94 Error BRDSrc::draw(SkCanvas* canvas) const { |
| 96 SkColorType colorType = canvas->imageInfo().colorType(); | 95 SkColorType colorType = canvas->imageInfo().colorType(); |
| 97 if (kRGB_565_SkColorType == colorType && | 96 if (kRGB_565_SkColorType == colorType && |
| 98 CodecSrc::kGetFromCanvas_DstColorType != fDstColorType) { | 97 CodecSrc::kGetFromCanvas_DstColorType != fDstColorType) { |
| 99 return Error::Nonfatal("Testing non-565 to 565 is uninteresting."); | 98 return Error::Nonfatal("Testing non-565 to 565 is uninteresting."); |
| 100 } | 99 } |
| 101 switch (fDstColorType) { | 100 switch (fDstColorType) { |
| 102 case CodecSrc::kGetFromCanvas_DstColorType: | 101 case CodecSrc::kGetFromCanvas_DstColorType: |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 skr.visit<void>(i, drawsAsSingletonPictures); | 1354 skr.visit<void>(i, drawsAsSingletonPictures); |
| 1356 } | 1355 } |
| 1357 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1356 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
| 1358 | 1357 |
| 1359 canvas->drawPicture(macroPic); | 1358 canvas->drawPicture(macroPic); |
| 1360 return ""; | 1359 return ""; |
| 1361 }); | 1360 }); |
| 1362 } | 1361 } |
| 1363 | 1362 |
| 1364 } // namespace DM | 1363 } // namespace DM |
| OLD | NEW |